Page 1 of 1

Standard XInclude Support

Posted: Fri Mar 04, 2005 3:01 am
by jenniferz
Hello. I'm building a DocBook project, and using XInclude to break up the source into modules (following Bob Stayton's example at http://www.sagehill.net/docbookxsl/ModularDoc.html). I can validate my project with libxml2 using the command "xmllint --noout --xinclude --postvalid --noent SA-XInclude.xml".

However, when I import the project into Oxygen, it fails validation with the error "Element type "xi:include" must be declared". I see from Oxygen's template examples that XInclude support is implemented via an entity declaration that points to "xinclude.mod", a component bundled with Oxygen. If I add that entity declaration and enable XInclude processing in the Prefs, my project validates.

The problem is that my project must be machine-agnostic; that is, it must validate on any machine, not just machines where Oxygen is installed. Does Oxygen only support an application-specific implementation of XInclude? Is it possible to implement validation within Oxygen using libxml2?

Thanks for your help.


Jennifer.

Posted: Fri Mar 04, 2005 6:02 pm
by george
Hi Jennifer,

The libxml makes a preprocessing when you use the --xinclude option and replaces the xi:include with the actual content. oXygen uses Xerces for performing validation and this preprocessing step is not performed so the DTD must be customized to allow xi:include element. All these are also described at

http://www.sagehill.net/docbookxsl/Xinclude.html

Using Xerces-J to validate XIncludes
The file must also validate before the XIncludes are resolved, which means the xi:include element must be in the DTD. See the section “DTD customizations for XIncludes” for more information.

and follow to
http://www.sagehill.net/docbookxsl/Vali ... includeDTD
which is almost the same customization that oXygen adds.

Hope that helps,
George

Posted: Fri Mar 04, 2005 10:16 pm
by jenniferz
george wrote:The libxml makes a preprocessing when you use the --xinclude option and replaces the xi:include with the actual content. oXygen uses Xerces for performing validation
Is there any intention to enhance Oxygen to allow users to configure their own validation mechanism?

Thanks again for your help, George.


jen.

Posted: Mon Mar 07, 2005 12:35 pm
by george
Hi Jennifer,

You may use the external tool support to configure a validation with a different engine if you want. Basically there you specify a command line and you can use a few macros (there are 11 such macros currently) to dynamically express some parts of that command line. To refer to the current file you can use ${cf}.

Best Regards,
George