[xml] Trouble using XInclude



Hello,

I'm using xmllint (fomr the libxml2-2.6.3.win32 distribution) on a Windows
2000 Platform. Especially, I'm trying to get the --xinclude option working
as I intend it. However, this does not work. Let me explain the problem:

1. I've got a file called book.xml:

<?xml version="1.0" encoding="UTF-8"?>
<book xmlns:xi="http://www.w3.org/2003/XInclude";>
        <xi:include href="chapters.xml"
xpointer="xpointer(//chapter[ id='ch1'])"/>
</book>

2. The file chapters.xml contains

<?xml version="1.0" encoding="UTF-8"?>
<chapters>
<chapter id="ch1">
<title>chapter 1</title>
</chapter>
<chapter id="ch2">
<title>chapter 2</title>
</chapter>
</chapters>

3. My intention is to merge the first chapter (with id="ch1") in the file
book.xml, so it would have to look like

<?xml version="1.0" encoding="UTF-8"?>
<book xmlns:xi="http://www.w3.org/2003/XInclude";>
<chapter id="ch1">
<title>chapter 1</title>
</chapter>
</book>

Omitting the added xml:base attribute.

4. However, the result that i'm obtaining is:

<?xml version="1.0" encoding="UTF-8"?>
<book xmlns:xi="http://www.w3.org/2003/XInclude";>

<chapters>
<chapter id="ch1">
<title>chapter 1</title>
</chapter>
<chapter id="ch2">
<title>chapter 2</title>
</chapter>
</chapters>

</book>

So everything is incorporated, not just the one chapter.

Please help me. What am I doing wrong ?


Sincerely yours,

Mick Baggen
Principal Consultant
  _____

Technolution B.V.
Telephone:       +31(0)182 59 40 00
Mobile:          +31(0) 6 1502 2992
Fax:     +31(0)182 53 97 36
E-mail:          mick baggen technolution nl
Visit us at:     www.technolution.nl <http://www.technolution.nl>
Mailing address:         P.O. Box 2013 - 2800 BD Gouda - The Netherlands
Address:         Zuidelijk Halfrond 1 - 2801 DD Gouda - The Netherlands
GPS:     N 52°.00'58,2" E 4°.41'05,2"
  _____

This e-mail is intended exclusively for the addressee(s), and may not be
passed on to, or made available for use by any person other than the
addressee(s). Technolution B.V. rules out any and every liability resulting
from any electronic transmission.






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