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

RE: Problems with a right order display of tags

Subject: RE: Problems with a right order display of tags
From: "Ragulf Pickaxe" <jawxml@xxxxxxxxxxx>
Date: Wed, 31 Mar 2004 11:46:27 +0000
xsl apply templates order
Hi Bertrand,

..
But I must show extract because my XSL and my XML are very large..


My XSL:


<body>
<table border="1">
	<tr>
		<td>

		<xsl:apply-templates
select="/tim/Tache_struct"></xsl:apply-templates>
		<xsl:apply-templates
select="/tim/Tache_struct/Tache_atomique"></xsl:apply-templates>
		<xsl:apply-templates
select="/tim/Tache_struct/Tache_struct"></xsl:apply-templates>

		</td>
	</tr>
	</table>
</body>


What you are saying here is: do templates on all elements "Tache_struct" that have a parent element "tim" which is the root of the document, then do templates on all elements "Tache_atomique" than has "Tache_struct" as parent, which in turn has "tim" as parent (which is root), then do the "Tache_struct" that has "Tache_struct" as parent that has....


In short, you are directing the sequence of processing - first one type of elements, then the next type, then.... Doing things this way will break the original order of the elements.

I would imagine you would want something like:

<body>
<table border="1">
	<tr>
		<td>
		<xsl:apply-templates
select="/tim/Tache_struct"></xsl:apply-templates>
		</td>
	</tr>
	</table>
</body>

<xsl:template name="Tache_struct">
		<xsl:apply-templates/>
</xsl:template>

Then have a template for "Tache_atomique" and one for "Tache_struct", which I presume you have, getting the output that you do.

Regards,
Ragulf Pickaxe :)

_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail


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.