-
Notifications
You must be signed in to change notification settings - Fork 99
XQuery Script Execution
✋ Wait a Second!
You must have a folder opened in Code to use this feature.
-
Define an XQuery execution engine using the
xmlTools.xqueryExecutionEnginesetting. This setting should be the full path to a command line XQuery engine (such as AltovaXML or BaseX).Example Configuration for AltovaXML 2008
{ "xmlTools.xqueryExecutionEngine": "C:\\Program Files (x86)\\Altova\\AltovaXML2008\\AltovaXML.exe" } -
Define the requisite command line parameters for your tool of choice using the
xmlTools.xqueryExecutionArgumentssetting. You can use$(script)to reference the full path to the XQuery script,$(input)to reference to full path to the input XML file, and$(project)to reference the full path to the currently-opened workspace/project folder.Example Configuration for AltovaXML 2008
{ "xmlTools.xqueryExecutionEngine": "C:\\Program Files (x86)\\Altova\\AltovaXML2008\\AltovaXML.exe", "xmlTools.xqueryExecutionArguments": [ "-xquery", "$(script)", "-in", "$(input)" "-out", "$(input).output.xml" ] } -
Open a folder in Code containing your XQuery script, then run the
XML Tools: Execute XQuerycommand. You will be prompted to select an XML file in your workspace to use as an input file. A message will be written to the status bar while XML Tools waits for the spawned process to end.
💡 Pro Tip
The output of the execution engine is captured via thestdoutfor your operating system.
If the process exits with any code other than0, any content written tostdoutis shown as an error message. If the content fromstdoutcontains a line number, the error prompt will contain a button to take you to the line in question.
Copyright © 2016 - Josh Johnson