473,237 Members | 1,395 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,237 software developers and data experts.

XslTransform - Receiving 'System.Xml.Xsl.XsltException: Missing mandatory attribute 'version'

KJS
Hello,
I'm receiving:
'System.Xml.Xsl.XsltException: Missing mandatory attribute 'version'
After I try and run my transformation. I spent a good few days coming
up with the appropriate (I think) methods, and overrides for this task.
I have verified that the source XML and XSL will transform by means of
using the MSXML command line parsing tool (previous version of MSXML
though).

Here is my code:

public XmlDocument xslTransformer(XPathNavigator xNav, XsltArgumentList
xArgs)
{
//get xsl source
XslTransform xslObj = new XslTransform();

//default permission set
Evidence ev = XmlSecureResolver.CreateEvidenceForUrl
(classXSLObjectSource);
PermissionSet ps = SecurityManager.ResolvePolicy(ev);

//modify access for specific domain
// WebPermission myWebPermission = new
WebPermission(NetworkAccess.Connect,
// "http://www.example.com");
// myPermissions.SetPermission(myWebPermission);

//wrap with xmlsecureresolver
XmlUrlResolver urlR = new XmlUrlResolver();
XmlSecureResolver xmlSR = new XmlSecureResolver(urlR,ps);
xslObj.Load(xNav,xmlSR,ev);

StringWriter sWrit = new StringWriter();

//transform the xml
xslObj.Transform(xNav,xArgs,sWrit,xmlSR);
XmlDocument xmlREturn = new XmlDocument();
xmlREturn.Load(sWrit.ToString());

return(xmlREturn);
}

Any ideas?
Thanks,
Karl..
Nov 13 '05 #1
2 3685
KJS wrote:
public XmlDocument xslTransformer(XPathNavigator xNav, XsltArgumentList
xArgs)
{
//get xsl source
XslTransform xslObj = new XslTransform();

xslObj.Load(xNav,xmlSR,ev);

//transform the xml
xslObj.Transform(xNav,xArgs,sWrit,xmlSR);


This is weird. You are loading XSLT stylesheet from xNav and then
transform the same XSLT stylesheet? You seems to be havily MSXML minded,
in .NET many things are simpler. Just show me what do you need to
perform and I'll provide .NET solution.

--
Oleg Tkachenko [XML MVP, MCAD]
http://www.XmlLab.Net | http://www.XLinq.Net | http://blog.tkachenko.com
Nov 13 '05 #2
KJS
In article <e6**************@TK2MSFTNGP10.phx.gbl>, so**@body.com
says...
KJS wrote:
public XmlDocument xslTransformer(XPathNavigator xNav, XsltArgumentList
xArgs)
{
//get xsl source
XslTransform xslObj = new XslTransform();

xslObj.Load(xNav,xmlSR,ev);

//transform the xml
xslObj.Transform(xNav,xArgs,sWrit,xmlSR);


This is weird. You are loading XSLT stylesheet from xNav and then
transform the same XSLT stylesheet? You seems to be havily MSXML minded,
in .NET many things are simpler. Just show me what do you need to
perform and I'll provide .NET solution.


I am (was) heavily MSXML minded : )
I was looking for the *simplest* method for transforming XML in .NET (I
understand how to do this very well in the previous versions of MSXML
with classic ASP, VB, etc..)

In .NET I started with the objects: XslTransform, XmlDocument, and
XsltArgumentList.

My XML is supplied from a dataset after querying the database (MySql -
which has some interesting problems by the way, especially dates, but
another topic of course). So, I am providing the XML source from a
dataset (not from file I/O) The XSLT is located local to my application
and is read in accordingly.

I was sure I had everything lined up correctly for this *simple*
transformation, but found that my method calls were "obsolete" and I
should use the "resolver" (XmlUrlResolver) in the load of the stylesheet
and that I should pass "evidence" and WOW! This turned out to be a
nightmare, but I figured it out!!! (so I thought) Now I'm stuck with
this error:

'System.Xml.Xsl.XsltException: Missing mandatory attribute 'version'

Let me summarize the desired operation:
1. Query Database to XML (I use to Save right from recordset in classic
- which I like better, I like the XML better)
2. Transform XML to HTML or to XML
3. I will either stream the result to the Response object (for web) or I
might transform the XML and return XML for something later. For the
most part, will be streaming the result to the browser.

Thanks for the help!
Karl..
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Hyunchan Kim | last post by:
To indent xml file, I made an instance of Transformer from Templates using following. <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"...
1
by: Paul | last post by:
Hi trying to deploy to a web server and got the system.data missing. I found the dll on the local machine and copied it over to the bin directory on the server. It found it but then got the...
1
by: Mike | last post by:
I have 2 System.Web.dll taken from 2 different machines, one of the System.Web.Dll contains a enum System.Web.UI.WebControls.TableCaptionAlign and the other did not. I have development a...
2
by: Alan Silver | last post by:
Hello, I'm getting an odd validation error from VWD. As I understand it, an opening ASP.NET for tag is supposed to look like... <form runat="server"> with an optional ID attribute. VWD...
1
by: Sky | last post by:
Yesterday I was told that GetType(string) should not just be with a Type, but be Type, AssemblyName. Fair enough, get the reason. (Finally!). As long as it doesn't cause tech support problems...
5
by: Bosconian | last post by:
I'm attempting to submit a form via a function which dynamically creates a hidden input: function submitLocation(theForm) { var e = document.createElement('input'); e.setAttribute('type',...
8
by: Gamma | last post by:
I'm trying to inherit subclass from System.Diagnostics.Process, but whenever I cast a "Process" object to it's subclass, I encounter an exception "System.InvalidCastException" ("Specified cast is...
2
by: wellerc1 | last post by:
Looking for help to resolve error I am getting when I run vbs scripts. Scripts execute DLL components which use DB2 Connect to pull data. scripts does a name search creating an ADODB.Recordset...
3
by: Mike | last post by:
Hi I have problem as folow: Caught Exception: System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Request for the permission of type...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.