[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

redefine and target namespace

From: Florent Georges <lists@fgeorges.org>
Date: Sun, 25 Oct 2009 18:05:41 +0000 (GMT)
Message-ID: <313605.83399.qm@web23005.mail.ird.yahoo.com>
To: xmlschema-dev@w3.org
redefine and target namespace
  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/






















      
Received on Sunday, 25 October 2009 18:06:15 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.