[xquery-talk] Local schemas and selecting paths
Anthony Ikeda
AIkeda at copyright.com.au
Mon Sep 27 18:52:23 PDT 2004
I'm new to XQuery and trying to get the hang of it and so far so good.
One question I have is selecting XPaths using a locally declared
namespace. For example I have the following XQuery:
declare namespace a = "myNamespace.xsd"
<result>
{
for $val in /a:trains/a:types
return $val/text()
}
</result>
Both the xquery document and the schema exist in the same folder side by
side.
Typically I've declared namespaces using URIs rather than locally but
find that I do not get a result from the above code (The same goes when
I use the file:// protocol in the namespace declaration).
If I use the fully qualified path (I think that's what it's called) like
so:
<result>
{
for $val in /*[name="trains"]/*[name="types"]
return $val/text()
}
</result>
Then there is no problem.
I've tried running the above xqueries using the Stylus Studio built in
engine and the Saxon query engine (v7) also in Stylus Studio.
Does anyone know where I'm going wrong?
Regards,
Anthony
Business Analyst
Copyright Agency Limited
**********************************************************
This electronic mail message and any attachments are confidential. If you are not the intended recipient please do not use the information, advise us immediately and destroy this message. Opinions and information in this message are those of the sender and not necessarily those of CAL. Unless expressly permitted by the sender, you may not copy, disclose or use the contents in any way.
If this e-mail contains a marketing message and you do not want to receive such messages from CAL in the future please e-mail info at copyright.com.au including remove in the subject line of the reply message.
**********************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://xquery.com/pipermail/talk/attachments/20040927/f4bdaaa2/attachment.htm
More information about the talk
mailing list