Ihe Onwuka
2014-10-18 17:58:34 UTC
Given a piece of data like
<movie imdbID="1000111" rtID="/m/joyjatra/"/>
I wanted to zero pad all imdbID attributes to length 7.
So i did this
<movie imdbID="1000111" rtID="/m/joyjatra/"/>/
<movie>{
@rtID,
attribute imdb_id {format-number(@imdbID,'0000000')}
}</movie>
Now it's quite possible that I asked for the wrong thing but leave that
aside for a sec. In this particular example the desired outcome is that the
data returns unchanged since it is already the requisite length.
But
in eXist I get
<movie rtID="/m/joyjatra/" imdb_id="1.000111E6"/>
and in Zorba I get
<movie rtID="/m/joyjatra/" imdb_id="NaN"/>
<movie imdbID="1000111" rtID="/m/joyjatra/"/>
I wanted to zero pad all imdbID attributes to length 7.
So i did this
<movie imdbID="1000111" rtID="/m/joyjatra/"/>/
<movie>{
@rtID,
attribute imdb_id {format-number(@imdbID,'0000000')}
}</movie>
Now it's quite possible that I asked for the wrong thing but leave that
aside for a sec. In this particular example the desired outcome is that the
data returns unchanged since it is already the requisite length.
But
in eXist I get
<movie rtID="/m/joyjatra/" imdb_id="1.000111E6"/>
and in Zorba I get
<movie rtID="/m/joyjatra/" imdb_id="NaN"/>