qexo-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qexo-general] namespaces in xquery


From: Víctor Torres Padrosa
Subject: Re: [Qexo-general] namespaces in xquery
Date: Mon, 24 Nov 2003 11:34:57 +0100

Thank you very much for your answer.
I've tried to use WinCVS to try the CVS version of Kawa but for the moment I
haven't succeeded to connect (I'm not familiar with CVS).
Please let me know if there is a new .jar version (1.7.9 or 1.8)

Víctor Torres


----- Original Message ----- 
From: "Per Bothner" <address@hidden>
To: "Víctor Torres Padrosa" <address@hidden>
Cc: <address@hidden>
Sent: Friday, November 21, 2003 6:15 PM
Subject: Re: [Qexo-general] namespaces in xquery


Víctor Torres Padrosa wrote:

> I would be grateful if anyone could help me.
> I'm using kawa-1.7.jar and it seems that it does not understand the
> namespace's declarations.

It does.  They are used to properly parse and match QNames.
However, Kawa 1.7 doesn't print out namespace declarations properly.
CVS Kawa does print out namespace nodes properly, at least those
that arise from input .xml documents.  (It doesn't handle
namespace declarations from constructed nodes yet.)

> 1- Given the following xml file (did.xml):
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <didl:DIDL>
>
> <r:license xmlns:r="urn:mpeg:mpeg21:2003:01-REL-R-NS"
> xmlns:sx="urn:mpeg:mpeg21:2003:01-REL-SX-NS"
> xmlns:mx="urn:mpeg:mpeg21:2003:01-REL-MX-NS"
> xmlns:dsig="http://www.w3.org/2000/09/xmldsig#";>......</r:license>
>
> .....
>
> </didl:DIDL>

This is not a namespace-correct XML file - there is no
namespace declaration for didl.

> This result does not have the namespaces! Does anyone know how to keep
them?

Try the CVS version of Kawa.

(I may try to do a quick 1.7.90 snapshot/beta this weekend.)

> I would be also interested in extracting the namespace´s prefixes (r,
> sx, and mx) given their urn expression
> (urn:mpeg:mpeg21:2003:01-REL-R-NS, urn:mpeg:mpeg21:2003:01-REL-SX-NS and
> urn:mpeg:mpeg21:2003:01-REL-MX-NS).

You could do that with the standard fn:get-in-scope-prefixes.
Unfortinately, I haven't implemented it yet.  However, it should
be easy to implement it, and I plan to do so for Kawa 1.8.

> The function I'm using to evaluate the query is the following:
>
>             result=xq.eval(squery);
>             XMLPrinter xp = new XMLPrinter(out);
>             xp.writeObject(result);

This would be more efficient:

XMLPrinter xp = new XMLPrinter(out);
xq.eval(squery, out);
-- 
--Per Bothner
address@hidden   http://per.bothner.com/




_______________________________________________
Qexo-general mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/qexo-general





reply via email to

[Prev in Thread] Current Thread [Next in Thread]