473,216 Members | 1,868 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,216 software developers and data experts.

XslCompiledTransform error

Hi,

I am having a problem doing the transform.
Actually i am migrating the code from XslTranform class into
XslCompiledTransform class.

Here is the code that i am using in .net 1.1

private void DoTransform(ref XslTransform[] arrTransformations,
ref XmlDocument objSource,
ref XmlDocument objTarget,
XsltArgumentList xsltArgs,
XmlResolver xmlResolver)
{
try
{
msXML = new MemoryStream();
objSource.Save(msXML);

msXML.Seek(0,SeekOrigin.Begin);
objTarget = new XmlDocument();
objTarget.Load(msXML);

for(intCount = 0;intCount < arrTransformations.Length;intCount++)
{
msXML = new MemoryStream();
arrTransformations[intCount].Transform(objTarget,xsltArgs,msXML,xmlResolver);

msXML.Seek(0,SeekOrigin.Begin);
objTarget = new XmlDocument();
objTarget.Load(msXML);
}
}
catch
{
throw;
}
finally
{
msXML = null;
}
}

Migrated the above code into .net 2.0:
private void DoTransform(ref XslCompiledTransform[] arrTransformations,
ref XmlDocument objSource,
ref XmlDocument objTarget,
XsltArgumentList xsltArgs,
XmlResolver xmlResolver)
{
try
{
msXML = new MemoryStream();
objSource.Save(msXML);

msXML.Seek(0, SeekOrigin.Begin);
objTarget = new XmlDocument();
objTarget.Load(msXML);

for (intCount = 0; intCount < arrTransformations.Length;
intCount++)
{
msXML = new MemoryStream();
XmlReaderSettings settings = new XmlReaderSettings();
settings.ProhibitDtd = false;
XmlReader reader = XmlReader.Create(new
StringReader(objSource.InnerXml), settings);
arrTransform[intCount].Transform(reader, xsltArgs,
msXML);/// got error here

msXML.Seek(0, SeekOrigin.Begin);
objTarget = new XmlDocument();
objTarget.Load(msXML);
}
}
catch
{
throw;
}
finally
{
msXML = null;
}
}

Error :An error occurred while loading document 'C:\test.xml'. See
InnerException for a complete description of the error.

i get the same error even when i tried this
arrTransform[intCount].Transform(new XmlNodeReader ( xmlDoc), xsltArgs,
msXML );

please help me out on this.

Regards,
Vinod
Aug 8 '08 #1
1 1608
Vinod wrote:
Error :An error occurred while loading document 'C:\test.xml'. See
InnerException for a complete description of the error.
It says to check the InnerException. Have you checked the InnerException?

--
J.
Aug 9 '08 #2

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

Similar topics

1
by: Steve | last post by:
Using VB.NET 2.0 I have a simple routine that attempts transforms an XmlDocument with an XSLT stylesheet into HTML. Under the old 1.1 framework with XslTransform, everything worked fine. Now...
4
by: andrewcw | last post by:
I am moving some code forward from .NET 1.1. I was able to load the XSL file and perform the transform. The MSDN documentation looks like it should be easy. But I get a compile error. Ideas ?...
12
by: InvalidLastName | last post by:
We have been used XslTransform. .NET 1.1, for transform XML document, Dataset with xsl to HTML. Some of these html contents contain javascript and links. For example: // javascript if (a &gt; b)...
1
by: Mark | last post by:
I'm getting the error "The URI scheme is too long." in the code below. What is URI in this context? The XSL or the XML being transformed? Thanks! -Mark StringBuilder sb = new...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
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...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
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"....

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.