Help! The wrong namespace was used for XSL.

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,838
Latest member
KandiceChi

Latest Threads

Top