MathGroup Archive 2010

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

Search the Archive

RuleDelayed for parsing XML with multiple children

  • To: mathgroup at
  • Subject: [mg109591] RuleDelayed for parsing XML with multiple children
  • From: Zach Bjornson <bjornson at>
  • Date: Fri, 7 May 2010 06:29:00 -0400 (EDT)


I'm trying to extract multiple values (same depth, different physical 
level) from an XML tree using RuleDelayed, but I realized that using 
RuleDelayed only extracts one of the children. That is:

XmlTree follows the form:

I want those two values.


This only gives value1. I can explicitly add more XMLElement tags to get 
the other value


but I don't want to use an explicit structure because the number of 
children/values varies.

Any have suggestions for the best alternative method to the RuleDelayed 
syntax I'm using? Changing the innermost XMLElement tag to simply 
XMLElement["Child",_,_] gives the proper answer, albeit with the messy 
flanking tree structure. Dropping indices is not an ideal solution.


  • Prev by Date: HoldFirst, Unevaluated
  • Next by Date: Plot3D problems: no plot in some cases
  • Previous by thread: Re: HoldFirst, Unevaluated
  • Next by thread: Re: RuleDelayed for parsing XML with multiple children