OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Different Validation in XML Spy 4.2, 4.3 and 4.4

[ Lists Home | Date Index | Thread Index ]

Has anyone else come across problems with XML Spy 4.2, 4.3, and 4.4 such as
those described below?

Thanks,

Todd

=========================

I have attempted to validate the xml instance with the following schema
(below) in:

MSXML 4.0 (successfully)
MSXML 4.0 SP1 (successfully)
XML Spy 4.2 (successfully)
XML Spy 4.3 (*un*successfully)
XML Spy 4.4 (*un*successfully)

<snip/>

In any case, validation in the products above are inconsistent.  I have not
tried anything else.  I hope that XML Spy 4.3 and 4.4 simply have a bug, in
which case, I also hope the bug will be fixed in a future version.

Any help or advice would be appreciated.

Thanks,

Todd

======================

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="urn:a"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns="urn:a"
elementFormDefault="qualified">
 <xsd:complexType name="a" mixed="true">
  <xsd:choice>
   <xsd:group ref="g1" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:choice>
 </xsd:complexType>
 <xsd:group name="g1">
  <xsd:choice>
   <xsd:group ref="g2"/>
  </xsd:choice>
 </xsd:group>
 <xsd:group name="g2">
  <xsd:choice>
   <xsd:element ref="x" maxOccurs="unbounded"/>
   <xsd:element ref="y" maxOccurs="unbounded"/>
  </xsd:choice>
 </xsd:group>
 <xsd:element name="a" type="a"/>
 <xsd:element name="y" type="xsd:string"/>
 <xsd:element name="x" type="xsd:string"/>
</xsd:schema>

=======================================

<?xml version="1.0" encoding="UTF-8"?>
<a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns="urn:a"
xsi:schemaLocation="urn:a a2.xsd">
 <x>content</x>
 <y>content</y>
 content <y/>
 <y>content</y>content <y/>
 <y>content</y>content<y/>
 <y>content</y>
 <y/>
</a>

==========================================

Hi,

Matteo Garutti wrote:

> Hi !
> Let's take a look at the following example: we have a BaseLibrary schema
in
> which we have defined a complex type named "BaseType" which is a simple
> extension of xs:string; in another schema, FinalSchema.xsd, we have
defined
> 2 elements which derives by restriction from the "BaseType"; the first
> element "child_1" fixes the length to two chars, the second one "child_2"
> fixes the length to four chars. Eventually we created an XML document
based
> on FinalSchema.xsd, and we set the content of "child_1" and "child_2"
nodes
> according to their types as defined in the schema.
> Then, we have tried to validate this XML document using 4 different XML
> engines and, unfortunately, we got different results:
>
> (1) XML Spy 4.2                                         --> Ok, the
document
> is valid
> (2) Microsoft .NET ValidatingReader Object      --> Ok, the document is
> valid
> (2) XML Spy 4.3                                         --> Error, value
> does not macth facet length="4" in element dn:child_1
> (4) XML Spy 4.4                                 --> Error, value does not
> macth facet length="4" in element dn:child_1
>
> It seems that XML Spy (4.3 - 4.4) recognizes only the last restriction of
> the complex type "BaseType".
> It's somewhat stange that XML Spy changed its behaviour in its two last
> releases, isn't it ?
> Which is the right behaviour according to W3C standard ??

Your schema looks fine to me so I would suggest that a bug was introduced in
the
later versions of XML Spy.

Cheers,
/Eddie

[From the original email . . . ]

---------------
BaseLibrary.xsd
---------------
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="urn:BaseNamespace" xmlns:mq="urn:BaseNamespace"
xmlns:xs="http://www.w3.org/2001/XMLSchema"; elementFormDefault="qualified"
attributeFormDefault="qualified">
<xs:complexType name="BaseType">
<xs:simpleContent>
<xs:extension base="xs:string"/>
</xs:simpleContent>
</xs:complexType>
</xs:schema>

----------------
FinalSchema.xsd
----------------
<xs:schema targetNamespace="urn:DerivedNamespace"
xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:bn="urn:BaseNamespace"
elementFormDefault="qualified" attributeFormDefault="qualified">
<xs:import namespace="urn:BaseNamespace"
schemaLocation="BaseLibrary.xsd"/>
<xs:element name="root">
<xs:complexType>
<xs:sequence>
<xs:element name="parent">
<xs:complexType>
<xs:sequence>
<xs:element
name="child_1">

<xs:complexType>

<xs:simpleContent>

<xs:restriction base="bn:BaseType">

<xs:length value="2"/>

</xs:restriction>

</xs:simpleContent>

</xs:complexType>
</xs:element>
<xs:element
name="child_2">

<xs:complexType>

<xs:simpleContent>

<xs:restriction base="bn:BaseType">

<xs:length value="4"/>

</xs:restriction>

</xs:simpleContent>

</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

------------------
FinalDocument.xml
------------------
<dn:root xmlns:dn="urn:DerivedNamespace" xmlns:bn="urn:BaseNamespace"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="urn:DerivedNamespace FinalSchema.xsd">
<dn:parent>
<dn:child_1>12</dn:child_1>
<dn:child_2>1234</dn:child_2>
</dn:parent>
</dn:root>








 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS