Page 1 of 1

xinclude validation error

Posted: Fri Feb 19, 2016 6:21 pm
by duncdrum
I have 51 tei documents with dictionary entries.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0" xml:lang="en">
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="/../tei_header.xml" parse="xml"/>
<text>
<body>
<entry/><!-- Lots of entries -->
</body>
</text>
</TEI>


I have a separate header file:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<teiHeader xmlns="http://www.tei-c.org/ns/1.0" xml:lang="en">
<fileDesc/><!-- Stuff here -->
</teiHeader>


yet i keep getting validation error:
element "xi:include" not allowed here; expected the element end-tag or element "facsimile", "fsdDecl", "sourceDoc", "teiHeader" or "text"

xincludes are activated in Preferences->XML / XML Parser
Master files is enabled, and the header file is it.

When manually replace the xinclude element with a copy of the contents of tei_header.xml everything validates fine.
What am i missing

Re: xinclude validation error

Posted: Mon Feb 22, 2016 9:52 am
by Radu
Hi,

The xi prefix should be bound to the namespace http://www.w3.org/2001/XInclude:

https://www.w3.org/TR/xinclude/

so this should work:

Code: Select all

<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="tei_header.xml" parse="xml"/>


Regards,
Radu

Re: xinclude validation error

Posted: Mon Feb 22, 2016 1:40 pm
by duncdrum
2001 does the trick, no clue how i messed this up, Thanks for the help