By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,200 Members | 1,629 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,200 IT Pros & Developers. It's quick & easy.

xml schema: limitations on <redefine>?

P: n/a
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
Jul 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.