You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by George Cristian Bina <ge...@sync.ro> on 2005/07/21 20:30:12 UTC

Xinclude with XML Schema versus XInclude with DTD

Hi,

Here are a couple of thinks I noticed with the Xerces XInclude support 
wrt validation.

Let's assume a simple scenario, one document main.xml that includes a 
document fragment.xml.

If we run a validation without setting the schema feature and both 
main.xml and fragment.xml specify a DTD then
* main.xml is validated against its DTD. let that be main.dtd
* fragment.xml is validated against its DTD, let that be fragment.dtd

If we run a validation and specify the schema feature and both main.xml 
and fragment.xml specify an XML schema then
* the content of main.xml with xi:include replaced with the content of 
fragment.xml is validated against the XML Schema specified in main.xml, 
let that be main.xsd
* fragment.xml is *not* validated against its schema, let that be 
fragment.xml

If we set the schema feature to true and both documents specify a DTD then:

* main.xml is validated against main.dtd
* fragment.xml is *not* validated

To summarize, there is a totally different behavior of the validate 
action when XInclude is enabled, for XML Schema the validation is done 
on the master file with XInclude instructions resolved while for DTD the 
validation is performed on each document without expanding the XInclude 
instructions.

More problematic however seems the case when the schema feature is set 
to true and the documents specify DTDs. In this case the main document 
with Xinclude instructions not expanded is validated against the DTD but 
in the XInclude handler the validation is turned off, thus the included 
documents are not validated at all. In this case the XInclude handler I 
think should at least behave in a similar way as the main pipeline, that 
is it should validate the included document against its DTD.

Any insights on these will be appreciated.
Are there any chances for fixing at least this last part in 2.7.1?
Let me know if I should file a bug on Jira.

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org