Rank: Newbie
Joined: 1/24/2012 Posts: 2
|
Hi. I try to work with command string AltovaXML.
> AltovaXML -xquery my.xq -in my.xml -out my.txt
How can I use the name of input file (key -in), in XQUERY programme File my.xq (begining of the file)
xquery version "1.0"; declare variable $my_doc := doc(??????); ...
What should I write instead of question mark? Thank you for your attention.
|
Rank: Advanced Member
Joined: 12/13/2005 Posts: 2,856 Location: Mauritius
|
You just don't use the doc function. You have you input already - you don't even need the variable.
You simply write / for the root node.
|
Rank: Newbie
Joined: 1/24/2012 Posts: 2
|
My last working сode, with function doc :)
Code: xquery version "1.0"; declare variable $my_doc := doc("d:\my.xml"); declare variable $dlm := codepoints-to-string((9)); let $ x:= for $i in $my_doc//Parcels/Parcel for $j at $n_c in $i//Spatial_Element for $k at $n_v in $j/Spelement_Unit return concat(data($i/@CadastralNumber), $dlm, $n_c, $dlm, $n_v, $dlm, normalize-space($k/Ordinate[1]/@X), $dlm, normalize-space($k/Ordinate[1]/@Y) ) return string-join ( $x, codepoints-to-string((10)) )
This is my new variant, thats much better.
Code: xquery version "1.0"; declare variable $dlm := codepoints-to-string((9)); let $ x:= for $i in //Parcels/Parcel for $j .....
Thank you so much
|