473,805 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.gi f",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.gi f",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.Creden tials = System.Net.Cred entialCache.Def aultCredentials ;

// Load the .xsl file
transformer.Loa d(transformatio nFilePath, resolver);

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

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

XmlTextWriter xmlWriter = new XmlTextWriter(w riter);

// Perform the transformation and write out the results
transformer.Tra nsform(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 1506
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.Tr ansform() 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.Creden tials = System.Net.Cred entialCache.Def aultCredentials ;

// Load the .xsl file
transformer.Loa d(transformatio nFilePath, resolver);

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

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

// Then I edited this line to use the straight StreamWriter object instead
transformer.Tra nsform(document , parameters, writer, resolver); // Perform the transformation and write out the results // transformer.Tra nsform(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
3910
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 "crumb-trail" of links. I'm transforming the XML with XSLT through Saxon. The nav menu and "crumb-trail" show the user where they are within the site and is made by reflecting the XML tree structure. My problem now is that when I want to generate...
2
2795
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 wondering if I am better of learning XQuery instead? Any thought and opinions would be appreciated. Cheers - Tom. The Architect: "Hope, it is the quintessential human delusion,
1
3606
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 version 2 of XSLT processor based on some condition. Q) How and where shall I write logic or import desirable XSLT on the Fly ? Q) When we call AAA.XSLT then it will be processed by XSLT Processor 1
4
2125
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 provider who says we need to use XSLT and Web Services to pull the content from their site. Can someone give me a nutshell definition on how this works??? We use Cold Fusion MX on our web server, but I'm having trouble finding a
3
2264
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 web pages formatted as a matrix. It is not a simple matrix, since the number of row heading cells can vary, but the data cells must be aligned by date (so the heading cells will not be uniformly sized). example of typical rows: 3 heading...
1
1316
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 transformations if a stylesheet is specified in the XML file, e.g., within the data file: <?xml version="1.0"?> <?xml-stylesheet type='text/xsl' href='test.xsl'?> ....
3
3096
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> <OPTION>3<OPTION> </FIELD>
1
2421
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 stylesheets, that generates .NET assemblies) 2. Performance improvements in the XslCompiledTransform
12
11605
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 don't want to have to use some external program or script to parse the csv first if possible
2
2241
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 compiled/configured to support XSLT." AFAIK, PHP has an XSL extention, not XSLT. I cannot find any info about an XSLT extention. I am running WAMPServer 2.0 on W2k (PHP 5.2.). Since I don't have the source to rebuild PHP (I'd rather not rebuild it
0
9596
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
10607
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10359
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...
0
10104
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...
1
7645
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
5541
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5677
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4317
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
2
3843
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.