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
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