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

Re: Normalizing space / XPTY0004

Subject: Re: Normalizing space / XPTY0004
From: "Imsieke, Gerrit, le-tex" <gerrit.imsieke@xxxxxxxxx>
Date: Tue, 30 Jul 2013 01:08:07 +0200
Re:  Normalizing space / XPTY0004
Try
<xsl:value-of select="./TextRun/Text/@value" separator=""/>
or
<xsl:value-of select="string-join(./TextRun/Text/@value, '')" />

On 30.07.2013 00:55, Lief Erickson wrote:
Hi All--

XSLT 2.0
Saxon EE 9.5.0.2 (in oXygen 15.0)

I have a question about normalizing space -- at least I think that's what my question is about. I am matching the following TextRun/Text values, but the output is putting a space either after the end of the line or before the beginning (I can't tell which). That makes the word "are" become "ar e" and "larger" become "lar ger" and "unchanged" become "unchang ed". Obviously this is not my desired result, but the processor is dutifully matching exactly what it finds.

       <Paragraph stylename="Body">
          <TextRun>
             <Text value="If enabled, only the first N-bytes of each ingress packet ar"/>
             <Text value="e forwarded to Tool Ports connected to the rule. Packets lar"/>
             <Text value="ger than the trim length are 'trimmed' to the size specified"/>
             <Text value=". Packets smaller than the trim length are forwarded unchang"/>
             <Text value="ed."/>
          </TextRun>
       </Paragraph>


<xsl:template match="Paragraph[@stylename = 'Body']"> <xsl:value-of select="./TextRun/Text/@value"/> </xsl:template>

Output:
If enabled, only the first N-bytes of each ingress packet ar e forwarded to Tool Ports connected to the rule. Packets lar ger than the trim length are 'trimmed' to the size specified . Packets smaller than the trim length are forwarded unchang ed.

I tried <xsl:value-of select="normalize-space(./TextRun/Text/@value)"/>, but I get error XPTY0004.

Can someone explain how I should be properly connecting the Text/@value entries in this TextRun so that my words are whole?

-Lief

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.