By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,417 Members | 1,845 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,417 IT Pros & Developers. It's quick & easy.

Can someone tell me what's wrong with this..

P: n/a
Can anyone help me. I'm trying to display this test.xml
file using this fomat.xsl file using VB. I get an error
"Missing mandatory attribute 'version'. Description: An
unhandled exception occurred during the execution of the
current web request. Please review the stack trace for
more information about the error and where it originated
in the code.
Exception Details: System.Xml.Xsl.XsltException: Missing
mandatory attribute 'version'. "

----------------------------------------
Dim _XmlDocument As XmlDocument = New XmlDocument()
_XmlDocument.Load("test.xml")
Dim _xslTransform As XslTransform = New
XslTransform()
_xslTransform.Load("format.xsl")
_xslTransform.Transform(_XmlDocument, Nothing,
Response.Output)

--------------------------------------------
Thanks.

Joe K.
Nov 11 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
joe k. wrote:
Can anyone help me. I'm trying to display this test.xml
file using this fomat.xsl file using VB. I get an error
"Missing mandatory attribute 'version'. Description: An
unhandled exception occurred during the execution of the
current web request. Please review the stack trace for
more information about the error and where it originated
in the code.
Exception Details: System.Xml.Xsl.XsltException: Missing
mandatory attribute 'version'. "


Well, sounds like your format.xsl doesn't have version attribute on
xsl:stylesheet element.

--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #2

P: n/a
Thanks Oleg. I forgot that we are using an older version
of XSL. (I Think it's MSXML 2.0). I did make the
neccessary header changes but now I get whole bunch of
error message. Since there are so many xsl files and it's
would be too much of a work to fix them now, it there a
way to code in ASP.net to allow to still use the older
version of XSL. Thanks and here is a snippet of the asp
code we used:
var sourceFile = Server.MapPath("../xml/" +
xmlfile + ".xml")
var styleFile = Server.MapPath("../xml/" + xslfile
+ type + "data.xsl");

// Load the XML
var source = Server.CreateObject
("Microsoft.XMLDOM");
source.async = false;
source.load(sourceFile);

// Load the XSL
var style = Server.CreateObject
("Microsoft.XMLDOM");
style.async = false;
style.load(styleFile);

if (source.parseError.errorCode != 0)
result = reportParseError
(source.parseError);
else
{
if (style.parseError.errorCode != 0)
result = reportParseError
(style.parseError);
else
{
try {
result =
source.transformNode(style);
}
catch (exception) {
result = reportRuntimeError
(exception);
}
}
}
-----Original Message-----
joe k. wrote:
Can anyone help me. I'm trying to display this test.xml file using this fomat.xsl file using VB. I get an error "Missing mandatory attribute 'version'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for
more information about the error and where it originated in the code.
Exception Details: System.Xml.Xsl.XsltException: Missing mandatory attribute 'version'. "
Well, sounds like your format.xsl doesn't have version

attribute onxsl:stylesheet element.

--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

.

Nov 11 '05 #3

P: n/a
joe k. wrote:
Thanks Oleg. I forgot that we are using an older version
of XSL. (I Think it's MSXML 2.0). I did make the
neccessary header changes but now I get whole bunch of
error message. Since there are so many xsl files and it's
would be too much of a work to fix them now, it there a
way to code in ASP.net to allow to still use the older
version of XSL.


..NET doesn't support obsolete WD-XSL transformation laguage you are
talking about. So the only way is to use MSXML2 as COM through .NET
interop facilities.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.