473,725 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XQuery APIs -- how do you identify the XML source

I am having a very basic problem with XQuery.

I want to use an XQuery API in Java (either Saxon or Qexo), and I have
an XQuery expression that works as expeced from the command line if I
specify a filename before the xpath expression.

What I want to know is this: If I want to use
Qexo's gnu.xquery.lang .XQuery.eval() or
Saxon's QueryExpression .evaluate(),
how do I specifiy the input in the Xquery statement?
For line 3 of the xquery, I want to say something analagous to:

let $vars=string({x ml string goes here})//ci/text()

or

let $vars=input()//ci/text()

to read whatever the argument of eval is.
but neither of these seem to work.

Please please help!

Thanks,

(Expressions appear below).
------------ start xquery ---------------------------
1 <varlist>
2 {
3 let $vars:=document ("equation.mml" )//ci/text()
4 for $var in $vars
5 return
6 <var>{$var}</var>
7 }
8 </varlist>

------------ end xquery ---------------------------

on the xml file:

------------ start xml "equation.m ml" ---------------------------
<math>
<apply>
<eq/>
<apply>
<plus/>
<apply>
<times/>
<cn>3</cn>
<apply>
<plus/>
<ci>x</ci>
<cn>2</cn>
</apply>
</apply>
<cn>3</cn>
</apply>
<ci>y</ci>
</apply>
</math>

------------ end xml equation.mml--------------------------

to produce (as expected)

-------------- begin output ------------------------------
<varlist>
<var>x</var><var>y</var>
</varlist>

-------------- end output --------------------------------
+----------------------------------------------------------------------+
+ Integre Technical Publishing, inc. +
+ http://www.integretechpub.com +
+ (505)889-8189 +
+----------------------------------------------------------------------+

Jul 20 '05 #1
0 1429

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2078
by: Ken North | last post by:
Jim Melton, standards architect at Oracle and editor of the SQL standard, discusses SQL/XML (technically part 14 of the new SQL:2003 standard). He also discusses data access APIs and the integration of XQuery into SQL. Running time for this program is 6:15 (streaming video or audio) http://www.sqlsummit.com/People/JMelton.htm ====================================
2
2792
by: Tom Corcoran | last post by:
I am working to ease updating of a html page by transforming 2 xml files. I was going to use xslt for this and had bought 2 unopened books, wrox xslt and o'reilly's xslt cookbook. But am now wondering if I am better of learning XQuery instead? Any thought and opinions would be appreciated. Cheers - Tom. The Architect: "Hope, it is the quintessential human delusion,
0
2175
by: Tony Lavinio | last post by:
Dear Stylus Studio Friends, The new year is scarcely one month old, but we already have lots to report! For starters, there's Stylus Studio 6 Release 2. The latest release of Stylus Studio boasts literally hundreds of product enhancements, and is available now for free trial download. We're also proud to present our interview with Dr. Daniela Florescu, editor of the XQuery specification. Read this month's Stylus Scoop and learn about...
0
1532
by: pepin_labulle | last post by:
I'm a newbie with XQuery and I'm trying to execute a query with Saxon. If I don't specify the XML source file name in the query, Saxon raises the following error : javax.xml.transform.Transforme­rException: Finding root of tree: the context item is not set Even if I specified the source file name in the command line. Here is the command line I used : java -cp saxon8.jar net.sf.saxon.Query -s books.xml books.xq
0
2305
by: Stylus Studio | last post by:
DataDirect XQuery(TM) is the First Embeddable Component for XQuery That is Modeled after the XQuery API for Java(TM) (XQJ) BEDFORD, Mass.--Sept. 20, 2005--DataDirect Technologies (http://www.datadirect.com), the software industry leader in standards-based components for connecting applications to data and an operating unit of Progress Software Corporation, today announced the release of DataDirect XQuery(TM), the first embeddable...
8
3197
by: Clamps | last post by:
So I've been reading about XQuery, but cannot find a dll or namespace download to use the technology in vs.net 2002 or 2003. Any directions would be great. -- "If I'm the president, we're going to have emergency-room care, we're going to have gag orders." ---W "The President"
2
1755
by: BK | last post by:
I am working on system that will have a cataloging component which would essentially be a Folder/File structure. So far I have coded the Iteration over a selected folder and am displaying the data/structure in a TreeView (VB.NET 2005). I then serialize the Treeview and store the serialized XML in a SQL 2005 XML Column. I can also retrieve an entire XML (one record, that is) and (re) rebuild the TreeView by de-serializing. Never...
2
1596
by: Ale | last post by:
Hi all! I need to build a middleware for XQuery: I mean a software receiving a std xquery and outputting the xquery result on "database.xml". This middleware must use 7 or 8 different choosable XQuery implementations... The XQuery received must be std for all implementations. The middleware will parse the std XQuery in the specific XQuery for the specific implementation, returning an error if requested features isn't avaiable for the...
2
4336
by: tammo.mueller | last post by:
Hi, I'm trying to execute a xquery statement and I get always errors. It seems that only the prolog section is giving me errors. If I want to declare a namespace the xquery processor is coming up with an "unexpected token" error. The same error appears if I just set the version. The xquery statement itself is working without prolog, but I get no results because of the missing namespace.
0
8889
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9116
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8099
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.