RE: [xsl] template match for subelement throughout tree

Subject: RE: [xsl] template match for subelement throughout tree
From: "bix xslt" <bix_xslt@xxxxxxxxxxx>
Date: Thu, 10 Apr 2003 23:37:00 +0000
From: "Kathy Burke" <Kathy_Burke@xxxxxxxxx>

Thanks, Ken. I thought using "//para" matched ALL occurrences in the doc?

Yes, it should match all para elements from the root node of the current xml tree.



<xsl:template match="para"> <p><xsl:apply-templates/></p> </xsl:template>

Kathy,


It might be more beneficial if you provided an example XML and the full XSL. From your small snippet, there doesn't appear to be anything that 'jumps out'. In other words, what type of output do you see as compared to what you want?

The following works fine on MSXML4:
XML:
<para>This is a sample paragraph</para>

XSL:
<x:stylesheet version="1.0"
 xmlns:x="http://www.w3.org/1999/XSL/Transform";>
 <x:output method="html" indent="yes"/>
 <x:template match="/">
   <x:apply-templates select="//para"/>
 </x:template>
 <x:template match="para">
   <p><x:apply-templates/></p>
 </x:template>
</x:stylesheet>

Output:
<p>This is a sample paragraph</p>

bix






_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread