xsd's "choice" construct parsing + tests

parser is case sensitive  b default now, + tests

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1942 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
inoussa
2011-09-14 02:31:02 +00:00
parent b0272c01fd
commit fc1c449cd2
20 changed files with 1181 additions and 44 deletions

View File

@ -0,0 +1,40 @@
<?xml version="1.0"?>
<definitions name="wst_test"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="urn:wst-test"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
targetNamespace="urn:wst-test">
<types>
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:wst-test">
<xsd:simpleType name="String">
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
<xsd:simpleType name="Date">
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
<xsd:simpleType name="Boolean">
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
<xsd:complexType name="TClassSampleType">
<xsd:sequence>
<xsd:element name="dateField" type="xsd:date" />
<xsd:element name="localDateField" type="n:Date" minOccurs="1" maxOccurs="1" />
<xsd:element name="booleanField" type="xsd:boolean" />
<xsd:element name="localBooleanField" type="n:Boolean" minOccurs="1" maxOccurs="1" />
<xsd:element name="stringField" type="xsd:string" />
<xsd:element name="localStringField" type="n:String" />
</xsd:sequence>
<xsd:attribute name="dateAtt" type="xsd:date" />
<xsd:attribute name="localDateAtt" type="n:Date" />
</xsd:complexType>
</xsd:schema>
</types>
</definitions>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:n="urn:wst-test"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:wst-test">
<xsd:simpleType name="String">
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
<xsd:simpleType name="Date">
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
<xsd:simpleType name="Boolean">
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
<xsd:complexType name="TClassSampleType">
<xsd:sequence>
<xsd:element name="dateField" type="xsd:date" />
<xsd:element name="localDateField" type="n:Date" minOccurs="1" maxOccurs="1" />
<xsd:element name="booleanField" type="xsd:boolean" />
<xsd:element name="localBooleanField" type="n:Boolean" minOccurs="1" maxOccurs="1" />
<xsd:element name="stringField" type="xsd:string" />
<xsd:element name="localStringField" type="n:String" />
</xsd:sequence>
<xsd:attribute name="dateAtt" type="xsd:date" />
<xsd:attribute name="localDateAtt" type="n:Date" />
</xsd:complexType>
</xsd:schema>

View File

@ -0,0 +1,32 @@
<?xml version="1.0"?>
<definitions name="wst_test"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="urn:wst-test"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
targetNamespace="urn:wst-test">
<types>
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:wst-test">
<xsd:simpleType name="SampleType">
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
<xsd:simpleType name="SAMPLETYPE">
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
<xsd:complexType name="TClassSampleType">
<xsd:sequence>
<xsd:element name="Field1" type="n:SampleType" />
<xsd:element name="Field2" type="n:SAMPLETYPE" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</types>
</definitions>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:n="urn:wst-test"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:wst-test">
<xsd:simpleType name="SampleType">
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
<xsd:simpleType name="SAMPLETYPE">
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
<xsd:complexType name="TClassSampleType">
<xsd:sequence>
<xsd:element name="Field1" type="n:SampleType" />
<xsd:element name="Field2" type="n:SAMPLETYPE" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>

View File

@ -0,0 +1,42 @@
<?xml version="1.0"?>
<definitions name="wst_test"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="urn:wst-test3"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
targetNamespace="urn:wst-test3">
<types>
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:s="urn:wst-test"
targetNamespace="urn:wst-test3">
<xsd:import
namespace = "urn:wst-test"
schemaLocation = "case_sensitive2.xsd"
/>
<xsd:simpleType name="TypeA">
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
<xsd:simpleType name="TYPEA">
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
<xsd:complexType name="CompoundType">
<xsd:sequence>
<xsd:element name="f1" type="s:SampleType" />
<xsd:element name="f2" type="s:SAMPLETYPE" />
<xsd:element name="f3" type="n:TypeA" />
<xsd:element name="f4" type="n:TYPEA" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</types>
</definitions>

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:n="urn:wst-test"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:s="urn:wst-test"
targetNamespace="urn:wst-test3">
<xsd:import
namespace = "urn:wst-test"
schemaLocation = "case_sensitive2.xsd"
/>
<xsd:simpleType name="TypeA">
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
<xsd:simpleType name="TYPEA">
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
<xsd:complexType name="CompoundType">
<xsd:sequence>
<xsd:element name="f1" type="s:SampleType" />
<xsd:element name="f2" type="s:SAMPLETYPE" />
<xsd:element name="f3" type="n:TypeA" />
<xsd:element name="f4" type="n:TYPEA" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>

View File

@ -0,0 +1,27 @@
<?xml version="1.0"?>
<definitions name="wst_test"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="library1"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
targetNamespace="urn:wst-test">
<types>
<xsd:schema xmlns:n="urn:wst-test"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:wst-test">
<xsd:complexType name="TSampleType1">
<xsd:choice>
<xsd:element name="intField" type="xsd:int" />
<xsd:element name="strField" type="xsd:string" minOccurs="1" maxOccurs="1"/>
</xsd:choice>
</xsd:complexType>
</xsd:schema>
</types>
</definitions>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:n="urn:wst-test"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:wst-test">
<xsd:complexType name="TSampleType1">
<xsd:choice>
<xsd:element name="intField" type="xsd:int" />
<xsd:element name="strField" type="xsd:string" minOccurs="1" maxOccurs="1"/>
</xsd:choice>
</xsd:complexType>
</xsd:schema>

View File

@ -0,0 +1,27 @@
<?xml version="1.0"?>
<definitions name="wst_test"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="library1"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
targetNamespace="urn:wst-test">
<types>
<xsd:schema xmlns:n="urn:wst-test"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:wst-test">
<xsd:complexType name="TSampleType1">
<xsd:choice maxOccurs="unbounded">
<xsd:element name="intField" type="xsd:int" />
<xsd:element name="strField" type="xsd:string" minOccurs="1" maxOccurs="1"/>
</xsd:choice>
</xsd:complexType>
</xsd:schema>
</types>
</definitions>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:n="urn:wst-test"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:wst-test">
<xsd:complexType name="TSampleType1">
<xsd:choice maxOccurs="unbounded">
<xsd:element name="intField" type="xsd:int" />
<xsd:element name="strField" type="xsd:string" minOccurs="1" maxOccurs="1"/>
</xsd:choice>
</xsd:complexType>
</xsd:schema>

View File

@ -0,0 +1,31 @@
<?xml version="1.0"?>
<definitions name="wst_test"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="library1"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
targetNamespace="urn:wst-test">
<types>
<xsd:schema xmlns:n="urn:wst-test"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:wst-test">
<xsd:complexType name="TSampleType1">
<xsd:sequence>
<xsd:element name="intField1" type="xsd:int" />
<xsd:choice>
<xsd:element name="intField" type="xsd:int" />
<xsd:element name="strField" type="xsd:string" minOccurs="1" maxOccurs="1"/>
</xsd:choice>
<xsd:element name="dateField" type="xsd:date" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</types>
</definitions>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:n="urn:wst-test"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:wst-test">
<xsd:complexType name="TSampleType1">
<xsd:sequence>
<xsd:element name="intField1" type="xsd:int" />
<xsd:choice>
<xsd:element name="intField" type="xsd:int" />
<xsd:element name="strField" type="xsd:string" minOccurs="1" maxOccurs="1"/>
</xsd:choice>
<xsd:element name="dateField" type="xsd:date" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>

View File

@ -0,0 +1,31 @@
<?xml version="1.0"?>
<definitions name="wst_test"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="library1"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
targetNamespace="urn:wst-test">
<types>
<xsd:schema xmlns:n="urn:wst-test"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:wst-test">
<xsd:complexType name="TSampleType1">
<xsd:sequence>
<xsd:choice>
<xsd:element name="intField" type="xsd:int" />
<xsd:element name="strField" type="xsd:string" minOccurs="1" maxOccurs="1"/>
</xsd:choice>
<xsd:element name="intField1" type="xsd:int" />
<xsd:element name="dateField" type="xsd:date" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</types>
</definitions>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:n="urn:wst-test"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:wst-test">
<xsd:complexType name="TSampleType1">
<xsd:sequence>
<xsd:choice>
<xsd:element name="intField" type="xsd:int" />
<xsd:element name="strField" type="xsd:string" minOccurs="1" maxOccurs="1"/>
</xsd:choice>
<xsd:element name="intField1" type="xsd:int" />
<xsd:element name="dateField" type="xsd:date" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>