Subject: [xsl] Problem turning a xml string into a proper tree From: susana gonzalez <susana.gonzalez@xxxxxxxxxxx> Date: Wed, 04 Feb 2004 13:47:46 +0100 |
I have tried :
<xsl:variable name="v" select="xalan:nodeset('<entity>hallo</entity>')"/>
<xsl:value-of select="$v"/>
this returns <entity>hallo </entity>
I can't see how this relates to what you said you were doing earlier..
I'm not sure what xalan:nodeset does when given a string argument; I expect it creates a tree and makes the string a text node within that tree, and this is consistent with your output. What it won't do, almost certainly, is to parse the string on the assumption that it contains XML.
It would really help if you told us what problem you were trying to solve, rather than showing us non-working code that represents your attempt to solve it.
Michael Kay
Michael Kay wrote:
surprised ifTo do that in XSLT 1.0 you need the node-set() extension:I have a template that receives a parameter that way: <xsl:with-param name="paramString"> <params> <param att="att1" name="name11">value1</param> <param att="att2" name="name12">value2</param>
......... </params> </xsl:with-param>
What I'd like to is to retrieve the value of <xsl:value-of
select="$paramString/param[n]/@name" />
select="xx:node-set($paramString)/param[n]/@name"
What it more if i make <xsl:value-of select="$paramString"/><xsl:value-of select="$paramString"/>
it should return value1value2 but it returns <params>
<param att="att1" name="name11">value1</param>
<param att="att2" name="name12">value2</param>
......... </params> this means xalan treats it as a string instead of a tree as I'd like to.
should indeed return the string "value1value2". I'm very
it returns a string containing angle brackets. You need to show us a complete stylesheet that demonstrates the problem.
Michael Kay
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Problem turning a xml str, Michael Kay | Thread | AW: [xsl] XSLT vs Perl, Ronald Kent Gibson |
RE: [xsl] Value at position(), SHEIKH Sajjad | Date | Re: [xsl] Debugging XSLT, David Carlisle |
Month |