|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Name function in XSL
> Here is a bit of code
>
> <xsl:template match="//XmlNode">
> <xsl:for-each select="*">
> <xsl:element name="XMLNode">
> <xsl:attribute name="Text">
> <xsl:value-of select="." />
> </xsl:attribute>
> <xsl:value-of select="anyOtherValue" />
> </xsl:element>
> </xsl:for-each>
> <xsl:template>
Note you never need to start a match with // as it does not change the
elements matched, just the default priority.
Also using xsl:element and xsl:attribute makes it look a lot more
complicated than needed.
the above could be written
<xsl:template match="XmlNode">
<xsl:for-each select="*">
<XMLNode Text="{.}">
<xsl:value-of select="anyOtherValue" />
</XMLNode>
</xsl:for-each>
<xsl:template>
I don't see how it relates to teh original poter's question though,
which was about the name function.
Note also that you should not have elements named XmlNode in teh input
or XMLNode in the output as element names begining with x m l in any
case are reserved for use by W3C specifications according to the XML
spec.
David
________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








