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
Joe SimsSubject: tabs converted to spaces
Author: Joe Sims
Date: 20 Jul 2005 01:26 PM
Originally Posted: 20 Jul 2005 01:22 PM
The problem I seem to be having is that when I run my transformation is that my tabs inside of my attribute values (which are vital since this is for an InfoPath Document) are begin translated in to spaces. I have tried tinkering with the tab setting within the options but to no prevail. I believe this problem may be routed in the tokenizing. I think there may not be a token for a tab only for a space, and thus when the tool reads whitespace it assumes it to be a space and thus my tabs become spaces. Any idea on how to maintain this whitespace other ways? Thanks in advance.

Postnext
(Deleted User) Subject: tabs converted to spaces
Author: (Deleted User)
Date: 20 Jul 2005 03:39 PM
Hi Joe,
the problem is that XML mandates that the content of an attribute should be normalized to convert line feed, carriage return and tab characters into plain spaces (see http://www.w3.org/TR/2004/REC-xml-20040204/#AVNormalize). So, if you really have to place tabs inside attributes, you should escape them as character entities (	)

Hope this helps,
Alberto

Postnext
Joe SimsSubject: tabs converted to spaces
Author: Joe Sims
Date: 20 Jul 2005 04:13 PM
Thank you replying to quickly but I just dont understand what you mean for me to do with the (	)? I need the tabs to be preserved in the element below (the value attribute) is it possible for you to show me what you mean?

<sox:Property name="Control Objective(s)" type="multiselect">
<xsl:attribute name="value">
<xsl:value-of select="sox:control/sox:Component/sox:Properties/sox:Property[1]/@value"/>

Postnext
(Deleted User) Subject: tabs converted to spaces
Author: (Deleted User)
Date: 21 Jul 2005 04:19 AM
Hi Joe,
the code you write will correctly create an attribute with a value containing tabs, if they are present in the XML node you are selecting. The issue is when you load the generated XML using a parser: in that moment the tabs will be replaced by spaces, because this is what the XML specs mandate.
There are ways to make so that the XSL generates strings like '&#x9;' instead of tabs, but unfortunately when used inside attribute values they get further processed into '&amp;#x9;'.

Summarizing, I see only these workarounds:
1) don't place tabs into attribute values (e.g. use a text node)
2) post-process the XML to replace the tabs with the entity reference

Note: the issue would appear also for new line characters (CR and LF)

Hope this helps,
Alberto

Posttop
Joe SimsSubject: tabs converted to spaces
Author: Joe Sims
Date: 21 Jul 2005 09:09 AM
Yea helps a lot. Thanks!

   
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.