S
Sam
Hi there,
For some very bizzare reason I can't get ASP.NET to read an XSLT
stylesheet properly. I always get a the message below. Any ideas as
to how to get around this problem?
Thanks in advance!
-Sam
Error Message:
System.Xml.Xsl.XsltCompileException:
file:///c:/inetpub/wwwroot/rbcworklist/test.xslt(0,0) :
---> System.Xml.Xsl.XsltException: The wrong namespace was used for
XSL. Use 'http://www.w3.org/1999/XSL/Transform'.
at System.Xml.Xsl.ContainerAction.CompileSingleTemplate(Compiler
compiler)
at System.Xml.Xsl.ContainerAction.CompileDocument(Compiler
compiler, Boolean inInclude)
at System.Xml.Xsl.RootAction.Compile(Compiler compiler)
at System.Xml.Xsl.Compiler.CreateRootAction()
at System.Xml.Xsl.Compiler.Compile(NavigatorInput input,
XmlResolver xmlResolver, Evidence evidence)
--- End of inner exception stack trace ---
at System.Xml.Xsl.Compiler.Compile(NavigatorInput input,
XmlResolver xmlResolver, Evidence evidence)
at System.Xml.Xsl.XslTransform.Compile(XPathNavigator stylesheet,
XmlResolver resolver, Evidence evidence)
at System.Xml.Xsl.XslTransform.Load(XPathNavigator stylesheet,
XmlResolver resolver, Evidence evidence)
at System.Xml.Xsl.XslTransform.Load(IXPathNavigable stylesheet,
XmlResolver resolver, Evidence evidence)
at RBCworklist.WebForm1.BindData() in
C:\Inetpub\wwwroot\RBCworklist\default.aspx.vb:line 88
Source code:
Dim myDataSet As New DataSet
Dim oXML As New XmlDocument
Dim myXform As New XslTransform
Dim myWriter As StringWriter
Dim style As New XmlDocument
style.Load(Server.MapPath("test.xslt"))
Response.Write("namespace is" & style.NamespaceURI())
Try
'myXform.Load(Server.MapPath("NormalizeWorklist.xsl"))
myXform.Load(style, Nothing, Nothing)
oXML.Load(Server.MapPath("chargewl_sm.xml"))
myXform.Transform(oXML, Nothing, myWriter)
Textbox2.Text = myWriter.ToString
Catch ex As Exception
Textbox2.Text = ex.ToString
End Try
Stylesheet:
<?xml version="1.0" encoding="UTF-8" ?>
<stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
hello
</xsl:template>
</stylesheet>
For some very bizzare reason I can't get ASP.NET to read an XSLT
stylesheet properly. I always get a the message below. Any ideas as
to how to get around this problem?
Thanks in advance!
-Sam
Error Message:
System.Xml.Xsl.XsltCompileException:
file:///c:/inetpub/wwwroot/rbcworklist/test.xslt(0,0) :
---> System.Xml.Xsl.XsltException: The wrong namespace was used for
XSL. Use 'http://www.w3.org/1999/XSL/Transform'.
at System.Xml.Xsl.ContainerAction.CompileSingleTemplate(Compiler
compiler)
at System.Xml.Xsl.ContainerAction.CompileDocument(Compiler
compiler, Boolean inInclude)
at System.Xml.Xsl.RootAction.Compile(Compiler compiler)
at System.Xml.Xsl.Compiler.CreateRootAction()
at System.Xml.Xsl.Compiler.Compile(NavigatorInput input,
XmlResolver xmlResolver, Evidence evidence)
--- End of inner exception stack trace ---
at System.Xml.Xsl.Compiler.Compile(NavigatorInput input,
XmlResolver xmlResolver, Evidence evidence)
at System.Xml.Xsl.XslTransform.Compile(XPathNavigator stylesheet,
XmlResolver resolver, Evidence evidence)
at System.Xml.Xsl.XslTransform.Load(XPathNavigator stylesheet,
XmlResolver resolver, Evidence evidence)
at System.Xml.Xsl.XslTransform.Load(IXPathNavigable stylesheet,
XmlResolver resolver, Evidence evidence)
at RBCworklist.WebForm1.BindData() in
C:\Inetpub\wwwroot\RBCworklist\default.aspx.vb:line 88
Source code:
Dim myDataSet As New DataSet
Dim oXML As New XmlDocument
Dim myXform As New XslTransform
Dim myWriter As StringWriter
Dim style As New XmlDocument
style.Load(Server.MapPath("test.xslt"))
Response.Write("namespace is" & style.NamespaceURI())
Try
'myXform.Load(Server.MapPath("NormalizeWorklist.xsl"))
myXform.Load(style, Nothing, Nothing)
oXML.Load(Server.MapPath("chargewl_sm.xml"))
myXform.Transform(oXML, Nothing, myWriter)
Textbox2.Text = myWriter.ToString
Catch ex As Exception
Textbox2.Text = ex.ToString
End Try
Stylesheet:
<?xml version="1.0" encoding="UTF-8" ?>
<stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
hello
</xsl:template>
</stylesheet>