IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

AltovaXML Options · View
vov
Posted: Tuesday, January 24, 2012 4:18:50 AM
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.
vlad
Posted: Tuesday, January 24, 2012 7:46:29 AM
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.

vov
Posted: Wednesday, February 8, 2012 4:18:02 AM
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
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.