Re: [xsl] Order of xsl:template matching

Subject: Re: [xsl] Order of xsl:template matching
From: Mukul Gandhi <mukul_gandhi@xxxxxxxxx>
Date: Wed, 11 May 2005 05:57:28 -0700 (PDT)
For e.g. if the XML is ..
<test>
 <TEXT>sldj aldj aldj a</TEXT>
 <REPORT>12345</REPORT>
</test>

You may do -

<xsl:template match="test">
  <xsl:apply-templates select="REPORT" />
  <xsl:apply-templates select="TEXT" />
</xsl:template>

<xsl:template match="TEXT">
  <!-- anything you wish to write -->
</xsl:template>

<xsl:template match="REPORT">
  <!-- anything you wish to write -->
</xsl:template>

Regards,
Mukul

--- mylistaddress@xxxxxxxxxx wrote:
> Hi again,
> 
> Given this XML chunk:
> <TEXT>sldj aldj aldj a</TEXT>
> <REPORT>12345</REPORT>
> 
> How can I apply templates and have the REPORT appear
> before the TEXT in the results of the
> transformation?
> 
> By default, ther matches seem to get processed in
> the
> order in which they appear in the XML. To change
> this
> order, must I use xsl:value-of select= of the
> fields,
> or can it be done with template matching?
> 
> Thanks,
> 
> JW
> 
> 


		
Discover Yahoo! 
Use Yahoo! to plan a weekend, have fun online and more. Check it out! 
http://discover.yahoo.com/

Current Thread