XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
+ XSLT Help and Discussion (7625)
- XQuery Help and Discussion (2017)
-> + Issue with Processing Instruct... (2)
-> + problem converting json to XML... (2)
-> + Problem base64 decoding string... (3)
-> + Problems posting multipart for... (5)
-> + trouble with download of price... (2)
-> + Problem with http-post not bei... (3)
-> + path problem, xps_file:writeAl... (9)
-> + Xquery update support? (2)
-> + problem with Stylus studio try... (5)
-> + adding dtd reference to xml ou... (4)
-> + xquery escaping ambarsand when... (3)
-> + Whitespace problem when return... (5)
-> + Problem with namespace prefix ... (5)
-> - Sending via SFTP returns unexp... (1)
-> + Query and Sftp clent (4)
-> + xquery and try - catch (3)
-> + Query + ddtek:http-post optio... (5)
-> + Example files referenced in do... (3)
-> + Automatic Error Detection and ... (3)
-> + Working with result of ddtek:h... (2)
-- [1-20] [21-40] [41-60] Next
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
steven nourseSubject: Running xquery with a source conversion from command line
Author: steven nourse
Date: 04 Aug 2008 12:07 PM
I am trying to run an xquery from the command line and I need the source document converted from a csv to an xml. How do I do this?

Here is the command I am using that does not work.
This is the main part I am wondering about

-s converter:CSV?file:///C:/MA540CSV.20080708 -o output.xml

Whole cmd
java -cp "c:\Program Files\Stylus Studio 2008 XML Enterprise Suite Release 2\Components\DataDirect XQuery\lib\ddxq.jar";"c:\Program Files\Stylus Studio 2008 XML Enterprise Suite Release 2\Components\XML Converters for Java\lib\XMLConverters.jar";"c:/PROGRA~1/STYLUS~1/Components/XML Converters for Java/lib/codehaus/wstx-asl.jar" com.ddtek.xquery.Query -s converter:CSV?file:///C:/MA540CSV.20080708 -o output.xml MA540to810.xquery

Postnext
Minollo I.Subject: Running xquery with a source conversion from command line
Author: Minollo I.
Date: 04 Aug 2008 12:42 PM
You won't be able to use the -s argument to specify an XML converters URI (even if that's a very good topic for an enhancement request in the command line utlity).

You can achieve a similar result using declaring an external variable in your XQuery...

declare variable $input as xs:string external;

...and then using the fn:doc() function to navigate the content of the input file; so, instead of ...
/table/...
...you would do...
fn:doc($input)/table/...

Then your cmdline can become:
java -cp "c:\Program Files\Stylus Studio 2008 XML Enterprise Suite Release 2\Components\DataDirect XQuery\lib\ddxq.jar";"c:\Program Files\Stylus Studio 2008 XML Enterprise Suite Release 2\Components\XML Converters for Java\lib\XMLConverters.jar";"c:/PROGRA~1/STYLUS~1/Components/XML Converters for Java/lib/codehaus/wstx-asl.jar" com.ddtek.xquery.Query -o output.xml MA540to810.xquery input="converter:CSV?file:///C:/MA540CSV.20080708"

Postnext
steven nourseSubject: Running xquery with a source conversion from command line
Author: steven nourse
Date: 04 Aug 2008 01:45 PM
Would it be better to just generate java code for this purpose and then run the java program from the command line?

Do you need additional licenses to run stylus studio xquery stuff through a java program?

Posttop
Minollo I.Subject: Running xquery with a source conversion from command line
Author: Minollo I.
Date: 04 Aug 2008 01:57 PM
Originally Posted: 04 Aug 2008 01:56 PM
>Would it be better to just generate java code for this purpose and
>then run the java program from the command line?

You wouldn't need to create the external variable in that case. Apart from that, you shouldn't see significant differences.

>Do you need additional licenses to run stylus studio xquery stuff
>through a java program?

Same as running the command line; you'll need runtime DataDirect XQuery and XML Converters licenses consistent with your deployment model.

   
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.