Subject: Re: [xsl] How to convert a whold result tree to a string? From: Gunther Schadow <gunther@xxxxxxxxxxxxxxxxxxxxxx> Date: Mon, 02 Dec 2002 16:14:53 -0500 |
But why would you want to do that? Unless you're doing funky stuff, you're always better off with having the XML as a real node set.
If you want to turn XML into text for direct rendering, consider writing a transform that does that. For example, I needed to place sample XML 'code' into a text document verbatim. So, what I did is to write a bunch of templates in mode="verbatim" that would do this type of serialization. Is that obsolete with Saxon's serialize() function? No, not at all! Because with my templates, I can put special handlin for special forms to do the type of syntax markup (coloring) that we are all used to from looking at raw XML in Explorer or Spy.
regards -Gunther
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
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
-- Gunther Schadow, M.D., Ph.D. gschadow@xxxxxxxxxxxxxxx Medical Information Scientist Regenstrief Institute for Health Care Adjunct Assistant Professor Indiana University School of Medicine tel:1(317)630-7960 http://aurora.regenstrief.org
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] How to convert a whold re, Joerg Heinicke | Thread | Re: [xsl] Fwd: white space in MSIE, Wendell Piez |
Re: [xsl] How to convert a whold re, Joerg Heinicke | Date | Re: [xsl] Doing HTTP/POST from XSLT, Daniel Veillard |
Month |