[oXygen-user] Abstract elements and substitution groups

George Cristian Bina
Wed Jan 19 03:04:22 CST 2011


Hi Jesse,

It seems to be a limitation in Saxon-EE, it does not read 
xsi:schemaLocation information from the inner element. The XML Schema 
specification says that the xsi:schemaLocation can appear anywhere in 
the document, see point 4 from
http://www.w3.org/TR/xmlschema-1/#schema-loc
***
4.
xsi:schemaLocation and xsi:noNamespaceSchemaLocation [attributes] can 
occur on any element. However, it is an error if such an attribute 
occurs after the first appearance of an element or attribute information 
item within an element information item initially ·validated· whose 
[namespace name] it addresses. According to the rules of Layer 1: 
Summary of the Schema-validity Assessment Core (§4.1), the corresponding 
schema may be lazily assembled, but is otherwise stable throughout 
·assessment·. Although schema location attributes can occur on any 
element, and can be processed incrementally as discovered, their effect 
is essentially global to the ·assessment·. Definitions and declarations 
remain in effect beyond the scope of the element on which the binding is 
declared.
***

A solution is to move the schema location information to the root 
element, like:

<?xml version="1.0" encoding="UTF-8"?>
<testRoot xmlns             ="testRoot"
           xmlns:xsi         ="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="testRoot testRoot.xsd testConcrete 
testConcrete.xsd">
   <testChild xmlns="testConcrete">
     <data>some stuff</data>
   </testChild>
</testRoot>

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

On 1/18/11 8:55 PM, Jesse Pelton wrote:
> Years ago, I set up a collection of schemas that use abstract elements
> and substitution groups to allow different models for certain elements.
> I just noticed that instance documents that use these schemas have
> always validated with the default processor (Xerces), and they appear to
> validate with MSXML 4.0, they don't validate with Saxon-EE or MSXML.NET.
> XML is a small part of what I do, so I'm not confident that my
> interpretation of the spec is correct.  I've attached a test case that
> replicates the behavior I'm seeing in a minimal package.  I'd appreciate
> it if someone could look it over and tell me who's right.
>
> I think the documents explain themselves, but I'm happy to provide more
> information about anything that's not clear.
>
>
>
> _______________________________________________
> oXygen-user mailing list
> 
> http://www.oxygenxml.com/mailman/listinfo/oxygen-user



More information about the oXygen-user mailing list