471,337 Members | 1,193 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 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 1543
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by andrewcw | last post: by
1 post views Thread by Mark | last post: by

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.