xmllint & dom.Writer

G

Geoff

Hello,

I have three files:

~~~~~~~~~
people.xml
~~~~~~~~~
<?xml version="1.0"?>
<people xmlns:xi="http://www.w3.org/2001/XInclude" >
<xi:include href="AlanTuring.xml"/>
<xi:include href="RichardPFeynman.xml"/>
</people>


~~~~~~~~~~~~~
AlanTuring.xml
~~~~~~~~~~~~~
<person born="1912" died="1954">
<name>
<first_name>Alan</first_name>
<last_name>Turing</last_name>
</name>
<profession>computer scientist</profession>
<profession>mathematician</profession>
<profession>cryptographer</profession>
</person>



~~~~~~~~~~~~~~~~~~
RichardPFeynman.xml
~~~~~~~~~~~~~~~~~~
<person born="1918" died="1988">
<name>
<first_name>Richard</first_name>
<middle_initial>P</middle_initial>
<last_name>Feynman</last_name>
</name>
<profession>physicist</profession>
<hobby>Playing the bongoes</hobby>
</person>


.. . . when I run xmllint on people.xml, I get (as expected):

C:\>xmllint --xinclude people.xml

<?xml version="1.0"?>
<people xmlns:xi="http://www.w3.org/2001/XInclude">
<person born="1912" died="1954">
<name>
<first_name>Alan</first_name>
<last_name>Turing</last_name>
</name>
<profession>computer scientist</profession>
<profession>mathematician</profession>
<profession>cryptographer</profession>
</person>
<person born="1918" died="1988">
<name>
<first_name>Richard</first_name>
<middle_initial>P</middle_initial>
<last_name>Feynman</last_name>
</name>
<profession>physicist</profession>
<hobby>Playing the bongoes</hobby>
</person>
</people>



.. . . when I run dom.Writer on people.xml, I get:

C:\>dom.Writer -xi -v -s people.xml

[Error] 12-1.xml:2:53: cvc-elt.1: Cannot find the declaration of element
'people'.
<?xml version="1.0" encoding="UTF-8"?>
<people xmlns:xi="http://www.w3.org/2001/XInclude">
<person born="1912" died="1954" xml:base="AlanTuring.xml">
<name>
<first_name>Alan</first_name>
<last_name>Turing</last_name>
</name>
<profession>computer scientist</profession>
<profession>mathematician</profession>
<profession>cryptographer</profession>
</person>
<person born="1918" died="1988" xml:base="RichardPFeynman.xml">
<name>
<first_name>Richard</first_name>
<middle_initial>P</middle_initial>
<last_name>Feynman</last_name>
</name>
<profession>physicist</profession>
<hobby>Playing the bongoes</hobby>
</person>
</people>


.. . . is there a reason why the dom writer would generate an error and
xmllint would not? The xml is well formed, what does the dom writer error
mean? It seems xmllint is checking for start and end tags, syntax, etc.
Dom writer is actually constructing the tree where people is the root
element(?) but it says it can not find that declaration.

Thanks.

-g
 
G

Geoff

I think I answered my own question, since there is no schema document to go
with it, it generates the error.

-g
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top