Hi!
I have an XmlSchema, very simple.
<xs:schema xmlns:xs=" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns:gib="<xs:element name="eigenshaftenElement">
<xs:complexType>
<xs:attribute name="attr1" gib:name="Prozessor" gib:description="Central Processing Unit Processor" use="required" gib:schemaType="variant" gib
rder="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="AMD2" gib:description="AMD Celeron +220"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="attr3" gib:name="Festplattegroesse" gib:description="Size of the hard disk" use="required" gib:schemaType="variant" gib
rder="3" type="xs:integer"/>
</xs:complexType>
</xs:element>
</xs:schema>
This schema is loaded and stored in XMLSchemaCache instance.
Then I load a very, very simple document (objXml),
using a FreeThreadedDOMDocument40 (named objDoc) instance.
objXml is
<gibxd:eigenshaftenElement xmlns:gibxd="gibxd"/>
Then I assign to the objDoc.schemas the above XMLSchemaCache.
Then I call objDoc.validate
The following error message occurs:
"Required attribute 'gibxd:attr1' is missing."
which is correct.
I fill the gibxd:attr1 and results the
following objXml
<gibxd:eigenshaftenElement xmlns:gibxd="gibxd" gibxd:attr1="AMD2"/>
I call again the objDoc.validate
The following error occurs:
"The attribute 'attr1' on this element is not defined in the DTD/Schema."
Could anyone explain me, why?
Thanks,
Radu Mirescu (programmer)
I have an XmlSchema, very simple.
<xs:schema xmlns:xs=" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns:gib="<xs:element name="eigenshaftenElement">
<xs:complexType>
<xs:attribute name="attr1" gib:name="Prozessor" gib:description="Central Processing Unit Processor" use="required" gib:schemaType="variant" gib
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="AMD2" gib:description="AMD Celeron +220"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="attr3" gib:name="Festplattegroesse" gib:description="Size of the hard disk" use="required" gib:schemaType="variant" gib
</xs:complexType>
</xs:element>
</xs:schema>
This schema is loaded and stored in XMLSchemaCache instance.
Then I load a very, very simple document (objXml),
using a FreeThreadedDOMDocument40 (named objDoc) instance.
objXml is
<gibxd:eigenshaftenElement xmlns:gibxd="gibxd"/>
Then I assign to the objDoc.schemas the above XMLSchemaCache.
Then I call objDoc.validate
The following error message occurs:
"Required attribute 'gibxd:attr1' is missing."
which is correct.
I fill the gibxd:attr1 and results the
following objXml
<gibxd:eigenshaftenElement xmlns:gibxd="gibxd" gibxd:attr1="AMD2"/>
I call again the objDoc.validate
The following error occurs:
"The attribute 'attr1' on this element is not defined in the DTD/Schema."
Could anyone explain me, why?
Thanks,
Radu Mirescu (programmer)