XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> + Use of before and after string (3) Sticky Topic
-> - How do I substitute element ty... (1)
-> + How does one add working days ... (4)
-> - Help, I have existing XLT and... (1)
-> + Need help on XSLT issue - (2)
-> + EDI to XML Conversion (7)
-> - XML To JSON Conversion using X... (1)
-> + Formatting Paragraphs to same ... (2)
-> - Grouping of records (1)
-> + Problems with xsd 1.1 (4)
-> + XML to HL7 mapping (3)
-> + XSLT 3 and Iterate (2)
-> + XSL-FO to PDF preview (3)
-> + java.lang.RuntimeException: Er... (2)
-> + Create Acroforms with Stylus X... (2)
-> + How to change XSLT parameter s... (3)
-> + how to change format of the da... (2)
-> + Search "Next 8 Results " doesn... (2)
-> - Support for Git (1)
-> + newbee (8)
-- [1-20] [21-40] [41-60] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
Shailendra GodboleSubject: XML / XSL DOM Problem
Author: Shailendra Godbole
Date: 28 Dec 2005 03:50 PM
I have an XML file which is having escape charecters like & The Tag data is company name for eg. Hinderson & Co. when what it actually means is Hinderson & Co.

I have an XSL that processes this XML file. If I am viewing the data in explorer (IE 5-6) it shows me correctly. However if I load the XMl file and XSL file in 2 DOM objects and then use the transformNode method of DOM it gives me data with same & and more over it also adds and line break in between the data which when transformed results into 2 rows.

I tried things like
1. PrserveWhiteSpace=False
2. Some Escape="yes" header for XSL but invain

Can you help

Thanks
SG

Postnext
Minollo I.Subject: XML / XSL DOM Problem
Author: Minollo I.
Date: 28 Dec 2005 04:19 PM
Two different questions.

If you don't want to escape output, you'll neet to let the XSLT processor know:
<xsl:value-of select="something" disable-output-escaping="yes"/>

About whitespaces/newlines in the XSLT output to the result: XSLT processors will ignore any ignorable whitespace.
So, something like...
<xsl:value-of .../>

<xsl:value-of .../>
...will not output any newline, because the whitespace between the two instructions can be ignored. On the other hand, if you do:
<xsl:value-of .../>,

<xsl:value-of .../>
...will output a comma followed by two newlines, because the whitespaces cannot be ignored. If you don't want to do...
<xsl:value-of .../>,<xsl:value-of .../>
...you could do...
<xsl:value-of .../>
<xsl:text>,<xsl:text/>
<xsl:value-of .../>

In neither case you'll have a newline output to the result.

As a suggestion for the future, a good place for general XSLT-specific questions is the xsl-list at http://www.mulberrytech.com/xsl/xsl-list/index.html

Hope this helps,
Minollo

Postnext
Shailendra GodboleSubject: XML / XSL DOM Problem
Author: Shailendra Godbole
Date: 28 Dec 2005 04:51 PM
Nope it still have same problem.
Let me give an example

<!-- The base XML -->

<LEVEL1>
<LEVEL2>
<LEVEL3>
<CName>Hinderson (5013)
&amp; Co. #1 abcd</CName>
</LEVEL3>
<LEVEL3>
.....
</LEVEL2>
</LEVEL1>

My XSL is
<xsl:strip-space elements="*"/>
<xsl:template match="/">
CNAME<BR/>
<xsl:for-each select="/LEVEL1/LEVEL2/LEVEL3">
<xsl:value-of select="CName" disable-output-escaping="yes"/><BR/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

Posttop
Minollo I.Subject: XML / XSL DOM Problem
Author: Minollo I.
Date: 28 Dec 2005 05:16 PM
If I run it in Stylus Studio (using any processor) I see the "&" returned unescaped; in your case you might be seeing it escaped as a side effect of the way you are retrieving the result?

Minollo

   
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.