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

XML XSLT Transform issue please help

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
Mar 1 '06 #1
3 2220


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.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Mar 1 '06 #2
Thanks!

"Martin Honnen" wrote:


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.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Mar 1 '06 #3


BrianDH wrote:
Thanks!

Does that mean that the suggestion below works for you?

"Martin Honnen" wrote:

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.


--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Mar 1 '06 #4

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

Similar topics

5
by: dennis | last post by:
Hi, First of all, hi to you all. I'm working on a Delphi project wich is becoming near it's deadline. I have a very simple XSLT question wich i hope one of you folks can help me with? The...
4
by: Moogy | last post by:
I'm pulling my hair out here. First, I'm new to XML, so that doesn't help, but none of this makes any sense to me. All I'm trying to do is take a simple source XML file and translate it with an...
4
by: Gauthier | last post by:
Hi, I've a simple issue with the use of extension objects. I'm trying to call a text formating method from an object that I add to my arguments collection, this method take an input string and...
2
by: chris | last post by:
Hi there, I create an XML file from a dataset like this: System.IO.StreamWriter xmlSW = new System.IO.StreamWriter(FILENAME); dsUserData1.WriteXml(xmlSW, XmlWriteMode.WriteSchema);...
7
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID...
1
by: cameron | last post by:
I am attempting to pass in an XmlDocument as a parameter to a transform: from my sample ASPX page: string BaseDir = "/cameron/Play/ComplexParam/"; XmlDocument XSL = new XmlDocument();...
0
by: Trent USTA | last post by:
I'm having a problem with line feeds in an xslcompiledtransform in .net 2.0. I'm trying to use xsl to transform xml to a text file that can be read on a Unix box. The problem is that when I insert...
1
by: adi | last post by:
hello all, seems like a simple issue, but having tried several approaches with no success I am posting this question, I have a XML in one format, I want to now convert into another XML format...
8
by: Hercules Dev. | last post by:
Hi all, I'm new in xslt and xpath, so my question might be simple but i'm learning. I have an XML document and need to transform it into another XML, I use xslt and it works, but there is a...
4
by: saritha2008 | last post by:
Hi, Iam working on converting one of xml file to other form of xml using XSLT. As part of this, I need to count the no. of "component" nodes in the xml file given below. If there is only one...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
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
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,...
0
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
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.