ASP Error: 70
Description: Permission denied
Source: Microsoft VBScript runtime error
|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Accessing a node dynamically using XSL
Sumiit Kumar Mukherjee wrote:
> <Name type="String">harry</Name>
> <Subjects type="String">Literature,Fiction</Subjects>
> <Literature type="String">Shakespeare, Woodsworth, Jeffrey
> Archer</Literature>
> <Fiction type="String">Da Vinci Code</Fiction>
> My requirement is like this: First, find out the values in the
> <Subjects> element. For each such value [separated by a comma],
> there will be an element present in the XML
~> cat skm.xml
<root>
<Name type="String">harry</Name>
<Subjects type="String">Literature,Fiction</Subjects>
<Literature type="String">Shakespeare, Woodsworth</Literature>
<Fiction type="String">Da Vinci Code</Fiction>
</root>
~> cat skm.xsl
<xsl:transform
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
<xsl:output method="text"/>
<xsl:template match="root">
<xsl:apply-templates
select="for $sub in tokenize(Subjects, ', *')
return *[local-name()=$sub]"/>
</xsl:template>
<xsl:template match="*">
<xsl:value-of select="local-name()"/>
<xsl:text>: </xsl:text>
<xsl:value-of select="."/>
<xsl:text> </xsl:text>
</xsl:template>
</xsl:transform>
~> saxon skm.xml skm.xsl
Literature: Shakespeare, Woodsworth
Fiction: Da Vinci Code
With XSLT 1.0, use a recursive template instead of an XPath 'for'
expression.
--drkm
___________________________________________________________________________
Nouveau : tiliphonez moins cher avec Yahoo! Messenger ! Dicouvez les tarifs exceptionnels pour appeler la France et l'international.
Tilichargez sur http://fr.messenger.yahoo.com
|
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








