including xinclude
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 10
- Joined: Mon Mar 05, 2007 5:25 pm
- Location: Hamburg
including xinclude
Hi all,
Using oXygen 12.1.
I have, what I hope is, a simple problem/question. In the DTD declaration I would like to call my own driver file that adds a couple of things, including xinclude, to the "stock" DTD (DocBook XML 4.5). Like this...
<!DOCTYPE book SYSTEM "DTD/driver.dtd">
Here is my driver file...
<!-- DocBook 4.5 -->
<!ENTITY % docbook4.5 SYSTEM "docbook/xml/4.5/docbookx.dtd">
%docbook4.5;
<!-- DTD extensions -->
<!ENTITY % xinclude SYSTEM "docbook/xml/xinclude.mod">
%xinclude;
This works just fine for processing the document outside of oXygen. But, oXygen does not 'see' the xinclude information and complains that xi:include is an unexpected element.
It does work in oXygen if I declare it like this...
<!DOCTYPE book SYSTEM "DTD/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % xinclude SYSTEM "DTD/docbook/xml/xinclude.mod">
%xinclude;
]>
Is this an oXygen configuration/preferences thing? Any ideas?
Thanks in advance.
- Michael
Using oXygen 12.1.
I have, what I hope is, a simple problem/question. In the DTD declaration I would like to call my own driver file that adds a couple of things, including xinclude, to the "stock" DTD (DocBook XML 4.5). Like this...
<!DOCTYPE book SYSTEM "DTD/driver.dtd">
Here is my driver file...
<!-- DocBook 4.5 -->
<!ENTITY % docbook4.5 SYSTEM "docbook/xml/4.5/docbookx.dtd">
%docbook4.5;
<!-- DTD extensions -->
<!ENTITY % xinclude SYSTEM "docbook/xml/xinclude.mod">
%xinclude;
This works just fine for processing the document outside of oXygen. But, oXygen does not 'see' the xinclude information and complains that xi:include is an unexpected element.
It does work in oXygen if I declare it like this...
<!DOCTYPE book SYSTEM "DTD/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % xinclude SYSTEM "DTD/docbook/xml/xinclude.mod">
%xinclude;
]>
Is this an oXygen configuration/preferences thing? Any ideas?
Thanks in advance.
- Michael
-- Michael
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: including xinclude
Hello,
In the driver.dtd you should put the XInclude extension before the Docbook DTD:
This is necessary because the Docbook DTDs use the entities declared in the xinclude.mod, so they have to be declared beforehand.
Regards,
Adrian
In the driver.dtd you should put the XInclude extension before the Docbook DTD:
Code: Select all
<!-- DTD extensions -->
<!ENTITY % xinclude SYSTEM "docbook/xml/xinclude.mod">
%xinclude;
<!-- DocBook 4.5 -->
<!ENTITY % docbook4.5 SYSTEM "docbook/xml/4.5/docbookx.dtd">
%docbook4.5;
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 10
- Joined: Mon Mar 05, 2007 5:25 pm
- Location: Hamburg
Re: including xinclude
Hi Adrian,
Thank you for your answer! It works now, but that order is counter intuitive (to me, anyway). Does that mean that the stuff one adds between the [] brackets in the DTD declaration is read/processed first, before the specified DTD file?
(Excuse my demonstrating a complete lack of knowledge here.
)
Thank you for your answer! It works now, but that order is counter intuitive (to me, anyway). Does that mean that the stuff one adds between the [] brackets in the DTD declaration is read/processed first, before the specified DTD file?
(Excuse my demonstrating a complete lack of knowledge here.

-- Michael
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Re: including xinclude
I think a better model is to think of that as the internal subset overwrites entities that are declared/used in the external subset.
Basically the specification does not restricts the order in which a processor reads the DTDs/internal subset, it cares only about the end result.
Best Regards,
George
Basically the specification does not restricts the order in which a processor reads the DTDs/internal subset, it cares only about the end result.
Best Regards,
George
George Cristian Bina
-
- Posts: 10
- Joined: Mon Mar 05, 2007 5:25 pm
- Location: Hamburg
Re: including xinclude
George,
Using the vocabulary external and internal helped. So, if I understand, by putting everything external, that would make the order important.
Many thanks for your help.
Using the vocabulary external and internal helped. So, if I understand, by putting everything external, that would make the order important.
Many thanks for your help.
-- Michael
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Re: including xinclude
The first occurrence of an entity wins but the internal subset gets a chance to modify anything from the external DTDs.
Most of the redefine techniques work this way, that is by placing the redefinitions inside the reference to the content to be redefined. See for example the xsd:redefine from XML Schema. Also in Relax NG if you use an include and refer to a schema, all the patterns placed inside that include (as children of the include element) redefine the ones from the included schema.
Best Regards,
George
Most of the redefine techniques work this way, that is by placing the redefinitions inside the reference to the content to be redefined. See for example the xsd:redefine from XML Schema. Also in Relax NG if you use an include and refer to a schema, all the patterns placed inside that include (as children of the include element) redefine the ones from the included schema.
Best Regards,
George
George Cristian Bina
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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