Subject: Re: [xsl] Problem with grouping sibling tags From: Casper Voortman <casper.voortman@xxxxxxxxxxxx> Date: Tue, 23 Dec 2008 12:12:01 +0100 |
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/
can't figure-----Original Message----- From: Casper Voortman [mailto:casper.voortman@xxxxxxxxxxxx] Sent: 23 December 2008 10:25 To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: [xsl] Problem with grouping sibling tags
Hey everyone,
I have a problem within an xslt i'm writing that i justout how to solve. I think i have to use either some kind ofgroupingor work with preceding-sibling or following-sibling, maybeeven bothcombined together. It has to be done in xslt version 1.0which (for asmuch as i have read on it) seems to be more complicated onitself asfar as groupings and such go.replaced the
Here is a small description together with some samples.
The XML follows a structure like the following ( i havefollowingoriginal 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 thestructure:together in the
<?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 groupedfairly longnew 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 aone and it might clutter the issue.
Any help would be greatly appreciated and would make my x-mas.
Regards,
Casper Voortman
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Problem with grouping sib, Michael Kay | Thread | [xsl] Unable to replace "/", V.Ramkumar |
[xsl] Error within cals table xslt, J. S. Rawat | Date | RE: [xsl] Error within cals table x, Michael Kay |
Month |