diff options
Diffstat (limited to 'xsd/tests/code')
-rw-r--r-- | xsd/tests/code/name-conflict/test.xsd | 40 | ||||
-rw-r--r-- | xsd/tests/code/name-escaping/test.xsd | 60 |
2 files changed, 100 insertions, 0 deletions
diff --git a/xsd/tests/code/name-conflict/test.xsd b/xsd/tests/code/name-conflict/test.xsd new file mode 100644 index 0000000..a017cc8 --- /dev/null +++ b/xsd/tests/code/name-conflict/test.xsd @@ -0,0 +1,40 @@ +<?xml version="1.0"?> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + + <xsd:simpleType name="enumeration"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="enumeration"/> + <xsd:enumeration value="enumeration1"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:element name="enumeration" type="enumeration"/> + + <xsd:complexType name="complex"> + <xsd:sequence> + <xsd:element name="complex" type="xsd:string"/> + <xsd:element name="complex1" type="xsd:string"/> + <xsd:element name="type" type="xsd:string"/> + <xsd:element name="container" type="xsd:string" minOccurs="0"/> + </xsd:sequence> + </xsd:complexType> + + <xsd:element name="complex" type="complex"/> + + <xsd:complexType name="anonymous"> + <xsd:sequence> + <xsd:element name="anonymous"> + <xsd:complexType> <!-- this is really twisted --> + <xsd:sequence> + <xsd:element name="anonymous2" type="xsd:string"/> + <xsd:element name="anonymous21" type="xsd:string"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="anonymous1" type="xsd:string"/> + </xsd:sequence> + </xsd:complexType> + + <xsd:element name="anonymous" type="anonymous"/> + +</xsd:schema> diff --git a/xsd/tests/code/name-escaping/test.xsd b/xsd/tests/code/name-escaping/test.xsd new file mode 100644 index 0000000..08c7530 --- /dev/null +++ b/xsd/tests/code/name-escaping/test.xsd @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.w3.org/2001/XMLSchema XMLSchema.xsd" + xmlns="http://www.codesynthesis.com/xmlns/test" + targetNamespace="http://www.codesynthesis.com/xmlns/test"> + + <!-- type --> + + <xsd:simpleType name="long"> + <xsd:restriction base="xsd:long"/> + </xsd:simpleType> + + <xsd:simpleType name="strange.type-name."> + <xsd:restriction base="long"/> + </xsd:simpleType> + + <xsd:element name="one-two-explicit"> + <xsd:simpleType> + <xsd:restriction base="xsd:NCName"> + <xsd:enumeration value="on.e-"/> + <xsd:enumeration value="t-wo."/> + <xsd:enumeration value="explicit"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:element> + + + <!-- element [global/local] --> + + <xsd:element name="switch" type="long"/> + <xsd:element name="strange.element-name." type="strange.type-name."/> + + + <xsd:element name="with-anonymous-type-1"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="for" type="long"/> + <xsd:element name="switch" minOccurs="0" type="long"/> + <xsd:element name="strange.element-name." maxOccurs="unbounded" type="strange.type-name."/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + + + + <!-- attributes [global/local] --> + + <xsd:attribute name="default" type="long"/> + <xsd:attribute name="strange.attribute-name." type="strange.type-name."/> + + <xsd:element name="with-anonymous-type-2"> + <xsd:complexType> + <xsd:attribute name="and" type="long" use="required"/> + <xsd:attribute name="strange.attribute-name." type="strange.type-name."/> + </xsd:complexType> + </xsd:element> + + +</xsd:schema> |