473,757 Members | 10,708 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(DataCa lls);

XPathNavigator nav = DealXmlDocument .CreateNavigato r();
XslCompiledTran sform XSLTDocument = new XslCompiledTran sform();
XSLTDocument.Lo ad(xsl);

// Transform the file.
System.IO.Strin gWriter writer = new System.IO.Strin gWriter();
XSLTDocument.Tr ansform(nav, null, writer); // here is where i get the error
Thanks for any help.
BrianDH
Mar 1 '06 #1
3 2254


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(DataCa lls);
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 .CreateNavigato r();
XslCompiledTran sform XSLTDocument = new XslCompiledTran sform();
XSLTDocument.Lo ad(xsl);

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


Can you try whether the error goes away with
XSLTDocument.Tr ansform(XmlRead er.Create(new StringReader(Da taCalls)),
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(DataCa lls);


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 .CreateNavigato r();
XslCompiledTran sform XSLTDocument = new XslCompiledTran sform();
XSLTDocument.Lo ad(xsl);

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


Can you try whether the error goes away with
XSLTDocument.Tr ansform(XmlRead er.Create(new StringReader(Da taCalls)),
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.Tr ansform(XmlRead er.Create(new StringReader(Da taCalls)),
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
1466
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 problem is i need to transform a xml file from this: <root>
4
2170
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 XSLT to produce HTML code. The problem I have is that no matter what translation it runs through, it ALWAYS includes data that I don't match in the XSLT!! All I want to do is extract specific fields from the XML. Here's the XML source....
4
1983
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 output the formatted string. So far everything process correctly (the method is called without any issue) but my problem is that the output is htmlencoded, it means that my method (wich work as intended in other contexts) is called but the...
2
5286
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); xmlSW.Close(); Which gives me this XML file: <NewDataSet>
7
2868
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 parameter to the XSLT stylesheet XsltArgumentList xsltArgList = new XsltArgumentList(); xsltArgList.AddParam("pmID", "", pmID); xmlItems.TransformArgumentList = xsltArgList;
1
2370
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(); XSL.Load(HttpContext.Current.Server.MapPath(BaseDir + "xsl.xsl")); XmlDocument Data = new XmlDocument();
0
1355
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 a line feed, it always results in a carriage-return/linefeed - the Unix box does not like this. I've tried different encoding settings and using hex/dec/html values for line feed but the result is always CRLF as viewed in a hex editor. here's...
1
1507
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 using XSLT. FirstType.XML: (In this XML the States sub elements appear within USA element) ------------------------------------------------
8
15902
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 case that i don't know how to solve, I need to concat a string from multiple childs into a standard way, the following is an example of the source and the target XML.
4
3918
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 "component" node,i have to assign the value of this node to "component" node in my output.xml file. If there are more than one "component" nodes in my input xml file, then i should take the first "component" alphabetically that does not start with a...
0
9489
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9298
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9906
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9885
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9737
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8737
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7286
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3829
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.