ode-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Boisvert" <boisv...@intalio.com>
Subject Re: Problems while coping integer values
Date Thu, 21 Jun 2007 18:18:22 GMT
Hi Luca,

The decimal form you're seeing is the default representation of numbers in
XPath.   If you want to drop the decimal, use the function
string($counterParam).   Here's what the XPath spec section 4.2 says about
the string() function:

if the number is an integer, the number is represented in decimal form as a
Number <http://www.w3.org/TR/xpath#NT-Number> with no decimal point and no
leading zeros, preceded by a minus sign (-) if the number is negative

alex


On 6/21/07, Luca Clementi <l.clementi@cineca.it> wrote:
>
> Hi all,
>
> I am trying to copy an integer value in an attribute with the following
> copy:
>
>   <copy>
>       <from>$counterParam</from>
>       <to>$n0_PAAM_data_in.body/xsd:parameterSet/@id</to>
>   </copy>
>
> Where
>   <variable messageType="xsd:paamInput" name="n0_PAAM_data_in" />
>   <variable name="counterParam" type="xs:integer" />
> and paamInput schema declares the attribute with a:
> <xsd:attribute name="id" type="xsd:integer" use="optional"/>
>
>
> The problem is that final result is:
> <?xml version="1.0" encoding="UTF-8"?>
> <PAAM_in xmlns="http://www.a-ware.org/test/xsd"
> xmlns:xsd="http://www.a-ware.org/test/xsd">
> <templateFile>pluto</templateFile>
>                 <parameterSet id="1.0">    <----------
>                 <xsd:parameter>
>                         <xsd:name>string1</xsd:name>
>                         <xsd:value>string1</xsd:value>
>                 </xsd:parameter>
>        </parameterSet>
> </PAAM_in>
>
>
> While before the copy it was:
> <parameterSet id="1">
>
> Obviously the final message is invalid because the field that should be
> an integer, is represented with a dot.
>
> Is this a bug or am I doing something wrong?
>
>
> thanks for your help,
> Luca
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message