<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="blah">Content 1</xsl:param>
<xsl:param name="blah2">Content 2</xsl:param>
</xsl:stylesheet>
If I have the above XSLT file, what is the “correct” way to not just get the data, but also edit it and save it back to the file without doing a transform etc.
XmlDocument xslDoc = new XmlDocument();
xslDoc.Load(@"C:\params.xslt");
XmlNamespaceManager nsMgr = new XmlNamespaceManager(xslDoc.NameTable);
nsMgr.AddNamespace("xsl", "http://www.w3.org/1999/XSL/Transform");
XmlNode PARAM_blah = xslDoc.SelectSingleNode(@"/xsl:stylesheet/xsl:param[@name='blah']", nsMgr);
string blah = PARAM_blah.InnerText;
This returns the value of the param in question easily, but if I wanted to then edit this and save this change to the file ,how would I go about this?
Simply do this: