Re: [xml] XInclude and Namespaces



Hi

Yes, that was it:

Just for the reference, the following XInclude works fine:

<xi:include
href="http://roger.bitflux.ch/slideset-20020812.xml#xmlns(s=http://www.oscom.org/2002/SlideML/0.9/)xpointer(/s:slideset/s:slide[1])"/>

Thanks for your quick help

chregu


On Mon, 12 Aug 2002, Daniel Veillard wrote:

  Yep, the href is an URI-Reference, and hence should be context insensitive
there is a special construct xmlns(s=....)#xpointer(/s:slideset...) in recent
XPointer drafts to map the s prefix to the URI for the namespace, see
   http://www.w3.org/TR/xptr/#ns-context
this should work in libxml2, if not it's a bug :-)
I did not check the latest set of XPointer drafts, I expect the construct to
still be there.

Daniel

On Mon, Aug 12, 2002 at 03:08:01PM +0200, Christian Stocker wrote:
Hi

played with the XInclude Support in libxml and it seems to work very fine,
except when my xpath-expression has namespaces... the xml:

*******
<?xml version="1.0" standalone="yes"?>
<root xmlns:xi="http://www.w3.org/2001/XInclude";
xmlns:s="http://www.oscom.org/2002/SlideML/0.9/";>
<xi:include
href="http://roger.bitflux.ch/slideset-20020808.xml#xpointer(/s:slideset/s:slide[1]/*)"/>
</root>
*******

produces with  xmllint --xinclude xinclude.xml just:
*******
Error Undefined namespace prefix

^
XInclude: XPointer evaluation failed: #xpointer(/s:slideset/s:slide[1]/*)
<?xml version="1.0" standalone="yes"?>
<root xmlns:xi="http://www.w3.org/2001/XInclude";
xmlns:s="http://www.oscom.org/2002/SlideML/0.9/";>

</root>
********

Did i something wrong, or how can I declare that namespace correctly?

TIA

christian


_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml



-- 
christian stocker | bitflux GmbH | schöneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71
http://www.bitflux.ch  |  chregu bitflux ch  | gnupg-keyid 0x5CE1DECB





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