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

Re: defining sections

Subject: Re: defining sections
From: Markus Abt <abt@xxxxxxxx>
Date: Fri, 25 Nov 2005 16:24:24 +0100
functional requirements template
Hi,

a simpler approach would be:

<xsl:template match="root">
	<root>
		<artefact doc_ref="{$DOC_REF}" type_id="1">
			<xsl:apply-templates select="data"/>
		</artefact>
	</root>
</xsl:template>

<xsl:template match="data[following-sibling::data
			[.='Design Derived Requirements']]">
	<before>
		<xsl:value-of select="."/>
	</before>
</xsl:template>

<xsl:template match="data">
	<after>
		<xsl:value-of select="."/>
	</after>
</xsl:template>


The first data template handles all data elements which have
a "Design Derived Requirements" following sibling.

The second data template is used for the other data elements.
It has higher implicit priority so there is no need for a
predicate expression here.


Regards,
Markus


----------
Von: 	geoff hopkins
Gesendet: 	Freitag, 25. November 2005 14:48
An: 	xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Betreff: 	Re:  defining sections

I am really sorry but I am confused big time....

I have:

	<xsl:template match="root">
		<root>
			<artefact doc_ref="{$DOC_REF}" type_id="1">
				<xsl:apply-templates select="data"/>
			</artefact>
		</root>
	</xsl:template>

	<xsl:template match="data"/>

	<xsl:template match="data[.='Functional
Requirements']">
		<before>
			<xsl:value-of select="."/>
		</before>
		<xsl:apply-templates select="data[.='Functional
Requirements']/following::data[following::data[.='Design
Derived Requirements']]"/>
	</xsl:template>

	<xsl:template match="data[.='Design Derived
Requirements']">
		<after>
			<xsl:value-of select="."/>
		</after>
		<xsl:apply-templates select="data[.='Design Derived
Requirements']/following::data"/>
	</xsl:template>

But need some sort of output like...

<?xml version="1.0" encoding="ISO-8859-1"?>
<root>
<before>Functional Requirements</before>
<before></before>
<before>text</before>
<before></before>
<before>text</before>
<before></before>
<before>text</before>
<before></before>
<before>text</before>
<before>text</before>
<before>text</before>
<before>text</before>
<before>text</before>
<before>text</before>
<before>text</before>
<before>text</before>
<before>text</before>
<before></before>
<before>text</before>
<before></before>
<after>Design Derived Requirements</after>
<after></after>
<after>text</after>
<after></after>
<after>text</after>
<after></after>
<after>text</after>
<after></after>
<after>text</after>
</root>


	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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.