IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

XMLSpy dos not vallidate restricted types Options · View
jvieille
Posted: Tuesday, December 29, 2009 8:53:29 AM
Rank: Newbie

Joined: 12/28/2009
Posts: 1
I was fighting for one day with this issue, before I realize it could be an XMLSpy problem.

I wish to restrict a type from another namespace defined in an external schema.

Schema of the base type

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.controlchainmanagement.org/Lean8895-ULO" targetNamespace="http://www.controlchainmanagement.org/Lean8895-ULO" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xsd:complexType name="basetype">
<xsd:sequence>
<xsd:element name="el1" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>


Schema of the restricted type (not yet restricted)

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ulo="http://www.controlchainmanagement.org/Lean8895-ULO"
xmlns="http://www.controlchainmanagement.org/Lean8895-ULO/ISA-95"
targetNamespace="http://www.controlchainmanagement.org/Lean8895-ULO/ISA-95"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xsd:import namespace="http://www.controlchainmanagement.org/Lean8895-ULO" schemaLocation="Lean8895-ULO_draft01.xsd"/>
<xsd:complexType name="derivedtype">
<xsd:complexContent>
<xsd:restriction base="ulo:basetype">
<xsd:sequence>
<xsd:element name="el1" type="xsd:string"/>
</xsd:sequence>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>

This validate without any problem using W3C xsv
XMLSpy complains:
File E:\2-CCM\D-8895ULO\XMLSchema\Lean8895-ISA-95_draft01.xsd is not valid.
Type 'derivedtype' is not a valid restriction of type 'basetype'. (see Details)
Error location: xsd:schema / xsd:complexType / xsd:complexContent / xsd:restriction / @base
Details
rcase-NameAndTypeOK.1: The declarations' {name}s and {target namespace}s are not the same: restriction element is <xsd:element name="el1"> and base element is <xsd:element name="el1">.
rcase-Recurse.2.2: Mandatory <xsd:element name="el1"> is missing in the <sequence>.
derivation-ok-restriction.5.4: The content type <xsd:sequence> is not a valid restriction of content type <xsd:sequence>.


Any idea or help to make XMLSpy happy?

Thanks
island
Posted: Tuesday, December 29, 2009 2:02:52 PM
Rank: Newbie

Joined: 10/28/2002
Posts: 1,283
Location: AT
Hi,

just set "elementformdefault" to "unqualfied" in both schemas.
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.