Subject: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,'
')"/>
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?
Subject:hex value problem Author:(Deleted User) 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?
Subject: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.
Subject: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>
Subject: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"