• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What's wrong with this simpleType!

 
Himal Chuli
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i've the following schem where i've defined my own data type "simpleType". when i validate with XML Spy gives me the following error:
Schema error-undefined value for 'base' encountered
could anyone please explain me why?

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<xsd:simpleType name="str10">
<xsd:restriction base="sxd:string">
<xsd:minLength value="1"/>
<xsd:maxLength value="10"/>
</xsd:restriction>
</xsd:simpleType>

<xsd:element name="SONG" type="SongType"/>
<xsd:complexType name="SongType">
<xsd:sequence>
<xsd:element name="TITLE" type="str10"
minOccurs="1" maxOccurs="1"/>
<xsd:element name="ARTIST" type="PersonType"
minOccurs="1" maxOccurs="unbounded"/>
<xsd:element name="PRICE" type="str10"
maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
thanks.
himal
[ September 17, 2002: Message edited by: Himal Chuli ]
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sxd -> xsd
 
Jayadev Pulaparty
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also get rid of the error in following way
xmlns:xsd="http://www.w3.org/2001/XMLSchema
xmlns:sxd="http://www.w3.org/2001/XMLSchema
as the attributes for your top level <xsd:schema> element
 
Jayadev Pulaparty
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OOPS..... validator doesn't like this
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:aaa="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.test.org"
targetNamespace="http://www.test.org"
elementFormDefault="qualified">
Errors out saying that root element should be aaa:schema and not xsd:schema;
This means that if the same namespace is referred to with different prefixes (xsd, aaa), the last prefix will be respected. Not sure if i'm jumping to a conclusion here, but that seems to be happening
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic