[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Problem with grouping sibling tags

Subject: RE: Problem with grouping sibling tags
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 23 Dec 2008 10:45:08 -0000
RE:  Problem with grouping sibling tags
> Go to http://xsl.markmail.org/ and search for "group adjacent bullets".

And in particular Ken Holman's post at
http://markmail.org/message/teo6uftbxjvsa56c (dated 22 Oct 1999) which must
be the earliest exposition of the technique often called "sibling
recursion".

Michael Kay
http://www.saxonica.com/ 

> 
> > -----Original Message-----
> > From: Casper Voortman [mailto:casper.voortman@xxxxxxxxxxxx]
> > Sent: 23 December 2008 10:25
> > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > Subject:  Problem with grouping sibling tags
> > 
> > Hey everyone,
> > 
> > I have a problem within an xslt i'm writing that i just 
> can't figure 
> > out how to solve. I think i have to use either some kind of 
> grouping 
> > or work with preceding-sibling or following-sibling, maybe 
> even both 
> > combined together. It has to be done in xslt version 1.0 
> which (for as 
> > much as i have read on it) seems to be more complicated on 
> itself as 
> > far as groupings and such go.
> > 
> > Here is a small description together with some samples.
> > 
> > The XML follows a structure like the following ( i have 
> replaced the 
> > original text for 'textcontent' and 'bullet'
> > otherwise it would get too long a mail):
> > 
> > <?xml version="1.0" encoding="UTF-8"?> <ArticleContent>
> >      <Frame Label="BroodTekst">
> >          <Paragraph Pstyle="Tussenkop">
> >              <Text Cstyle="[No character style]">textcontent</Text>
> >              <Text Cstyle="[No character style]"/>
> >          </Paragraph>
> >          <Paragraph Pstyle="PlattetekstInitiaal">
> >              <Text Cstyle="[No character style]">textcontent</Text>
> >          </Paragraph>
> >          <Paragraph Pstyle="PlattetekstBullet">
> >              <Text Cstyle="[No character style]">bullet1</Text>
> >          </Paragraph>
> >          <Paragraph Pstyle="PlattetekstBullet">
> >              <Text Cstyle="[No character style]">bullet2</Text>
> >          </Paragraph>
> >          <Paragraph Pstyle="Plattetekst">
> >              <Text Cstyle="[No character style]">textcontent</Text>
> >          </Paragraph>
> >          <Paragraph Pstyle="Plattetekst">
> >              <Text Cstyle="[No character style]">textcontent</Text>
> >          </Paragraph>
> >          <Paragraph Pstyle="PlattetekstBullet">
> >              <Text Cstyle="[No character style]">bullet3</Text>
> >          </Paragraph>
> >      </Frame>
> > </ArticleContent>
> > 
> > This needs to be converted to another XML file that has the 
> following
> > structure:
> > 
> > <?xml version="1.0" encoding="utf-8"?> <section role="broodtekst"> 
> > <title role="tussenkop">textcontent</title>
> > <para role="plattetekstinitiaal">textcontent</para>
> > <itemizedlist>
> > 	<listitem>
> > 	   <para role="plattetekstbullet">bullet1</para>
> > 	</listitem>
> > 	<listitem>
> > 	   <para role="plattetekstbullet">bullet2</para>
> > 	</listitem>
> > </itemizedlist>
> > <para role="plattetekst">textcontent</para>
> > <para role="plattetekst">textcontent</para>
> > <itemizedlist>
> > 	<listitem>
> > 	   <para role="plattetekstbullet">bullet3</para>
> > 	</listitem>
> > </itemizedlist>
> > </frame>
> > 
> > Now my problem is with the original tags <Paragraph 
> > Pstyle="PlattetekstBullet"> these need to be grouped 
> together in the 
> > new tag <itemizedlist>, but the structure within the story needs to 
> > stay intact. So when another <Paragraph Pstyle="PlattetekstBullet"> 
> > appears that is not preceded or followed by the same <Paragraph 
> > Pstyle="PlattetekstBullet"> tag they need to be grouped as well 
> > separately.
> > 
> > I can provide the XSLT i have sofar if needed, but it's a 
> fairly long 
> > one and it might clutter the issue.
> > 
> > Any help would be greatly appreciated and would make my x-mas.
> > 
> > Regards,
> > 
> > Casper Voortman

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.