validation error using xinclude in tei file
Oxygen general issues.
-
- Posts: 13
- Joined: Tue Mar 16, 2021 10:01 pm
validation error using xinclude in tei file
Hi,
I have a tei file with a long <encodingDesc> structured like the following example:
The file is validated using 'http://www.tei-c.org/release/xml/tei/cu ... ei_all.rng'
When I replace the encodingDesc with content from an external file using xi:include, the validation fails.
path/to/file.xml:
Validation error: 'element "encodingDesc" not allowed here; expected the element end-tag or element "encodingDesc", "profileDesc", "revisionDesc" or "xenoData"'
I have been able to include other elements succesfully using xi:include, the error so far only appears when I try to include the encodingDesc.
Any ideas why this happens?
Thanks in advance!
I have a tei file with a long <encodingDesc> structured like the following example:
Code: Select all
<?xml-model href="http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
<teiHeader>
<fileDesc>
<titleStmt>
<title type="main" xml:lang="en">Testfile</title>
</titleStmt>
<publicationStmt>
<p>Test</p>
</publicationStmt>
<sourceDesc>
<p>Testfile</p></sourceDesc>
</fileDesc>
<!-- encodingDesc to be replaced by xi:include -->
<encodingDesc>
<charDecl>
<char></char>
</charDecl>
</encodingDesc>
</teiHeader>
<text>
<body>
<p>Some text</p>
</body>
</text>
</TEI>
When I replace the encodingDesc with content from an external file using xi:include, the validation fails.
Code: Select all
<?xml-model href="http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
<teiHeader>
<fileDesc>
<titleStmt>
<title type="main" xml:lang="en">Testfile</title>
</titleStmt>
<publicationStmt>
<p>Test</p>
</publicationStmt>
<sourceDesc>
<p>Testfile</p></sourceDesc>
</fileDesc>
<!-- encodingDesc to be replaced by xi:include -->
<xi:include href="path/to/file.xml" xpointer="encodingDesc" xmlns:xi="http://www.w3.org/2001/XInclude"/>
</teiHeader>
<text>
<body>
<p>Some text</p>
</body>
</text>
</TEI>
path/to/file.xml:
Code: Select all
<encodingDesc xml:id="encodingDesc">
<charDecl>
<char></char>
</charDecl>
</encodingDesc>
I have been able to include other elements succesfully using xi:include, the error so far only appears when I try to include the encodingDesc.
Any ideas why this happens?
Thanks in advance!
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: validation error using xinclude in tei file
Hi,
You should add the namespace declaration xmlns="http://www.tei-c.org/ns/1.0" on the "encodingDesc" element defined in the separate file, otherwise when the xi:include is expanded it's considered to be in no namespace.
This is why the error is ambiguous, the element "encodingDesc" is allowed there but only if it has a certain TEI namespace.
Regards,
Radu
You should add the namespace declaration xmlns="http://www.tei-c.org/ns/1.0" on the "encodingDesc" element defined in the separate file, otherwise when the xi:include is expanded it's considered to be in no namespace.
This is why the error is ambiguous, the element "encodingDesc" is allowed there but only if it has a certain TEI namespace.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service