MrD
MrD

Reputation: 5086

XQuery Transformation without hardcoding XML document

I am using the oXygen XML editor, and have defined a series of XQuery transformations.

The problem is, as of right now the input xml needs to be declared as:

let $k := doc("path")

I was wondering if there was some way of replacing doc("path") with the content of the file defined in the transformation scenario?enter image description here

(Ie: in this case untitled.xml)

Upvotes: 1

Views: 276

Answers (1)

wst
wst

Reputation: 11771

Try clicking on Parameters (0) and adding a new parameter URL with value of ${currentFileURL}. Then in your script prolog declare an external variable:

declare variable $URL external;

Then you should be able to reference doc($URL), and if the XML URL changes in Oxygen, it should pass through to your XQuery script.

Upvotes: 3

Related Questions