Hi team,
I have done some more testing on the same code base (since my last
mail), and following are the findings.
xs:assert (0-n) as children of xs:extension or xs:restriction also works fine.
I need to modify SimpleType traverser as well, to cater to xs:assert
elements in Simple types also. I am now working on this.
I could add messages in XMLSchemaMessages.properties as well, to have
friendly error messages.
I am also attaching the test case XML and XSD files I used, for your
information. I hope that small attachments are allowed ...
Hoping to share further information quite soon.
--
Regards,
Mukul Gandhi
<?xml version="1.0"?>
<PEOPLE xsi:noNamespaceSchemaLocation="people.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<PERSON>
<FNAME>Mukul</FNAME>
<LNAME>Gandhi</LNAME>
<DOB>1992-01-02</DOB>
</PERSON>
<PERSON>
<FNAME>abc</FNAME>
<LNAME>pqr</LNAME>
<DOB>1992-01-02</DOB>
<NATIONALITY>IR</NATIONALITY>
</PERSON>
<PERSON>
<X>abc</X>
</PERSON>
</PEOPLE>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="PEOPLE">
<xs:complexType>
<xs:sequence>
<xs:element name="PERSON" type="PersonType" />
<xs:element name="PERSON">
<xs:complexType>
<xs:complexContent>
<xs:extension base="PersonType">
<xs:sequence>
<xs:element name="NATIONALITY" type="xs:string" />
</xs:sequence>
<xs:assert test="abc" />
<xs:assert test="pqr" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="PERSON">
<xs:complexType>
<xs:complexContent>
<xs:restriction base="PersonType">
<xs:sequence>
<xs:element name="X" type="xs:string" />
</xs:sequence>
<xs:assert test="ijk" />
<xs:assert test="ijk1" />
<xs:assert test="ijk2" />
</xs:restriction>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="PersonType">
<xs:sequence>
<xs:element name="FNAME" type="xs:string" />
<xs:element name="LNAME" type="xs:string" />
<xs:element name="DOB" type="xs:date" />
</xs:sequence>
<xs:assert test="count(./*) = 3" />
<xs:assert test="xx" />
<xs:assert test="yy" />
<xs:assert test="zz" />
</xs:complexType>
</xs:schema>---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]