Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


redefine and target namespace

From: Florent Georges <lists@--------.--->
To: xmlschema-dev@--.---
Date: 10/25/2009 6:08:00 PM
  Hi,

  I have a schema document that redefines a complex type as
following:

    <xs:redefine schemaLocation="redefine.xsd">
       <xs:complexType name="root">
          <xs:complexContent>
             <xs:extension base="tns:root">
                <xs:sequence>
                   <xs:element name="b" type="xs:string"/>
                </xs:sequence>
             </xs:extension>
          </xs:complexContent>
       </xs:complexType>
    </xs:redefine>

  I thought the element 'b' was defined in the target namespace,
but it seems it has to be in no namespace.  Is it really the
intent of the spec?  Did I do anything wrong?  I use Xerces 2 for
Java (as in Java SE 6.)

  redefine.xsd:

    <?xml version="1.0" encoding="UTF-8"?>

    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
               xmlns:tns="tns"
               targetNamespace="tns"
               elementFormDefault="qualified">

       <xs:element name="root" type="tns:root"/>

       <xs:complexType name="root">
          <xs:sequence>
             <xs:element name="a" type="xs:string"/>
          </xs:sequence>
       </xs:complexType>

    </xs:schema>

  redefine-red.xsd:

    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
               targetNamespace="tns"
               xmlns:tns="tns">

       <xs:redefine schemaLocation="redefine.xsd">
          <xs:complexType name="root">
             <xs:complexContent>
                <xs:extension base="tns:root">
                   <xs:sequence>
                      <xs:element name="b" type="xs:string"/>
                   </xs:sequence>
                </xs:extension>
             </xs:complexContent>
          </xs:complexType>
       </xs:redefine>

       <xs:element name="redefined" type="tns:root"/>

    </xs:schema>

  Valid redefine.xml:

    <tns:redefined xmlns:tns="tns">
       <tns:a>bla</tns:a>
       <b>bla</b>
    </tns:redefined>

  Expected valid redefine.xml (but actually invalid):

    <redefined xmlns="tns">
       <a>bla</a>
       <b>bla</b>
    </redefined>

  Regards,

-- 
Florent Georges
http://www.fgeorges.org/






















      




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent