MathGroup Archive 2012

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

Search the Archive

Re: Extract XLM data from in Mathematica


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