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
Go to previous topicPrev TopicGo to next topicNext Topic
Posttop
Tom MasciovecchioSubject: fn:replace() inserting spaces in results?
Author: Tom Masciovecchio
Date: 14 Mar 2010 12:53 PM
This code:

xquery version "1.0";
let $doc := element data {
element row {'abc'},
element row {'def'}}
return
element results {
for $a in $doc/node()
return
$a/node()
}

returns (as expected) <results>abcdef</results>

If I change the last line to $fn:replace($a/node(), 'x', 'y'), i.e.,

xquery version "1.0";
let $doc := element data {
element row {'abc'},
element row {'def'}}
return
element results {
for $a in $doc/node()
return
fn:replace($a/node(), 'x', 'y')
}

The results contain a space between the 'c' and 'd': <results>abc def</results>

Where is the extra space coming from?

Thanks.

 
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.