473,503 Members | 1,655 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1627
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
2576
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
9565
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
10059
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
1661
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
7083
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6988
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7456
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5011
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3166
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3153
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.