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 "Octavian Nadolu (JIRA)" <xe...@xml.apache.org> on 2013/12/18 15:24:09 UTC

[jira] [Created] (XERCESJ-1624) Element

Octavian Nadolu created XERCESJ-1624:
----------------------------------------

             Summary: Element
                 Key: XERCESJ-1624
                 URL: https://issues.apache.org/jira/browse/XERCESJ-1624
             Project: Xerces2-J
          Issue Type: Bug
          Components: XML Schema 1.1 Structures
    Affects Versions: 2.11.0
            Reporter: Octavian Nadolu


If I validate the following XML Schema, Xerces reports an error saying that the element "m:elemInclude" is in namespace "someOtherNS". Which is wrong, because the "elemInclude" is in namespace "targetNS". 
This is because of the namespace declaration (xmlns:m="someOtherNS") added on the "elemInclude" element declaration, which maps the "m" prefix to the "someOtherNS" namespace. This namespace declaration overrides the namespece declaration from the schema element (xmlns:m="targetNS"), but this should not affect the namespace of the "elemInclude" element.
I tested on the xml-schema-1.1-dev branch. 

---- XML Schema -------------
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema 
    elementFormDefault="qualified" 
    targetNamespace="targetNS" xmlns:m="targetNS" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
    
    <xs:element name="elemInclude" xmlns:m="someOtherNS">
        <xs:complexType>
            <xs:choice>
                <xs:element name="childInclude"/>
            </xs:choice>
        </xs:complexType>
    </xs:element>
    
    <xs:element name="root">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="m:elemInclude"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>
-----------------------------------



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

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