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
Show tree view Topic
Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
steven nourseSubject: Running xquery from the command line
Author: steven nourse
Date: 30 Jul 2008 03:38 PM
I am trying to run an xquery from the command line and I am getting this error message:
Error (file (null), line 0, column 0): External function 'increment' has not bee
n bound to an implementation

increment is an external java function that I have created and it runs fine within stylus studio. Any help is appreciated.

Postnext
Minollo I.Subject: Running xquery from the command line
Author: Minollo I.
Date: 30 Jul 2008 03:48 PM
What is the exact command line you are trying to execute?

Can you also share how the function and its associated namespace are declared in the XQuery?

Postnext
steven nourseSubject: Running xquery from the command line
Author: steven nourse
Date: 30 Jul 2008 03:53 PM
Command line:
C:\Documents and Settings\snourse\My Documents\Work\Stylus Studio>"C:\Program Fi
les\Stylus Studio 2008 XML Enterprise Suite Release 2\bin\StylusXql" -in CMS_sam
ple.xml -out converter:EDI?output.edi xml_to_837.xquery

in file:
declare namespace Counter = "ddtekjava:Counter";
declare function Counter:increment() as xs:double external;
declare function Counter:previous() as xs:double external;

Postnext
Minollo I.Subject: Running xquery from the command line
Author: Minollo I.
Date: 30 Jul 2008 04:21 PM
Originally Posted: 30 Jul 2008 04:11 PM
Oh, that explains it; StylusXql invokes the Stylus Studio XQuery engine, which is a simpler C++ based XQuery engine used by Stylus Studio mostly for debugging purposes.

Your XQuery is relying on DataDirect XQuery, and that's what you want to run.

To do that, you can execute:
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" com.ddtek.xquery.Query -s CMS_sample.xml -o output.edi xml_to_837.xquery !method=EDI

Postnext
Minollo I.Subject: Running xquery from the command line
Author: Minollo I.
Date: 30 Jul 2008 04:22 PM
I've just edited my reply to use the proper classpath information and setting the output method directly from the command line.

Postnext
steven nourseSubject: Running xquery from the command line
Author: steven nourse
Date: 30 Jul 2008 04:37 PM
Thank you I have got it working. I just had to also add the classpath to my custom java function in and it worked perfectly. Just for reference for anyone else this is the full command that I used.

java -cp "c:\P
rogram Files\Stylus Studio 2008 XML Enterprise Suite Release 2\Components\DataDi
rect XQuery\lib\ddxq.jar";"c:\Program Files\Stylus Studio 2008 XML Enterprise Su
ite Release 2\Components\XML Converters for Java\lib\XMLConverters.jar";"C:\Docu
ments and Settings\snourse\My Documents\Work\Stylus Studio" com.ddtek.xquery.Que
ry -s CMS_sample.xml -o output.edi xml_to_837.xquery !method=EDI

Posttop
Minollo I.Subject: Running xquery from the command line
Author: Minollo I.
Date: 30 Jul 2008 05:28 PM
For the record, and so that you are not surprised when that happens: you can use DataDirect XQuery and XML Converters outside the Stylus Studio UI (like through the command line interface) only if you have a valid license for those components.

You'll be able to run the command above for 14 days after the Stylus Studio installation day; after that period, you'll need to contact our sales or support organization at DataDirect (www.datadirect.com) for details about what additional licenses you would need and/or to extend your evaluation period for the components.

Hope this helps.

 
Go to previous topicPrev TopicGo to next topicNext Topic
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.