xml schema: limitations on <redefine>?

M

Michael Bane

Am I right in thinking that...

1) in <redefine> I can either extend OR restrict a type but not both?

2) in <redefine> it's not possible to change a type from say
<xs:string> to <xs:integer>?

3) if I have schema1.xsd with

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
targetNamespace="http://www.cs.man.ac.uk/cnc/schema/gcf"
xmlns="http://www.cs.man.ac.uk/cnc/schema/gcf"
attributeFormDefault="unqualified">
<xs:complexType name="pname">
<xs:sequence>
<xs:element name="first" type="xs:integer" />
<xs:element name="last" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="customer" type="pname" />
</xs:schema>

and then schema2.xsd redefines 'pname' viz:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
targetNamespace="http://www.cs.man.ac.uk/cnc/schema/gcf"
xmlns="http://www.cs.man.ac.uk/cnc/schema/gcf"
attributeFormDefault="unqualified">

<xs:redefine schemaLocation="redefined.xsd">
<xs:complexType name="pname">
<xs:complexContent>
<xs:extension base="pname">
<xs:sequence>
<xs:element name="country" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:redefine>

<xs:element name="author" type="pname" />
</xs:schema>

am I right in thinking that type 'pname' then has three child
elements, 'first', 'last' and 'country'? and therefore that 'author'
has these 3 fields? In which case, why does XMLspy (version 4.4) only
show 'author' with the original 2 fields? Is there a free equilavent
to XMLspy (particularly for graphical representation of schema)?

Many thanks!
Michael Bane
http://www.cs.man.ac.uk/~bane
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top