[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: flat xml structure parsing
For discussions of this type of problem, search for "XSLT positional grouping". If there's only one start/end pair, try: XSLT 2.0: xsl:variable name="doc" select="document" $doc/section[. >> $doc/section[paragraph/@name='start'] and . << $doc/section[paragraph/@name='end']/paragraph XSLT 1.0: xsl:variable name="doc" select="document" $doc/section[paragraph/@name='start']/ following-sibling::section[following-sibling::section[paragraph/@name='end]] / paragraph Michael Kay Saxonica Limited > -----Original Message----- > From: Jimmy [mailto:jimmy@xxxxxxxxxxxxxx] > Sent: 05 September 2006 10:02 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: flat xml structure parsing > > I have a given flat xml structure of which I have to build a > hierarchical structure. Following situation: > > <document> > <section> > <paragraph name="start"> > </section> > <section> > <paragraph name="x"> > </section> > <section> > <paragraph name="x"> > </section> > <section> > <paragraph name="end"> > </section> > <section> > <paragraph name="x"> > </section> > </document> > > I'm starting from the paragraph with the name "start" and > have get all the "x" (unknown how many) until the paragraph > "end". So this leaves every "x" following the end. Anyone got > an idea how I can manage this? > > Cheers > Jimmy
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|