[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: Casper Voortman <casper.voortman@xxxxxxxxxxxx>
Date: Tue, 23 Dec 2008 11:48:52 +0100
Re:  Problem with grouping sibling tags
Michael,

Thanks for the tip, but this has to be done in xsl version 1.0 and as far as i have seen 'group adjacent' only works on version 2.0 or am i mistaken?

Regards,

Casper Voortman

Op 23 dec 2008, om 11:41 heeft Michael Kay het volgende geschreven:

Go to http://xsl.markmail.org/ and search for "group adjacent bullets".

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.