Subject: Re: [xsl] Converting individual words in a string to nodes From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx> Date: Thu, 26 Apr 2007 13:23:11 +0100 |
I am using XSLT 2.0 to transform a WordML document and have run into a spot of trouble.
I have a / delimited string and need to create a node for each word in the string.
WordML snippet: <w:p> <w:r> <w:t>UK/England/Yorkshire/Hull</w:t> </w:r> </w:p>
needs to be output as:
<NodeSet> <PlaceNode>UK</PlaceNode> <PlaceNode>England</PlaceNode> <PlaceNode>Yorkshire</PlaceNode> <PlaceNode>Hull</PlaceNode> </NodeSet>
The number of words in the string is unlimited.
I can tokenize the string and count the number of words in the string, but I can't create a node for each word and it is really frustrating.
<xsl:for-each select="tokenize(w:t, '/')"> <PlaceNode><xsl:value-of select="."/></PlaceNode> ...
cheers andrew
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Converting individual words i, Andy Carr1 | Thread | RE: [xsl] Converting individual wor, Michael Kay |
Re: [xsl] Invoking XSLT 2.0, Abel Braaksma | Date | RE: [xsl] Converting individual wor, Michael Kay |
Month |