normalize-space function inconsistent results
Posted: Thu Jun 30, 2016 11:59 pm
Can anyone explain why I get different results from normalize-space, depending on how I use it?
In one case it works as expected, in the other case it leaves a space on the end of the value:
Source data contains:
<sch:let name="refValue"
value="//Document/dataProvider/normalize-space()"/>
Produces: refValue = MTY-MITAC;
<sch:let name="refValue"
value="//Document/dataProvider[normalize-space()]"/>
Produces: refValue = MTY-MITAC ; (note the extra space at the end)
<sch:let name="refValue"
value="//Document/dataProvider[normalize-space(.)]"/>
Produces: refValue = MTY-MITAC ; (note the extra space at the end)
In one case it works as expected, in the other case it leaves a space on the end of the value:
Source data contains:
Code: Select all
<dataProvider> MTY-MITAC </dataProvider>
<sch:let name="refValue"
value="//Document/dataProvider/normalize-space()"/>
Produces: refValue = MTY-MITAC;
<sch:let name="refValue"
value="//Document/dataProvider[normalize-space()]"/>
Produces: refValue = MTY-MITAC ; (note the extra space at the end)
<sch:let name="refValue"
value="//Document/dataProvider[normalize-space(.)]"/>
Produces: refValue = MTY-MITAC ; (note the extra space at the end)