Please Help me out.
In C# i set a context value as
HttpContext.Current.Items["xmlcontentholder"] = xDoc.DocumentElement.FirstChild.OuterXml;
and
by processing XsltArgumentList i send it to an XSLT file:
XsltArgumentList XsltArgs = new XsltArgumentList();
XsltArgs.AddParam("xmlcontentholder", "", "xmlcontent");
and i m transforming it
xsltCompiledTrans.Transform(xPathNav, XsltArgs, stringWriter);
In XSLT file i gave as <xsl:value-of select="$xmlcontentholder" /><br/>12<xsl:value-of select="msxsl:node-set($xmlcontentholder)/ROW[1]/value" />34
My output is
<ROW><value>1</value><value>2</value></ROW>
1234
Please explain me on this problem..
The problem: The
OuterXmlproperty is of typestring, but in the XSLT transformation you are treating it as a node.Solution: Pass to the transformation a node — the C# parameter needs to be either an
XPathNavigator(for a single node) orXPathNodeIteratorfor a node-set.Therefore, use: