MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Extract XLM data from in Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg125895] Re: Extract XLM data from in Mathematica
  • From: Murta <rodrigomurtax at gmail.com>
  • Date: Fri, 6 Apr 2012 05:55:38 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <jl150v$lcf$1@smc.vnet.net> <jl3uhv$3f1$1@smc.vnet.net>

On Mar 30, 6:31 am, Chris Degnen <deg... at cwgsy.net> wrote:
> It looks more complicated than it is.  I was able to do
> everything I needed with just two commands.  E.g.
>
> retrievedXML = ImportString[XMLdataRecord, "XML",
>    "NormalizeWhitespace" -> False];
>
> {numbers} = Cases[retrievedXML,
>     XMLElement["telephonenumbers", _, _],
>     Infinity] /. XMLElement[_, _, {val_}] :> val;
>
>
>
>
>
>
>
> On Thursday, March 29, 2012 9:03:43 AM UTC+1, Murta wrote:
> > Hi All
>
> >     I was trying to extract some data from a XML using Mathematica and
> > I discovered that it's terribly complicated, with a lot of pattern
> > inside pattern.
> >     I was using this reference to guide me:
> >    http://reference.wolfram.com/mathematica/XML/tutorial/TransformingXML...
> >     There is some package to make life easier?
>
> > tks in advance
> > Murta
Tks for your answer Chris, but for deeper level XML the notations get
cryptcal and unreadable.
I get some tips in Mathematica Cookbook XML part (page 212 from
printed version).
One simple one that I liked was this:

cleanedXML = Apply[List,dataXML,{0,Infinity}]

It make the XML much more clean to read.

best Regards
Murta



  • Prev by Date: Evaluating Exponential functions
  • Next by Date: Re: Bug in pattern test, or I did something wrong?
  • Previous by thread: Re: Evaluating Exponential functions
  • Next by thread: Re: Extract XLM data from in Mathematica