468,765 Members | 1,004 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,765 developers. It's quick & easy.

Help! The wrong namespace was used for XSL.

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.CompileSingleTempla te(Compiler
compiler)
at System.Xml.Xsl.ContainerAction.CompileDocument(Com piler
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:lin e 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.xs l"))
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>
Nov 17 '05 #1
0 1004

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Tom | last post: by
4 posts views Thread by Sarir Khamsi | last post: by
2 posts views Thread by Sudheer Kareem | last post: by
6 posts views Thread by d.warnermurray | last post: by
5 posts views Thread by Craig Keightley | last post: by
3 posts views Thread by Colin J. Williams | last post: by
7 posts views Thread by Corepaul | last post: by
8 posts views Thread by Mark | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.