Is it possible to override something defined as xsd: element?

I need to expand an element in an XSD schema. In the original circuit, an element is defined as:

   <xsd:element name="RemarkText">
      <xsd:complexType>
         <xsd:simpleContent>
            <xsd:extension base="C-Infinite">
               <xsd:attribute name="IdRef" type="IDREF" use="required"/>
            </xsd:extension>
         </xsd:simpleContent>
      </xsd:complexType>
   </xsd:element>

All the examples that seem to me regarding extensions seem to be related to extension types. If it was originally defined as:

      <xsd:complexType name="RemarkText_Type">
         <xsd:simpleContent>
            <xsd:extension base="C-Infinite">
               <xsd:attribute name="IdRef" type="IDREF" use="required"/>
            </xsd:extension>
         </xsd:simpleContent>
      </xsd:complexType>
      <xsd:element name="RemarkText" type="RemarkText_Type"/>

Then, I think, I would know what to do.

But is it possible to expand an element, not a type?

+1
source share
2 answers

The redefine tag can only be used with group, attributeGroup, complexType, and simpleType. It cannot be used on an element.

. , . , xml xs: type, type.

alt text http://www.liquid-technologies.com/images/blogs/stackoverflow/redefine.png

<?xml version="1.0" encoding="utf-8" ?>
<!--Created with Liquid XML Studio - Developer Pro Edition 7.1.1.1206 (http://www.liquid-technologies.com)-->
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:complexType name="NameType">
    <xs:sequence>
      <xs:element name="FirstName" type="xs:string" />
      <xs:element name="Surname" type="xs:string" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="NameExType">
    <xs:complexContent mixed="false">
      <xs:extension base="NameType">
        <xs:sequence>
          <xs:element name="MiddleName" type="xs:string" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="MyName" type="NameType" />
</xs:schema>

XML xsi: type = "NameExType", NameExType.

<?xml version="1.0" encoding="utf-8"?>
<!-- Created with Liquid XML Studio - Developer Pro Edition 7.1.1.1206 (http://www.liquid-technologies.com) -->
<MyName xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xsi:type="NameExType">
    <FirstName>string</FirstName>
    <Surname>string</Surname>
    <MiddleName></MiddleName>
</MyName>

, Liquid XML Studio, .

+5

"" , . , , .

0

All Articles