| Subject: Re: [xsl] How to convert a whold result tree to a string? From: Joerg Heinicke <joerg.heinicke@xxxxxx> Date: Mon, 02 Dec 2002 22:00:59 +0100 | 
<xsl:template match="*">
  <xsl:text/><<xsl:value-of select="name()">
    <xsl:apply-templates select="@*"/>
    <xsl:text>></xsl:text>
    <xsl:apply-templates select="node()"/>
  </<xsl:value-of select="name()">>
</xsl:template><xsl:template match="@*"> <xsl:text> </xsl:text> <xsl:value-of select="name()"/> <xsl:text>="</xsl:text> <xsl:value-of select="."/> <xsl:text>"</xsl:text> </xsl:template>
Suppose I have a result tree like <test> <test1> kkkk</tes1> <test2 attr="kkkk"/> </test>
Can I store it in a string variable like <xsl:template match="test>
<xsl:variable name="str" select="string(.)"/>
</xsl:template>
So whenever I use <xsl:value-of select="$str"/>, it will output
the whole result tree as string.
Obvioulsy, the code doesn't work because string function only converts the first element.
any ideas?
thanks, Fengrui
| Current Thread | 
|---|
| 
 | 
| <- Previous | Index | Next -> | 
|---|---|---|
| [xsl] How to convert a whold result, Fengrui Gu | Thread | Re: [xsl] How to convert a whold re, Gunther Schadow | 
| [xsl] How to convert a whold result, Fengrui Gu | Date | Re: [xsl] How to convert a whold re, Gunther Schadow | 
| Month |