[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: I output a tab character, then the output file co

Subject: Re: I output a tab character, then the output file contains space, tab, space ... why?
From: "Eliot Kimber ekimber@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 8 Apr 2016 15:24:45 -0000
Re:  I output a tab character
I would use string-join for this:

<xsl:sequence select="string-join($headers,$field-separator)"/>

The for-each loop is not needed.

Someone can correct me but I believe in your code the rules for sequence
construction come into play meaning that the string result of a sequence
always includes a space between items, so you're creating a sequence of
("A", "\t", "B"), which becomes "A \t B".

Cheers,

Eliot
----
Eliot Kimber, Owner
Contrext, LLC
http://contrext.com




On 4/8/16, 11:13 AM, "Costello, Roger L. costello@xxxxxxxxx"
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

>Hi Folks,
>
>In the below XSLT program I loop over each value in a sequence and
>separate the sequence values by a tab (hex 9) character. When I open the
>output file in a hex editor I see 3 characters separating the sequence
>values: space (hex 20), tab (hex 9), and space (hex 20). Why am I getting
>those space characters? How do I avoid getting them?  /Roger
>
><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>                           version="2.0">
>    
>    <xsl:output method="text" />
>    
>    <xsl:variable name="headers" select="('A', 'B')"/>
>    <xsl:variable name="field-separator"
>select="codepoints-to-string(9)"/>
>    
>    <xsl:template match="/">
>        <xsl:for-each select="$headers">
>            <xsl:sequence select="." />
>            <xsl:sequence select="$field-separator"/>
>        </xsl:for-each>
>    </xsl:template>
>    
></xsl:stylesheet>

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.