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


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xml-dev] XML Spy 4.0 Problems? - Not Validating Attributes Properly?

Has anyone experienced any validation problems with the new version of
XML Spy 4.0 (full version, not beta).
I have run into the problem that attributes are not validating properly.
Some Schemas that I have been working on have required attributes that
are not present in the XML Instance document and the XML Instance
document has some bogus attributes that are not represented in the
Schema.  Previously I have relied on using validition to discover these
discrepencies and hammer out the issues.  Now with XML Spy 4.0 I get a
message back stating that my XML is valid!  This cannot be as I know
that the XML Instance document is missing some required attributes and
has additional attributes not in the Schema.
This behavior seems even stranger as I created a few simple sample files
to test.  I created the following XML Schema with two required
attributes, one for the document root (Attribute1, required) and one for
Element2 (Attribute2, required).  I have found that if I validate the
following XML document against this schema in XML Spy 4.0 (see below the
Schema) it validates.  Clearly it is missing the Attribute1 attribute.
If I leave out the Attribute2 attribute it DOES NOT VALIDATE.  Finally,
if I place ANY attribute in my XML Instance document in place of the
Attribute 2 attribute it validates, even though it is named differently
than the Attribute2 attribute found in the Schema (plus it no longer has
to be boolean, I made the attribute named test="d" and it still
Has anyone else run into these problems with the latest build of XML
Spy?  Any one have any suggestions?


Brian Magick
Compaq Computer Corporation
XML Schema:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
       <xs:element name="Document">
                    <xs:documentation>Comment describing your root
                           <xs:element name="Element1"
                           <xs:element name="Element2">
name="Attribute2" type="xs:boolean" use="required"/>
                    <xs:attribute name="Attribute1" type="xs:string"
XML Instance Document:
<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XML Spy v4.0 U
<Document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       <Element2 Attribute2="1">String</Element2>