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
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Kurt WaldSubject: hex value problem
Author: Kurt Wald
Date: 30 Apr 2007 06:42 AM
Hi,

in an xml to text mapping without indentation <xsl:output method="text" encoding="ISO-8859-1"/> and saxon 8.73 as processor if I enter something in the source editor like:

<xsl:value-of select="concat(A/B,'&#xD;&#xA;')"/>

then switch to the mapper view, do some graphical mapping and save the xslt in the mapper, the source view looks like:

<xsl:value-of select="concat(A/B,'
')"/>

If I then use the indentation button in the source editor my linebreak is gone:

<xsl:value-of select="concat(A/B,'')"/>

By the way: why does the mapper at all change source view indentation on save?

Kurt Wald

Postnext
Alberto MassariSubject: hex value problem
Author: Alberto Massari
Date: 30 Apr 2007 09:15 AM
Hi Kurt,
the CRLF entities are removed by the code-generation part of mapper; the problem will be fixed in the next update of Stylus.
Mapper currently doesn't have an option to disable indentation when generating the XSLT code; but this is usually not a problem when the output method is XML or HTML. It is indeed a problem when generating TEXT, but in this case Mapper is probably not the best tool to use, as the target schema is missing. Could you tell us how are you using Mapper when generating TEXT?

Thanks,
Alberto

Postnext
Kurt WaldSubject: hex value problem
Author: Kurt Wald
Date: 30 Apr 2007 01:44 PM
Hi Alberto,

I indeed do have a target schema, which represents the output record and field structure. So mapping can mainly be done graphically, while text formatting is either done via built-in functions like format-number or by a set of java extensions for left-/right justification, field length etc. Crlf is used as record separator. With indentation off, Saxon produces the desired fixed length text record structure.

Kurt

Postnext
Kurt WaldSubject: hex value problem
Author: Kurt Wald
Date: 01 May 2007 07:58 AM
Hi Alberto,

in addition to the above and not only in relation to text output - is there a way to prevent the indenter from reformatting specific lines? For instance after making an assignment in the mapper and running the stylesheet from there, multiple single line comments on subsequent individual lines are contracted and positioned at the end of the previous xslt statement.

Example:

<A>abc</A>
<!--comment 1-->
<!--comment 2-->

becomes

<A>abc</A><!--comment 1--><!--comment 2-->

if you want the previous form and push the indent button in the source editor an SQL statement like the following

<xsl:variable name="vU">update X set Y = <xsl:value-of select="A"/> where K_ID = 'B'</xsl:variable> <!--all on a single line-->

becomes

<xsl:variable name="vU">update X set Y =
<xsl:value-of select="A"/>where K_ID = 'B'</xsl:variable>

which often makes it disfunctional.

Kurt

Posttop
Tony LavinioSubject: hex value problem
Author: Tony Lavinio
Date: 01 May 2007 09:47 AM
Consider using <xsl:text></xsl:text> around the literal text.
XSLT has special rules that kick in when you have literal
text not enclosed by that element that may be tripping you up.
If you want to make a clear distinction between markup and
indenting, use that instead of just embedding plain text, and
then even changing indenting won't cause trouble.

In the specification, under this link:
http://www.w3.org/TR/xslt#section-Creating-Text
there is a tiny little sentence which says:
"Literal data characters may also be wrapped in an xsl:text element.
This wrapping may change what whitespace characters are stripped"

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
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.