[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

Use Saxon Proccessor to Process XQuery

Alice Wei ajwei at indiana.edu
Fri Dec 28 11:37:41 PST 2007


  Use Saxon Proccessor to Process XQuery
Hi,

  I wonder if there are any of you on this list use Saxon (Java) to 
process XQuery files. I currently process my XQuery files with a XML 
editor to parse the XQuery. Since I have external variables in
my files, I wonder if it is possible to generated it using the command prompt.

For my XQuery file, it calls the external file instead of a database, 
as shown in the following:

declare boundary-space preserve;
declare variable $text external;

<project>
{
for $project in doc("resume_2.xml")//projection,
$content in $project/descrip,
$title in $project/project_title,
$url in $project/link_2/extras_1/@url
    where contains($content, $text)
return
<projection>
<project_title>{data($title)}</project_title>
<descrip>{data($content)}</descrip>
<link_2>
<extras_1 url="{data($url)}"/>
</link_2>
</projection>
}
</project>

The query works, without a terminal prompt, that is. What I want to do 
is to call it with a command prompt so I can change my variable from 
case to case. According to Dr. Kay's article in Learn XQuery in 10 
minutes, the prompt is as follows:

  java net.sf.saxon.Query sample.xquery firstName=Lisa

I tried implementing it on my server, which my saxon8.jar file is on 
the same path as my to be parsed files, but the prompt result is as 
follows:

java saxon8.jar question_8.xquery text=SLIS
Exception in thread "main" java.lang.NoClassDefFoundError: saxon8/jar

I then added -jar to make the prompt look like:

java -jar saxon8.jar question_8.xquery text=SLIS
Stylesheet file text=SLIS does not exist

Is there something I did wrong?

Thanks for your help.

Alice Wei
MIS 2008
School of Library and Information Science
Indiana University Bloomington
http://x-query.com/mailman/listinfo/talk
812-856-2659



Purchase Stylus Studio Online Today!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.