[oXygen-user] XML Schema & XInclude ?

George Cristian Bina
Tue Jul 17 15:13:08 CDT 2007

Dear Timothy,

oXygen has an option "Enable XInclude processing" that I believe is 
enabled by default.
When that is enables the validation against XML Schema is performed 
after XInclude processing, that means the XML Schema should not care 
about defining the xi:include element but it should take into account 
that the included fragment will have an xml:base attribute pointing to 
the location it was included from and probably also an xml:lang. So for 
instance if you want to have scope elements inside scopes and you plan 
to include scope elements from other documents using XInclude then you 
should define xml:base (and xml:lang) to be allowed in the scope element.

When the XInclude processing is not enabled then oXygen will validate 
the document as it is against the specified XML Schema. In that case you 
need to refer to the xi:include element inside the schema, as in your 
sample. The problem in your case is the wrong namespace that you used in 
import, the correct nemespace is http://www.w3.org/2001/XInclude, that 
is not with 2003.

Best Regards,
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger

Timothy Reaves wrote:
> On Tue, July 17, 2007 10:19, Timothy Reaves wrote:
>> I have an xml schema I've created.  I'd like to have several XML
>> documents that are combined into a larger one (I do this with DocBook &
>> chapters).  But I can't figure out how to do this with XMLSchema.
>> Basically what I have is one xml document per environment (it's for
>> configuration information).  I'd like to have a parent document that has
>> elements from the schema that are generic to the overall base, then
>> includes the several smaller environment xml documents.  Any ideas?
>> Thanks!
> I believe I have this with
> <xs:import
>   namespace="http://www.w3.org/2003/XInclude"
>   schemaLocation="xinclude.xsd"/>
> in my xsd file, and then I have an element
> <xs:element name="scopes">
>   <xs:complexType>
>     <xs:sequence>
>       <xs:element ref="xi:include" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:element>
> but oXygen fails to validate this line
> <xs:element ref="xi:include" minOccurs="0"/>
> with the error
> SystemID:
> D:\dev\workspace\JDISoarianInstallerJava\src\resources\deployment.xsd
> Location: 70:24
> Description: src-resolve.4.2: Error resolving component 'xi:include'. It
> was detected that 'xi:include' is in namespace
> 'http://www.w3.org/2001/XInclude', but components from this namespace are
> not referenceable from schema document
> 'file:/D:/dev/workspace/JDISoarianInstallerJava/src/resources/deployment.xsd'.
> If this is the incorrect namespace, perhaps the prefix of 'xi:include'
> needs to be changed. If this is the correct namespace, then an appropriate
> 'import' tag should be added to
> 'file:/D:/dev/workspace/JDISoarianInstallerJava/src/resources/deployment.xsd'.
> URL: http://www.w3.org/TR/xmlschema-1/#src-resolve
> _______________________________________________
> oXygen-user mailing list
> http://www.oxygenxml.com/mailman/listinfo/oxygen-user

More information about the oXygen-user mailing list