Transforming Xslt File prior to transformation.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In ASP 3.0 and MSXMLHTTP2 we would load Our Xslt file as an XmlDocument. We
then merely had to set the language and we could then execute Expath queries
against the document. This is especially useful for performing actions upon
Xslt Nodes that cannot be done through variables. After modifying the
Document via DOM one could then Transform it agianst the Xml and get the
expected results.

I am looking for a way to have this same functionality in C#/ASP.NET. I know
how to use the XsltTransform Below is sample asp 3.0 code - the
functionality that i am attempting to duplicate in C# is the
set firstNameNode = xslDoc.selectNodes("//*[name()='xsl:sort']")
Where i grab all the sort nodes as XmlNodes that are modifyable



Below is the ASP 3.0 code
I am having difficulty seeing exactly how this can be achieved with
' Create XML and XSLT Document
Set xmlDoc = Server.Createobject("MSXML2.DOMDocument.4.0")
Set xslDoc = Server.Createobject("MSXML2.DOMDocument.4.0")
' Load up XML Data
xmlFile = Server.MapPath("TheData.xml")
xmlDoc.async = false
xmlDoc.load(xmlFile)
' Load up XSLT Value
xslFile = Server.MapPath("OurXsltFile.xsl")
xslDoc.async = false
xslDoc.load(xslFile)
' xslDoc.setProperty
"SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'" '
force it to use hack
xslDoc.setProperty "SelectionLanguage","XPath"

set firstNameNode = xslDoc.selectNodes("//*[name()='xsl:sort']")
' Code to modify the nodeList setting attributes we need
 
I think i have it sorted


Subject should actually read
Modifying Xslt Nodes priot to Transformation



In ASP 3.0 and MSXMLHTTP2 we would load Our Xslt file as an XmlDocument.
We then merely had to set the language and we could then execute Expath
queries against the document. This is especially useful for performing
actions upon Xslt Nodes that cannot be done through variables. After
modifying the Document via DOM one could then Transform it agianst the
Xml and get the expected results.

I am looking for a way to have this same functionality in C#/ASP.NET. I
know how to use the XsltTransform Below is sample asp 3.0 code - the
functionality that i am attempting to duplicate in C# is the
set firstNameNode = xslDoc.selectNodes("//*[name()='xsl:sort']")
Where i grab all the sort nodes as XmlNodes that are modifyable



Below is the ASP 3.0 code
I am having difficulty seeing exactly how this can be achieved with
' Create XML and XSLT Document
Set xmlDoc = Server.Createobject("MSXML2.DOMDocument.4.0")
Set xslDoc = Server.Createobject("MSXML2.DOMDocument.4.0")
' Load up XML Data
xmlFile = Server.MapPath("TheData.xml")
xmlDoc.async = false
xmlDoc.load(xmlFile)
' Load up XSLT Value
xslFile = Server.MapPath("OurXsltFile.xsl")
xslDoc.async = false
xslDoc.load(xslFile)
' xslDoc.setProperty
"SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'"
' force it to use hack
xslDoc.setProperty "SelectionLanguage","XPath"

set firstNameNode = xslDoc.selectNodes("//*[name()='xsl:sort']")
' Code to modify the nodeList setting attributes we need
 
Back
Top