473,396 Members | 2,011 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,396 software developers and data experts.

XSLT problem with 'disable-output-espacing' parameter

Hey,

I'm doing a series of XSL Transformations from a C#.NET Console app.

I've designed a .xsl file (to output to "text" not "xml") to generate a text
file with entries that look like:

"<OD:FO:"yes.gif",Picture,"C:\images\yes.gif"> "

I designed the .xsl file in Marrowsofts Xselerator application and when I
run the stylesheet over the .xml file in this application I do infact get the
output entries I want (as shown above). However when I run the XSL
Transformations from my Console application my output becomes, the escaped
version:

"<OD:FO:"yes.gif",Picture,"C:\images\yes.gif"> "

I'm doing the transformation in the Console application using the following
code:

--Start Fragment--

XslTransform transformer = new XslTransform();

XmlUrlResolver resolver = new XmlUrlResolver();
resolver.Credentials = System.Net.CredentialCache.DefaultCredentials;

// Load the .xsl file
transformer.Load(transformationFilePath, resolver);

// Load the target of the transformation
XPathDocument document = new XPathDocument(inFilePath);

// Create a stream to the output file
StreamWriter writer = new StreamWriter(outFilePath);

XmlTextWriter xmlWriter = new XmlTextWriter(writer);

// Perform the transformation and write out the results
transformer.Transform(document, parameters, xmlWriter, resolver);

--End Fragment--

Does anyone have any suggestions as to why my output is coming out as
escaped sequences when I'm specifying that I don't want them to be escaped!

Thank you,

Sam.
Jul 21 '05 #1
1 1482
Shortly after posting this I discovered the reason why this was occuring,
although I am unsure as to whether this is documented anywhere.

The reason why this was occuring is because I was passing an XmlWriter
object to the XslTransform.Transform() function as the object to use to write
out the result of the transformation.

I have edited the code fragment below to illustrate the simple change that I
made.
--Start Fragment--

XslTransform transformer = new XslTransform();

XmlUrlResolver resolver = new XmlUrlResolver();
resolver.Credentials = System.Net.CredentialCache.DefaultCredentials;

// Load the .xsl file
transformer.Load(transformationFilePath, resolver);

// Load the target of the transformation
XPathDocument document = new XPathDocument(inFilePath);

// Create a stream to the output file
StreamWriter writer = new StreamWriter(outFilePath);
// I removed this line
// XmlTextWriter xmlWriter = new XmlTextWriter(writer);

// Then I edited this line to use the straight StreamWriter object instead
transformer.Transform(document, parameters, writer, resolver); // Perform the transformation and write out the results // transformer.Transform(document, parameters, xmlWriter, resolver);
--End Fragment--

Jul 21 '05 #2

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

Similar topics

2
by: ted | last post by:
Was wondering if XSLT alone is appropriate for the following situation. From XML, I'm creating a small website (around 50 pages) with pages that link to each other through a nav menu and a...
2
by: Tom Corcoran | last post by:
I am working to ease updating of a html page by transforming 2 xml files. I was going to use xslt for this and had bought 2 unopened books, wrox xslt and o'reilly's xslt cookbook. But am now...
1
by: Mohit | last post by:
Hi Friends I have to call 1 of the 2 child XSLT files from the Main XSLT file based on some criteria. I want one child XSLT file will be executed by version 1 of XSLT processor and the other by...
4
by: Ringo Langly | last post by:
Hi all, I'm a seasoned web programmer, but I've never touched XSLT. It's always been one of those acronyms I've never needed to educate myself on. Now... we're working with a web content...
3
by: Jack Fox | last post by:
I've never had the need to work with XML, but I believe I now have an appropriate application. I have time-series data in objects organized as a tree that I want an ASP.NET program to write out to...
1
by: jwalton | last post by:
Sorry if slightly off-topic, but I have asked / researched many other places already, maybe someone here can help? MSIE has a useful (for users applications) feature of performing XSLT...
3
by: Ian Roddis | last post by:
Hello, I want to embed SQL type queries within an XML data record. The XML looks something like this: <DISPLAYPAGE> <FIELD NAME="SERVER" TYPE="DROPDOWN"> <OPTION>1<OPTION> <OPTION>2<OPTION>...
1
by: Sergey Dubinets | last post by:
In effort to prioritize our goals we composed the list of random features each of them may add value to set of XSLT tools offered from Microsoft. 1. XSLTc (Compiler for XSLT...
12
by: Chris | last post by:
Hi, Just wondering if anyone out there knows if it is possible to convert a CSV to xml using XSLT? I've seen a lot of examples of xml to CSV, but is it possible to go back the other way? I...
2
by: Ronald Raygun | last post by:
I am running a build process (using propel) which requires XSLT for some transformations. I get the following error: "Could not perform XLST transformation. Make sure PHP has been...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
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
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,...

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.