XML XSLT Transform issue please help

G

Guest

Hi
I am having a problem doing the tranform.
Unlike all the examples I have found, I do not load my XML document via a
path but from a datacall.

I get erros when I try to do the transform (white space cannot be striped)

XmlDocument DealXmlDocument = new XmlDocument();
DealXmlDocument.LoadXml(DataCalls);

XPathNavigator nav = DealXmlDocument.CreateNavigator();
XslCompiledTransform XSLTDocument = new XslCompiledTransform();
XSLTDocument.Load(xsl);

// Transform the file.
System.IO.StringWriter writer = new System.IO.StringWriter();
XSLTDocument.Transform(nav, null, writer); // here is where i get the error


Thanks for any help.
BrianDH
 
M

Martin Honnen

BrianDH wrote:

I am having a problem doing the tranform.
Unlike all the examples I have found, I do not load my XML document via a
path but from a datacall.

I get erros when I try to do the transform (white space cannot be striped)

XmlDocument DealXmlDocument = new XmlDocument();
DealXmlDocument.LoadXml(DataCalls);

What type is DataCalls? What does it contain? Is that a string with the
input XML markup?
Does that error occur with any input XML markup or just one particular?
Can you post how the XML looks?
XPathNavigator nav = DealXmlDocument.CreateNavigator();
XslCompiledTransform XSLTDocument = new XslCompiledTransform();
XSLTDocument.Load(xsl);

// Transform the file.
System.IO.StringWriter writer = new System.IO.StringWriter();
XSLTDocument.Transform(nav, null, writer); // here is where i get the error

Can you try whether the error goes away with
XSLTDocument.Transform(XmlReader.Create(new StringReader(DataCalls)),
null, writer)
There is usually no need to use an XmlDocument if you simply want to do
a transformation.
 
G

Guest

Thanks!

Martin Honnen said:
BrianDH wrote:



What type is DataCalls? What does it contain? Is that a string with the
input XML markup?
Does that error occur with any input XML markup or just one particular?
Can you post how the XML looks?


Can you try whether the error goes away with
XSLTDocument.Transform(XmlReader.Create(new StringReader(DataCalls)),
null, writer)
There is usually no need to use an XmlDocument if you simply want to do
a transformation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top