Element content type and optional attributes

Hi,
 
I've created the following schema to validate the
element content. I also added an optional attribute.
 
<?xml version="1.0"?>
 
<schema xmlns="http://www.w3.org/1999/XMLSchema">
    <element name="module">
        <complexType>
            <element name="P" minOccurs="1"
maxOccurs="unbounded">
                <complexType content="textOnly"
base="boolean">
                    <attribute name="value"
type="string" use="optional"/>
                </complexType>
            </element>
        </complexType>
    </element>
</schema>
 
 
When checking the schema with XML Spy 3.0 everything
is ok. If I validate the following document against
the previous schema, there isn't any problem either.
 
 
<?xml version="1.0" encoding="UTF-8"?>
 
<module
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="module.xsd">
    <P value="1.5">1</P>
</module>
 
 
However, when I remove the attribute form the P
element, the parser indicates that no text is allowed
inside that element. I would like to know if it isn't
really allowed to add text to the P element or it is
just the XML Spy application which does not support
that feature.
 
I also used XSV to validate the schema and it
contained no errors. I wonder if there is a similar
tool to validate XML documents against their
corresponding schema.
 
 
Kind regards,
 
David Vazquez


_________________________________________________________
Do You Yahoo!?
Obtenga su dirección de correo-e gratis @yahoo.com
en http://correo.espanol.yahoo.com

Received on Thursday, 3 August 2000 11:11:31 UTC