Passing xml to server-side

Feb 8, 2011 at 8:19 AM


I'm trying to save an xml file on server, passing an xml fragment from an xslt template to a server side function. Passing data to the function is trivial, but I can only pass a string - didn't find a way to pass XML to it. Is this possible?

I declare the fragment:

<xsl:variable name="xmlVar">
<fragment title="title">

and then pass the variable to a function:

<xsl:value-of select="mdo:savexml($xmlVar)"/>

Function declares its parameter as string - I get errors if I try for example XmlNode -, then uses XmlDocument to rebuild an xml doc and save it to disk.

But I only see textual content ("content"), all xml fragment is lost both in function and in xslt (if I print xmlVar I can only see "content", all the rest is missing).

Did you ever try something similar?

Feb 8, 2011 at 8:23 AM

Ah got it: have to use XPathNavigator!