diff --git a/swig/perl/samples/SecondSchema.xsd b/swig/perl/samples/SecondSchema.xsd new file mode 100644 index 0000000000000000000000000000000000000000..1ed3d776121a0cb5757b3490dc7529d53fd47dda --- /dev/null +++ b/swig/perl/samples/SecondSchema.xsd @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' elementFormDefault="unqualified" targetNamespace="http://www.secondSchema" xmlns:ss="http://www.secondSchema"> + <xs:element name="realTag1" type="xs:string" /> + <xs:element name="realTag2" type="xs:string" /> + <xs:element name="realTag3" type="xs:string" /> + <xs:attribute name="attr1" type="xs:string" /> + <xs:attribute name="attr2" type="xs:integer" /> + + <xs:attribute name="attr3" type="ss:unionType" /> + <xs:attribute name="attr4" type="ss:unionType" /> + + <xs:simpleType name="unionType" > + <xs:union memberTypes="xs:integer xs:string" /> + </xs:simpleType> + +</xs:schema> \ No newline at end of file diff --git a/swig/perl/samples/TypeInfo.dtd b/swig/perl/samples/TypeInfo.dtd new file mode 100644 index 0000000000000000000000000000000000000000..ee59d32480f0f081a46aab36087107d4f4248a38 --- /dev/null +++ b/swig/perl/samples/TypeInfo.dtd @@ -0,0 +1,22 @@ +<!NOTATION png SYSTEM 'http://xml.apache.org' > +<!ENTITY APACHE SYSTEM 'xml.apache.org' NDATA png> + +<!ELEMENT attributeTest EMPTY > + +<!ATTLIST attributeTest + xmlns:foo CDATA #REQUIRED + cdata CDATA #REQUIRED + enum (a | b) #REQUIRED + id ID #REQUIRED + idRef IDREF #REQUIRED + idRefs IDREFS #REQUIRED + nmToken NMTOKEN #REQUIRED + nmTokenDefault NMTOKEN "lala" + nmTokenDefault2 NMTOKEN "lala2" + nmTokens NMTOKENS #REQUIRED + entity ENTITY #REQUIRED + entities ENTITIES #REQUIRED + notation NOTATION (png) #REQUIRED +> + + diff --git a/swig/perl/samples/TypeInfo.xml b/swig/perl/samples/TypeInfo.xml new file mode 100644 index 0000000000000000000000000000000000000000..80c60048cf2983c0a8a3978a01b14ea4d2f6ade3 --- /dev/null +++ b/swig/perl/samples/TypeInfo.xml @@ -0,0 +1,170 @@ +<!DOCTYPE root SYSTEM "TypeInfo.dtd" > +<root xsi:noNamespaceSchemaLocation="TypeInfo.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:ss="http://www.secondSchema" > +<attrTest +anySimpleType="asdas" +string="string" +boolean="true" +decimal="2.0" +float="2.1" +double="2.1" +duration="P1Y2M3DT10H30M" +dateTime="2000-10-30T11:12:00" +time="11:12:00" +date="2000-10-30" +gYearMonth="1999-01" +gYear="1999" +gMonthDay="--01-08" +gDay="---21" +gMonth="--12--" +hexBinary="0FB7" +base64Binary="abcd" +anyURI="http://www.example.com/" +QName="xsla" +normalizedString="example" +token="example" +language="en" +NMTOKEN="example" +NMTOKENS="example bar" +Name="example" +NCName="example" +integer="1" +nonPositiveInteger="-1" +negativeInteger="-1" +long="1" +int="1" +short="1" +byte="1" +nonNegativeInteger="1" +unsignedLong="1" +unsignedInt="1" +unsignedShort="1" +unsignedByte="1" +positiveInteger="1" +ID="abc" +IDREF="abc" +IDREFS="abc" +ENTITY="APACHE" +ENTITIES="APACHE" +defaultString="test" +xmlns:prefix="http://lala" +xsi:noNamespaceSchemaLocation="hello" +/> +<eleTest > + <level1string >string</level1string> + <level1boolean >true</level1boolean> + <level1decimal >2.0</level1decimal> + <level1float >2.1</level1float> + <level1double >2.1</level1double> + <level1duration >P1Y2M3DT10H30M</level1duration> + <level1dateTime >2000-10-30T11:12:00</level1dateTime> + <level1time >11:12:00</level1time> + <level1date >2000-10-30</level1date> + <level1gYearMonth >1999-01</level1gYearMonth> + <level1gYear >1999</level1gYear> + <level1gMonthDay >--01-08</level1gMonthDay> + <level1gDay >---21</level1gDay> + <level1gMonth >--12--</level1gMonth> + <level1hexBinary >0FB7</level1hexBinary> + <level1base64Binary >abcd</level1base64Binary> + <level1anyURI >http://www.example.com/</level1anyURI> + <level1QName >xsla</level1QName> + <level1normalizedString >example</level1normalizedString> + <level1token >example</level1token> + <level1language >en</level1language> + <level1NMTOKEN >example</level1NMTOKEN> + <level1NMTOKENS >example bar</level1NMTOKENS> + <level1Name >example</level1Name> + <level1NCName >example</level1NCName> + <level1integer >1</level1integer> + <level1nonPositiveInteger >-1</level1nonPositiveInteger> + <level1negativeInteger >-1</level1negativeInteger> + <level1long >1</level1long> + <level1int >1</level1int> + <level1short >1</level1short> + <level1byte >1</level1byte> + <level1nonNegativeInteger >1</level1nonNegativeInteger> + <level1unsignedLong >1</level1unsignedLong> + <level1unsignedInt >1</level1unsignedInt> + <level1unsignedShort >1</level1unsignedShort> + <level1unsignedByte >1</level1unsignedByte> + <level1positiveInteger >1</level1positiveInteger> + <level1anyType /> +</eleTest> +<simpleDerTest decimalDerived="50" stringDerived="hello" > + <decimalDerived >20</decimalDerived> + <stringDerived >hello</stringDerived> +</simpleDerTest> +<complexTest a="abcd" b="hello" c="50" > + <a >abcd</a> + <b >hello</b> + <c >50</c> +</complexTest> +<complexDerTest a="abcd" b="hello" c="50" > + <a >abcd</a> + <b >hello</b> + <c >50</c> + <d >abcdefg</d> +</complexDerTest> +<unionTest > + <testEle >50</testEle> + <testEle >hello</testEle> + <testEle >200</testEle> + <testEle >abcdefg</testEle> + <testEle2 testAttr="50" testAttr2="hello" /> + <testEle2 testAttr="hello" testAttr2="50" /> + <testEle2 testAttr="200" testAttr2="abcdefg" /> + <testEle2 testAttr="abcdefg" testAttr2="200" /> +</unionTest> +<anonymousTest partNum="50"> + <quantity>50</quantity> + <size>25</size> + <anonElement>11</anonElement> +</anonymousTest> +<xsiTypeTest> + <number>99</number> + <number xsi:type="level1" >74</number> + <number xsi:type="level2" >49</number> + <complexXsi > + <a >a</a> + </complexXsi> + <complexXsi xsi:type="level1Complex" > + <a >a</a> + <b >b</b> + </complexXsi> + <complexXsi xsi:type="level2Complex" > + <a >a</a> + <b >b</b> + <c >c</c> + </complexXsi> +</xsiTypeTest> +<anyTestPartial xhtml:attr2="some value" > + <xhtml:fakeTag1 /> + <xhtml:fakeTag2 /> + <ss:realTag1 >la</ss:realTag1> +</anyTestPartial> +<anyTest ss:attr1="string" ss:attr2="2" ss:attr3="string" ss:attr4="2"> + <ss:realTag2 >la</ss:realTag2> + <ss:realTag3 >la</ss:realTag3> + <ss:notRealTag >la</ss:notRealTag> +</anyTest> +<anyTestAttr1 ss:attr5="2" /> +<anyTestAttr2 ss:attr5="2" /> +<anyTestMissing /> +<invalidTest simple="abcd" invalid="asdas" > + <simple >abcd</simple> + <complex > + <a >asa</a> + <invalid /> + </complex> + <number xsi:type="stringDerivedType" >74</number> + <complexXsi xsi:type="simpleDerTestType" > + <a >a</a> + <b >b</b> + </complexXsi> + <unionTest >hello1</unionTest> + <empty ><a /><a /></empty> + <invalidAttrTest attr="lala" /> + <missingAttrTest /> + <prohibitedAttrTest attr="lala" /> +</invalidTest> +</root> \ No newline at end of file diff --git a/swig/perl/samples/TypeInfo.xsd b/swig/perl/samples/TypeInfo.xsd new file mode 100644 index 0000000000000000000000000000000000000000..dde31d4d1c6e2508ccefbd44bd7d18333bb9e95d --- /dev/null +++ b/swig/perl/samples/TypeInfo.xsd @@ -0,0 +1,352 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' elementFormDefault="unqualified" xmlns:foo="http://anothernamespace.com" > + +<xs:import namespace="http://www.secondSchema" schemaLocation="SecondSchema.xsd" /> + + +<xs:element name="root" type="rootType" /> + +<xs:complexType name="rootType" > + <xs:sequence> + <xs:element name="attrTest" type="attrTestType" /> + <xs:element name="eleTest" type="eleTestType" /> + <xs:element name="simpleDerTest" type="simpleDerTestType" /> + <xs:element name="complexTest" type="complexTestType" /> + <xs:element name="complexDerTest" type="complexDerTestType" /> + <xs:element name="unionTest" type="unionTest" /> + <xs:element name="anonymousTest" > + <xs:complexType> + <xs:sequence> + <xs:element name="quantity"> + <xs:simpleType> + <xs:restriction base="xs:positiveInteger"> + <xs:maxExclusive value="100"/> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name='size'> + <xs:simpleType> + <xs:union> + <xs:simpleType> + <xs:restriction base='xs:integer'/> + </xs:simpleType> + <xs:simpleType> + <xs:restriction base='xs:string'/> + </xs:simpleType> + </xs:union> + </xs:simpleType> + </xs:element> + <xs:element ref="anonElement" /> + </xs:sequence> + <xs:attribute name="partNum" > + <xs:simpleType> + <xs:restriction base="xs:positiveInteger"> + <xs:maxExclusive value="100"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + </xs:complexType> + </xs:element> + <xs:element name="xsiTypeTest" type="xsiTypeTestType" /> + <xs:element name="anyTestPartial" type="anyTestPartialType" /> + <xs:element name="anyTest" type="anyTestType" /> + <xs:element name="anyTestAttr1" type="anyTestAttr1Type" /> + <xs:element name="anyTestAttr2" type="anyTestAttr2Type" /> + <xs:element name="anyTestMissing" type="anyTestType" /> + <xs:element name="invalidTest" type="invalidTestType" /> + </xs:sequence> +</xs:complexType> + +<xs:complexType name="anyTestPartialType" > + <xs:sequence > + <xs:any namespace="http://www.w3.org/1999/xhtml" processContents="skip" /> + <xs:any namespace="http://www.w3.org/1999/xhtml" processContents="lax" /> + <xs:any namespace="http://www.secondSchema" processContents="lax" /> + </xs:sequence> + <xs:anyAttribute namespace="http://www.w3.org/1999/xhtml" processContents="skip" /> +</xs:complexType> + +<xs:complexType name="anyTestType" > + <xs:sequence > + <xs:any namespace="http://www.secondSchema" processContents="lax"/> + <xs:any namespace="http://www.secondSchema" processContents="strict"/> + <xs:any namespace="http://www.secondSchema" processContents="strict"/> + </xs:sequence> + <xs:anyAttribute namespace="http://www.secondSchema" processContents="lax" /> +</xs:complexType> + +<xs:complexType name="anyTestAttr1Type" > + <xs:anyAttribute namespace="http://www.secondSchema" processContents="strict" /> +</xs:complexType> + +<xs:complexType name="anyTestAttr2Type" > + <xs:anyAttribute namespace="http://www.secondSchema" processContents="lax" /> +</xs:complexType> + +<xs:complexType name="invalidTestType" > + <xs:sequence > + <xs:element name="simple" type="stringDerivedType" /> + <xs:element name="complex" type="baseComplex" /> + <xs:element name="number" type="base" /> + <xs:element name="complexXsi" type="baseComplex" /> + <xs:element name="unionTest" type="uType" /> + <xs:element name="invalidAttrTest" type="attrOnlyType" /> + <xs:element name="missingAttrTest" type="attrOnlyType" /> + <xs:element name="prohibitedAttrTest" type="prohibitedAttrType" /> + </xs:sequence> + <xs:attribute name="simple" type="stringDerivedType" /> +</xs:complexType> + + +<xs:complexType name="prohibitedAttrType" > + <xs:attribute name="attr" type="stringDerivedType" use="prohibited" /> +</xs:complexType> + +<xs:complexType name="attrOnlyType" > + <xs:attribute name="attr" type="stringDerivedType" use="required" /> +</xs:complexType> + +<xs:simpleType name="uType" > + <xs:union memberTypes="stringDerivedType" /> +</xs:simpleType> + + +<xs:complexType name="xsiTypeTestType" > + <xs:sequence> + <xs:element name="number" type="base" maxOccurs="3"/> + <xs:element name="complexXsi" type="baseComplex" maxOccurs="3"/> + </xs:sequence> +</xs:complexType> + + +<xs:complexType name="baseComplex" > + <xs:sequence> + <xs:element name="a" type="xs:string" /> + </xs:sequence> +</xs:complexType> + +<xs:complexType name="level1Complex" > + <xs:complexContent > + <xs:extension base="baseComplex" > + <xs:sequence> + <xs:element name="b" type="xs:string"/> + </xs:sequence> + </xs:extension> + </xs:complexContent> +</xs:complexType> + +<xs:complexType name="level2Complex" > + <xs:complexContent > + <xs:extension base="level1Complex" > + <xs:sequence> + <xs:element name="c" type="xs:string"/> + </xs:sequence> + </xs:extension> + </xs:complexContent> +</xs:complexType> + + +<xs:simpleType name="base" > + <xs:restriction base="xs:decimal" > + <xs:maxExclusive value="100"/> + </xs:restriction> +</xs:simpleType> + +<xs:simpleType name="level1" > + <xs:restriction base="base" > + <xs:maxExclusive value="75"/> + </xs:restriction> +</xs:simpleType> + +<xs:simpleType name="level2" > + <xs:restriction base="level1" > + <xs:maxExclusive value="50"/> + </xs:restriction> +</xs:simpleType> + + +<xs:element name="anonElement" > + <xs:simpleType > + <xs:restriction base="xs:decimal" > + <xs:maxExclusive value="100"/> + </xs:restriction> + </xs:simpleType> +</xs:element> + +<xs:complexType name="eleTestType" > + <xs:sequence > + <xs:element name="level1string" type="xs:string" /> + <xs:element name="level1boolean" type="xs:boolean" /> + <xs:element name="level1decimal" type="xs:decimal" /> + <xs:element name="level1float" type="xs:float" /> + <xs:element name="level1double" type="xs:double" /> + <xs:element name="level1duration" type="xs:duration" /> + <xs:element name="level1dateTime" type="xs:dateTime" /> + <xs:element name="level1time" type="xs:time" /> + <xs:element name="level1date" type="xs:date" /> + <xs:element name="level1gYearMonth" type="xs:gYearMonth" /> + <xs:element name="level1gYear" type="xs:gYear" /> + <xs:element name="level1gMonthDay" type="xs:gMonthDay" /> + <xs:element name="level1gDay" type="xs:gDay" /> + <xs:element name="level1gMonth" type="xs:gMonth" /> + <xs:element name="level1hexBinary" type="xs:hexBinary" /> + <xs:element name="level1base64Binary" type="xs:base64Binary" /> + <xs:element name="level1anyURI" type="xs:anyURI" /> + <xs:element name="level1QName" type="xs:QName" /> + <xs:element name="level1normalizedString" type="xs:normalizedString" /> + <xs:element name="level1token" type="xs:token" /> + <xs:element name="level1language" type="xs:language" /> + <xs:element name="level1NMTOKEN" type="xs:NMTOKEN" /> + <xs:element name="level1NMTOKENS" type="xs:NMTOKENS" /> + <xs:element name="level1Name" type="xs:Name" /> + <xs:element name="level1NCName" type="xs:NCName" /> + <xs:element name="level1integer" type="xs:integer" /> + <xs:element name="level1nonPositiveInteger" type="xs:nonPositiveInteger" /> + <xs:element name="level1negativeInteger" type="xs:negativeInteger" /> + <xs:element name="level1long" type="xs:long" /> + <xs:element name="level1int" type="xs:int" /> + <xs:element name="level1short" type="xs:short" /> + <xs:element name="level1byte" type="xs:byte" /> + <xs:element name="level1nonNegativeInteger" type="xs:nonNegativeInteger" /> + <xs:element name="level1unsignedLong" type="xs:unsignedLong" /> + <xs:element name="level1unsignedInt" type="xs:unsignedInt" /> + <xs:element name="level1unsignedShort" type="xs:unsignedShort" /> + <xs:element name="level1unsignedByte" type="xs:unsignedByte" /> + <xs:element name="level1positiveInteger" type="xs:positiveInteger" /> + <xs:element name="level1anyType" type="xs:anyType" /> + </xs:sequence> +</xs:complexType> + +<xs:complexType name="attrTestType" > + <xs:attribute name="anySimpleType" type="xs:anySimpleType" /> + <xs:attribute name="string" type="xs:string" /> + <xs:attribute name="boolean" type="xs:boolean" /> + <xs:attribute name="decimal" type="xs:decimal" /> + <xs:attribute name="float" type="xs:float" /> + <xs:attribute name="double" type="xs:double" /> + <xs:attribute name="duration" type="xs:duration" /> + <xs:attribute name="dateTime" type="xs:dateTime" /> + <xs:attribute name="time" type="xs:time" /> + <xs:attribute name="date" type="xs:date" /> + <xs:attribute name="gYearMonth" type="xs:gYearMonth" /> + <xs:attribute name="gYear" type="xs:gYear" /> + <xs:attribute name="gMonthDay" type="xs:gMonthDay" /> + <xs:attribute name="gDay" type="xs:gDay" /> + <xs:attribute name="gMonth" type="xs:gMonth" /> + <xs:attribute name="hexBinary" type="xs:hexBinary" /> + <xs:attribute name="base64Binary" type="xs:base64Binary" /> + <xs:attribute name="anyURI" type="xs:anyURI" /> + <xs:attribute name="QName" type="xs:QName" /> + <xs:attribute name="normalizedString" type="xs:normalizedString" /> + <xs:attribute name="token" type="xs:token" /> + <xs:attribute name="language" type="xs:language" /> + <xs:attribute name="NMTOKEN" type="xs:NMTOKEN" /> + <xs:attribute name="NMTOKENS" type="xs:NMTOKENS" /> + <xs:attribute name="Name" type="xs:Name" /> + <xs:attribute name="NCName" type="xs:NCName" /> + <xs:attribute name="ID" type="xs:ID" /> + <xs:attribute name="IDREF" type="xs:IDREF" /> + <xs:attribute name="IDREFS" type="xs:IDREFS" /> + <xs:attribute name="ENTITY" type="xs:ENTITY" /> + <xs:attribute name="ENTITIES" type="xs:ENTITIES" /> + <xs:attribute name="integer" type="xs:integer" /> + <xs:attribute name="nonPositiveInteger" type="xs:nonPositiveInteger" /> + <xs:attribute name="negativeInteger" type="xs:negativeInteger" /> + <xs:attribute name="long" type="xs:long" /> + <xs:attribute name="int" type="xs:int" /> + <xs:attribute name="short" type="xs:short" /> + <xs:attribute name="byte" type="xs:byte" /> + <xs:attribute name="nonNegativeInteger" type="xs:nonNegativeInteger" /> + <xs:attribute name="unsignedLong" type="xs:unsignedLong" /> + <xs:attribute name="unsignedInt" type="xs:unsignedInt" /> + <xs:attribute name="unsignedShort" type="xs:unsignedShort" /> + <xs:attribute name="unsignedByte" type="xs:unsignedByte" /> + <xs:attribute name="positiveInteger" type="xs:positiveInteger" /> + <xs:attribute name="defaultString" type="xs:string" default="hello" /> + <xs:attribute name="defaultInt" type="xs:integer" default="12" /> +</xs:complexType> + +<xs:complexType name="simpleDerTestType" > + <xs:sequence> + <xs:element name="decimalDerived" type="decimalDerivedType" /> + <xs:element name="stringDerived" type="stringDerivedType" /> + </xs:sequence> + <xs:attribute name="decimalDerived" type="decimalDerivedType" /> + <xs:attribute name="stringDerived" type="stringDerivedType" /> +</xs:complexType> + +<xs:simpleType name="stringDerivedType" > + <xs:restriction base="xs:string" > + <xs:pattern value="hello"/> + </xs:restriction> +</xs:simpleType> + +<xs:simpleType name="decimalDerivedType" > + <xs:restriction base="xs:decimal" > + <xs:maxExclusive value="100"/> + </xs:restriction> +</xs:simpleType> + +<xs:complexType name="complexTestType" > + <xs:sequence> + <xs:element name="a" type="xs:string"/> + <xs:element name="b" type="stringDerivedType"/> + <xs:element name="c" type="decimalDerivedType"/> + </xs:sequence> + <xs:attribute name="a" type="xs:string" /> + <xs:attribute name="b" type="stringDerivedType" /> + <xs:attribute name="c" type="decimalDerivedType" /> +</xs:complexType> + +<xs:complexType name="complexDerTestType" > + <xs:complexContent > + <xs:extension base="complexTestType" > + <xs:sequence> + <xs:element name="d" type="xs:string"/> + </xs:sequence> + </xs:extension> + </xs:complexContent> +</xs:complexType> + +<xs:simpleType name="unionTestType" > + <xs:union memberTypes="decimalDerivedType stringDerivedType xs:decimal xs:string" /> +</xs:simpleType> + + +<xs:complexType name="unionTest" > + <xs:sequence > + <xs:element name="testEle" maxOccurs="4" type="unionTestType" /> + <xs:element name="testEle2" maxOccurs="4" > + <xs:complexType > + <xs:attribute name="testAttr" type="unionTestType" /> + <xs:attribute name="testAttr2" type="unionTestType" /> + </xs:complexType> + </xs:element> + </xs:sequence> +</xs:complexType> + +<xs:complexType name="unionTest2" > + <xs:sequence > + <xs:element name="testEle" maxOccurs="4" > + <xs:complexType > + <xs:simpleContent > + <xs:extension base="unionTestType" > + <xs:attribute name="testAttr" type="unionTestType" /> + </xs:extension > + </xs:simpleContent> + </xs:complexType> + </xs:element> + </xs:sequence> +</xs:complexType> + +<xs:complexType name="testtype2" > +<xs:sequence> +<xs:element name="poo" type="xs:string"/> +</xs:sequence> +<xs:attribute name="a" type="xs:IDREF" /> +<xs:attribute name="b" type="xs:ID" /> +<xs:attribute name="c" type="xs:string" /> + +</xs:complexType> + +</xs:schema> diff --git a/swig/perl/samples/TypeInfoCombined.xml b/swig/perl/samples/TypeInfoCombined.xml new file mode 100644 index 0000000000000000000000000000000000000000..b0e33f4624a8c54e39992d573cd6bd7e5cb73fc4 --- /dev/null +++ b/swig/perl/samples/TypeInfoCombined.xml @@ -0,0 +1,7 @@ +<!DOCTYPE root SYSTEM "combined.dtd" > +<root xsi:noNamespaceSchemaLocation="TypeInfoCombined.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" attBoth="lala" +attSchema="lala" attDTD="lala" +> +<level1 >content</level1> +<level1a >content</level1a> +</root> diff --git a/swig/perl/samples/TypeInfoCombined.xsd b/swig/perl/samples/TypeInfoCombined.xsd new file mode 100644 index 0000000000000000000000000000000000000000..f4530967dc1c40ce464c6465b56b281b72aa8270 --- /dev/null +++ b/swig/perl/samples/TypeInfoCombined.xsd @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' elementFormDefault="unqualified" > + +<xs:element name="root" type="rootType" /> + +<xs:complexType name="rootType" > + <xs:sequence > + <xs:element name="level1" type="xs:string" /> + </xs:sequence> + <xs:attribute name="attBoth" type="xs:string" /> + <xs:attribute name="attSchema" type="xs:string" /> +</xs:complexType> + +</xs:schema> \ No newline at end of file diff --git a/swig/perl/samples/TypeInfoJustDTD.xml b/swig/perl/samples/TypeInfoJustDTD.xml new file mode 100644 index 0000000000000000000000000000000000000000..ce25d4f36a1a0586ee6b291ca0aa331580ef2f39 --- /dev/null +++ b/swig/perl/samples/TypeInfoJustDTD.xml @@ -0,0 +1,16 @@ +<!DOCTYPE attributeTest SYSTEM "TypeInfo.dtd" > +<attributeTest + xmlns:foo = "lala" + cdata = "cdata" + enum = "a" + id = "someID" + idRef = "someID" + idRefs = "someID" + nmToken = "abc" + nmTokenDefault2 = "test" + nmTokens = "abc" + entity = "APACHE" + entities = "APACHE" + notation = "png" + noDecl = "lalal" +/> \ No newline at end of file diff --git a/swig/perl/samples/TypeInfoNoDTD.xml b/swig/perl/samples/TypeInfoNoDTD.xml new file mode 100644 index 0000000000000000000000000000000000000000..1a6d4af481c3266e376a87cd9c4231b20dfc8341 --- /dev/null +++ b/swig/perl/samples/TypeInfoNoDTD.xml @@ -0,0 +1,167 @@ +<root xsi:noNamespaceSchemaLocation="TypeInfoNoDTD.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:ss="http://www.secondSchema" > +<attrTest +anySimpleType="asdas" +string="string" +boolean="true" +decimal="2.0" +float="2.1" +double="2.1" +duration="P1Y2M3DT10H30M" +dateTime="2000-10-30T11:12:00" +time="11:12:00" +date="2000-10-30" +gYearMonth="1999-01" +gYear="1999" +gMonthDay="--01-08" +gDay="---21" +gMonth="--12--" +hexBinary="0FB7" +base64Binary="abcd" +anyURI="http://www.example.com/" +QName="xsla" +normalizedString="example" +token="example" +language="en" +NMTOKEN="example" +NMTOKENS="example bar" +Name="example" +NCName="example" +integer="1" +nonPositiveInteger="-1" +negativeInteger="-1" +long="1" +int="1" +short="1" +byte="1" +nonNegativeInteger="1" +unsignedLong="1" +unsignedInt="1" +unsignedShort="1" +unsignedByte="1" +positiveInteger="1" +ID="abc" +IDREF="abc" +IDREFS="abc" +defaultString="test" +xmlns:prefix="http://lala" +xsi:noNamespaceSchemaLocation="hello" +/> +<eleTest > + <level1string >string</level1string> + <level1boolean >true</level1boolean> + <level1decimal >2.0</level1decimal> + <level1float >2.1</level1float> + <level1double >2.1</level1double> + <level1duration >P1Y2M3DT10H30M</level1duration> + <level1dateTime >2000-10-30T11:12:00</level1dateTime> + <level1time >11:12:00</level1time> + <level1date >2000-10-30</level1date> + <level1gYearMonth >1999-01</level1gYearMonth> + <level1gYear >1999</level1gYear> + <level1gMonthDay >--01-08</level1gMonthDay> + <level1gDay >---21</level1gDay> + <level1gMonth >--12--</level1gMonth> + <level1hexBinary >0FB7</level1hexBinary> + <level1base64Binary >abcd</level1base64Binary> + <level1anyURI >http://www.example.com/</level1anyURI> + <level1QName >xsla</level1QName> + <level1normalizedString >example</level1normalizedString> + <level1token >example</level1token> + <level1language >en</level1language> + <level1NMTOKEN >example</level1NMTOKEN> + <level1NMTOKENS >example bar</level1NMTOKENS> + <level1Name >example</level1Name> + <level1NCName >example</level1NCName> + <level1integer >1</level1integer> + <level1nonPositiveInteger >-1</level1nonPositiveInteger> + <level1negativeInteger >-1</level1negativeInteger> + <level1long >1</level1long> + <level1int >1</level1int> + <level1short >1</level1short> + <level1byte >1</level1byte> + <level1nonNegativeInteger >1</level1nonNegativeInteger> + <level1unsignedLong >1</level1unsignedLong> + <level1unsignedInt >1</level1unsignedInt> + <level1unsignedShort >1</level1unsignedShort> + <level1unsignedByte >1</level1unsignedByte> + <level1positiveInteger >1</level1positiveInteger> + <level1anyType /> +</eleTest> +<simpleDerTest decimalDerived="50" stringDerived="hello" > + <decimalDerived >20</decimalDerived> + <stringDerived >hello</stringDerived> +</simpleDerTest> +<complexTest a="abcd" b="hello" c="50" > + <a >abcd</a> + <b >hello</b> + <c >50</c> +</complexTest> +<complexDerTest a="abcd" b="hello" c="50" > + <a >abcd</a> + <b >hello</b> + <c >50</c> + <d >abcdefg</d> +</complexDerTest> +<unionTest > + <testEle >50</testEle> + <testEle >hello</testEle> + <testEle >200</testEle> + <testEle >abcdefg</testEle> + <testEle2 testAttr="50" testAttr2="hello" /> + <testEle2 testAttr="hello" testAttr2="50" /> + <testEle2 testAttr="200" testAttr2="abcdefg" /> + <testEle2 testAttr="abcdefg" testAttr2="200" /> +</unionTest> +<anonymousTest partNum="50"> + <quantity>50</quantity> + <size>25</size> + <anonElement>11</anonElement> +</anonymousTest> +<xsiTypeTest> + <number>99</number> + <number xsi:type="level1" >74</number> + <number xsi:type="level2" >49</number> + <complexXsi > + <a >a</a> + </complexXsi> + <complexXsi xsi:type="level1Complex" > + <a >a</a> + <b >b</b> + </complexXsi> + <complexXsi xsi:type="level2Complex" > + <a >a</a> + <b >b</b> + <c >c</c> + </complexXsi> +</xsiTypeTest> +<anyTestPartial xhtml:attr2="some value" > + <xhtml:fakeTag1 /> + <xhtml:fakeTag2 /> + <ss:realTag1 >la</ss:realTag1> +</anyTestPartial> +<anyTest ss:attr1="string" ss:attr2="2" ss:attr3="string" ss:attr4="2"> + <ss:realTag2 >la</ss:realTag2> + <ss:realTag3 >la</ss:realTag3> + <ss:notRealTag >la</ss:notRealTag> +</anyTest> +<anyTestAttr1 ss:attr5="2" /> +<anyTestAttr2 ss:attr5="2" /> +<anyTestMissing /> +<invalidTest simple="abcd" invalid="asdas" > + <simple >abcd</simple> + <complex > + <a >asa</a> + <invalid /> + </complex> + <number xsi:type="stringDerivedType" >74</number> + <complexXsi xsi:type="simpleDerTestType" > + <a >a</a> + <b >b</b> + </complexXsi> + <unionTest >hello1</unionTest> + <empty ><a /><a /></empty> + <invalidAttrTest attr="lala" /> + <missingAttrTest /> + <prohibitedAttrTest attr="lala" /> +</invalidTest> +</root> \ No newline at end of file diff --git a/swig/perl/samples/TypeInfoNoDTD.xsd b/swig/perl/samples/TypeInfoNoDTD.xsd new file mode 100644 index 0000000000000000000000000000000000000000..b199fb66fdf980ab23dea358233936729a983549 --- /dev/null +++ b/swig/perl/samples/TypeInfoNoDTD.xsd @@ -0,0 +1,350 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' elementFormDefault="unqualified" xmlns:foo="http://anothernamespace.com" > + +<xs:import namespace="http://www.secondSchema" schemaLocation="SecondSchema.xsd" /> + + +<xs:element name="root" type="rootType" /> + +<xs:complexType name="rootType" > + <xs:sequence> + <xs:element name="attrTest" type="attrTestType" /> + <xs:element name="eleTest" type="eleTestType" /> + <xs:element name="simpleDerTest" type="simpleDerTestType" /> + <xs:element name="complexTest" type="complexTestType" /> + <xs:element name="complexDerTest" type="complexDerTestType" /> + <xs:element name="unionTest" type="unionTest" /> + <xs:element name="anonymousTest" > + <xs:complexType> + <xs:sequence> + <xs:element name="quantity"> + <xs:simpleType> + <xs:restriction base="xs:positiveInteger"> + <xs:maxExclusive value="100"/> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name='size'> + <xs:simpleType> + <xs:union> + <xs:simpleType> + <xs:restriction base='xs:integer'/> + </xs:simpleType> + <xs:simpleType> + <xs:restriction base='xs:string'/> + </xs:simpleType> + </xs:union> + </xs:simpleType> + </xs:element> + <xs:element ref="anonElement" /> + </xs:sequence> + <xs:attribute name="partNum" > + <xs:simpleType> + <xs:restriction base="xs:positiveInteger"> + <xs:maxExclusive value="100"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + </xs:complexType> + </xs:element> + <xs:element name="xsiTypeTest" type="xsiTypeTestType" /> + <xs:element name="anyTestPartial" type="anyTestPartialType" /> + <xs:element name="anyTest" type="anyTestType" /> + <xs:element name="anyTestAttr1" type="anyTestAttr1Type" /> + <xs:element name="anyTestAttr2" type="anyTestAttr2Type" /> + <xs:element name="anyTestMissing" type="anyTestType" /> + <xs:element name="invalidTest" type="invalidTestType" /> + </xs:sequence> +</xs:complexType> + +<xs:complexType name="anyTestPartialType" > + <xs:sequence > + <xs:any namespace="http://www.w3.org/1999/xhtml" processContents="skip" /> + <xs:any namespace="http://www.w3.org/1999/xhtml" processContents="lax" /> + <xs:any namespace="http://www.secondSchema" processContents="lax" /> + </xs:sequence> + <xs:anyAttribute namespace="http://www.w3.org/1999/xhtml" processContents="skip" /> +</xs:complexType> + +<xs:complexType name="anyTestType" > + <xs:sequence > + <xs:any namespace="http://www.secondSchema" processContents="lax"/> + <xs:any namespace="http://www.secondSchema" processContents="strict"/> + <xs:any namespace="http://www.secondSchema" processContents="strict"/> + </xs:sequence> + <xs:anyAttribute namespace="http://www.secondSchema" processContents="lax" /> +</xs:complexType> + +<xs:complexType name="anyTestAttr1Type" > + <xs:anyAttribute namespace="http://www.secondSchema" processContents="strict" /> +</xs:complexType> + +<xs:complexType name="anyTestAttr2Type" > + <xs:anyAttribute namespace="http://www.secondSchema" processContents="lax" /> +</xs:complexType> + +<xs:complexType name="invalidTestType" > + <xs:sequence > + <xs:element name="simple" type="stringDerivedType" /> + <xs:element name="complex" type="baseComplex" /> + <xs:element name="number" type="base" /> + <xs:element name="complexXsi" type="baseComplex" /> + <xs:element name="unionTest" type="uType" /> + <xs:element name="invalidAttrTest" type="attrOnlyType" /> + <xs:element name="missingAttrTest" type="attrOnlyType" /> + <xs:element name="prohibitedAttrTest" type="prohibitedAttrType" /> + </xs:sequence> + <xs:attribute name="simple" type="stringDerivedType" /> +</xs:complexType> + + +<xs:complexType name="prohibitedAttrType" > + <xs:attribute name="attr" type="stringDerivedType" use="prohibited" /> +</xs:complexType> + +<xs:complexType name="attrOnlyType" > + <xs:attribute name="attr" type="stringDerivedType" use="required" /> +</xs:complexType> + +<xs:simpleType name="uType" > + <xs:union memberTypes="stringDerivedType" /> +</xs:simpleType> + + +<xs:complexType name="xsiTypeTestType" > + <xs:sequence> + <xs:element name="number" type="base" maxOccurs="3"/> + <xs:element name="complexXsi" type="baseComplex" maxOccurs="3"/> + </xs:sequence> +</xs:complexType> + + +<xs:complexType name="baseComplex" > + <xs:sequence> + <xs:element name="a" type="xs:string" /> + </xs:sequence> +</xs:complexType> + +<xs:complexType name="level1Complex" > + <xs:complexContent > + <xs:extension base="baseComplex" > + <xs:sequence> + <xs:element name="b" type="xs:string"/> + </xs:sequence> + </xs:extension> + </xs:complexContent> +</xs:complexType> + +<xs:complexType name="level2Complex" > + <xs:complexContent > + <xs:extension base="level1Complex" > + <xs:sequence> + <xs:element name="c" type="xs:string"/> + </xs:sequence> + </xs:extension> + </xs:complexContent> +</xs:complexType> + + +<xs:simpleType name="base" > + <xs:restriction base="xs:decimal" > + <xs:maxExclusive value="100"/> + </xs:restriction> +</xs:simpleType> + +<xs:simpleType name="level1" > + <xs:restriction base="base" > + <xs:maxExclusive value="75"/> + </xs:restriction> +</xs:simpleType> + +<xs:simpleType name="level2" > + <xs:restriction base="level1" > + <xs:maxExclusive value="50"/> + </xs:restriction> +</xs:simpleType> + + +<xs:element name="anonElement" > + <xs:simpleType > + <xs:restriction base="xs:decimal" > + <xs:maxExclusive value="100"/> + </xs:restriction> + </xs:simpleType> +</xs:element> + +<xs:complexType name="eleTestType" > + <xs:sequence > + <xs:element name="level1string" type="xs:string" /> + <xs:element name="level1boolean" type="xs:boolean" /> + <xs:element name="level1decimal" type="xs:decimal" /> + <xs:element name="level1float" type="xs:float" /> + <xs:element name="level1double" type="xs:double" /> + <xs:element name="level1duration" type="xs:duration" /> + <xs:element name="level1dateTime" type="xs:dateTime" /> + <xs:element name="level1time" type="xs:time" /> + <xs:element name="level1date" type="xs:date" /> + <xs:element name="level1gYearMonth" type="xs:gYearMonth" /> + <xs:element name="level1gYear" type="xs:gYear" /> + <xs:element name="level1gMonthDay" type="xs:gMonthDay" /> + <xs:element name="level1gDay" type="xs:gDay" /> + <xs:element name="level1gMonth" type="xs:gMonth" /> + <xs:element name="level1hexBinary" type="xs:hexBinary" /> + <xs:element name="level1base64Binary" type="xs:base64Binary" /> + <xs:element name="level1anyURI" type="xs:anyURI" /> + <xs:element name="level1QName" type="xs:QName" /> + <xs:element name="level1normalizedString" type="xs:normalizedString" /> + <xs:element name="level1token" type="xs:token" /> + <xs:element name="level1language" type="xs:language" /> + <xs:element name="level1NMTOKEN" type="xs:NMTOKEN" /> + <xs:element name="level1NMTOKENS" type="xs:NMTOKENS" /> + <xs:element name="level1Name" type="xs:Name" /> + <xs:element name="level1NCName" type="xs:NCName" /> + <xs:element name="level1integer" type="xs:integer" /> + <xs:element name="level1nonPositiveInteger" type="xs:nonPositiveInteger" /> + <xs:element name="level1negativeInteger" type="xs:negativeInteger" /> + <xs:element name="level1long" type="xs:long" /> + <xs:element name="level1int" type="xs:int" /> + <xs:element name="level1short" type="xs:short" /> + <xs:element name="level1byte" type="xs:byte" /> + <xs:element name="level1nonNegativeInteger" type="xs:nonNegativeInteger" /> + <xs:element name="level1unsignedLong" type="xs:unsignedLong" /> + <xs:element name="level1unsignedInt" type="xs:unsignedInt" /> + <xs:element name="level1unsignedShort" type="xs:unsignedShort" /> + <xs:element name="level1unsignedByte" type="xs:unsignedByte" /> + <xs:element name="level1positiveInteger" type="xs:positiveInteger" /> + <xs:element name="level1anyType" type="xs:anyType" /> + </xs:sequence> +</xs:complexType> + +<xs:complexType name="attrTestType" > + <xs:attribute name="anySimpleType" type="xs:anySimpleType" /> + <xs:attribute name="string" type="xs:string" /> + <xs:attribute name="boolean" type="xs:boolean" /> + <xs:attribute name="decimal" type="xs:decimal" /> + <xs:attribute name="float" type="xs:float" /> + <xs:attribute name="double" type="xs:double" /> + <xs:attribute name="duration" type="xs:duration" /> + <xs:attribute name="dateTime" type="xs:dateTime" /> + <xs:attribute name="time" type="xs:time" /> + <xs:attribute name="date" type="xs:date" /> + <xs:attribute name="gYearMonth" type="xs:gYearMonth" /> + <xs:attribute name="gYear" type="xs:gYear" /> + <xs:attribute name="gMonthDay" type="xs:gMonthDay" /> + <xs:attribute name="gDay" type="xs:gDay" /> + <xs:attribute name="gMonth" type="xs:gMonth" /> + <xs:attribute name="hexBinary" type="xs:hexBinary" /> + <xs:attribute name="base64Binary" type="xs:base64Binary" /> + <xs:attribute name="anyURI" type="xs:anyURI" /> + <xs:attribute name="QName" type="xs:QName" /> + <xs:attribute name="normalizedString" type="xs:normalizedString" /> + <xs:attribute name="token" type="xs:token" /> + <xs:attribute name="language" type="xs:language" /> + <xs:attribute name="NMTOKEN" type="xs:NMTOKEN" /> + <xs:attribute name="NMTOKENS" type="xs:NMTOKENS" /> + <xs:attribute name="Name" type="xs:Name" /> + <xs:attribute name="NCName" type="xs:NCName" /> + <xs:attribute name="ID" type="xs:ID" /> + <xs:attribute name="IDREF" type="xs:IDREF" /> + <xs:attribute name="IDREFS" type="xs:IDREFS" /> + <xs:attribute name="integer" type="xs:integer" /> + <xs:attribute name="nonPositiveInteger" type="xs:nonPositiveInteger" /> + <xs:attribute name="negativeInteger" type="xs:negativeInteger" /> + <xs:attribute name="long" type="xs:long" /> + <xs:attribute name="int" type="xs:int" /> + <xs:attribute name="short" type="xs:short" /> + <xs:attribute name="byte" type="xs:byte" /> + <xs:attribute name="nonNegativeInteger" type="xs:nonNegativeInteger" /> + <xs:attribute name="unsignedLong" type="xs:unsignedLong" /> + <xs:attribute name="unsignedInt" type="xs:unsignedInt" /> + <xs:attribute name="unsignedShort" type="xs:unsignedShort" /> + <xs:attribute name="unsignedByte" type="xs:unsignedByte" /> + <xs:attribute name="positiveInteger" type="xs:positiveInteger" /> + <xs:attribute name="defaultString" type="xs:string" default="hello" /> + <xs:attribute name="defaultInt" type="xs:integer" default="12" /> +</xs:complexType> + +<xs:complexType name="simpleDerTestType" > + <xs:sequence> + <xs:element name="decimalDerived" type="decimalDerivedType" /> + <xs:element name="stringDerived" type="stringDerivedType" /> + </xs:sequence> + <xs:attribute name="decimalDerived" type="decimalDerivedType" /> + <xs:attribute name="stringDerived" type="stringDerivedType" /> +</xs:complexType> + +<xs:simpleType name="stringDerivedType" > + <xs:restriction base="xs:string" > + <xs:pattern value="hello"/> + </xs:restriction> +</xs:simpleType> + +<xs:simpleType name="decimalDerivedType" > + <xs:restriction base="xs:decimal" > + <xs:maxExclusive value="100"/> + </xs:restriction> +</xs:simpleType> + +<xs:complexType name="complexTestType" > + <xs:sequence> + <xs:element name="a" type="xs:string"/> + <xs:element name="b" type="stringDerivedType"/> + <xs:element name="c" type="decimalDerivedType"/> + </xs:sequence> + <xs:attribute name="a" type="xs:string" /> + <xs:attribute name="b" type="stringDerivedType" /> + <xs:attribute name="c" type="decimalDerivedType" /> +</xs:complexType> + +<xs:complexType name="complexDerTestType" > + <xs:complexContent > + <xs:extension base="complexTestType" > + <xs:sequence> + <xs:element name="d" type="xs:string"/> + </xs:sequence> + </xs:extension> + </xs:complexContent> +</xs:complexType> + +<xs:simpleType name="unionTestType" > + <xs:union memberTypes="decimalDerivedType stringDerivedType xs:decimal xs:string" /> +</xs:simpleType> + + +<xs:complexType name="unionTest" > + <xs:sequence > + <xs:element name="testEle" maxOccurs="4" type="unionTestType" /> + <xs:element name="testEle2" maxOccurs="4" > + <xs:complexType > + <xs:attribute name="testAttr" type="unionTestType" /> + <xs:attribute name="testAttr2" type="unionTestType" /> + </xs:complexType> + </xs:element> + </xs:sequence> +</xs:complexType> + +<xs:complexType name="unionTest2" > + <xs:sequence > + <xs:element name="testEle" maxOccurs="4" > + <xs:complexType > + <xs:simpleContent > + <xs:extension base="unionTestType" > + <xs:attribute name="testAttr" type="unionTestType" /> + </xs:extension > + </xs:simpleContent> + </xs:complexType> + </xs:element> + </xs:sequence> +</xs:complexType> + +<xs:complexType name="testtype2" > +<xs:sequence> +<xs:element name="poo" type="xs:string"/> +</xs:sequence> +<xs:attribute name="a" type="xs:IDREF" /> +<xs:attribute name="b" type="xs:ID" /> +<xs:attribute name="c" type="xs:string" /> + +</xs:complexType> + +</xs:schema> diff --git a/swig/perl/samples/combined.dtd b/swig/perl/samples/combined.dtd new file mode 100644 index 0000000000000000000000000000000000000000..0c0e02700d6d2193594f5c0e49b2343584c744d2 --- /dev/null +++ b/swig/perl/samples/combined.dtd @@ -0,0 +1,12 @@ +<!ELEMENT root (level1, level1a) > + +<!ATTLIST root + xsi:noNamespaceSchemaLocation CDATA #REQUIRED + xmlns:xsi CDATA #REQUIRED + attBoth CDATA #REQUIRED + attDTD CDATA #REQUIRED +> + +<!ELEMENT level1 (#PCDATA) > +<!ELEMENT level1a (#PCDATA) > +