Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 07:09 AM
Michael Bane
Guest
 
Posts: n/a
Default xml schema: limitations on <redefine>?

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
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles