diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2009-09-17 07:15:29 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2009-09-17 07:15:29 +0200 |
commit | f0510d2f90467de8e8f260b47d79a9baaf9bef17 (patch) | |
tree | 0b9929946f06a9cbe9b9e8f2a7600dae4e048f79 /tests/schema/ref-type |
Start tracking XSD with git
Diffstat (limited to 'tests/schema/ref-type')
-rw-r--r-- | tests/schema/ref-type/idref.xsd | 42 | ||||
-rw-r--r-- | tests/schema/ref-type/idrefs.xsd | 43 | ||||
-rw-r--r-- | tests/schema/ref-type/invalid-0.xsd | 17 | ||||
-rw-r--r-- | tests/schema/ref-type/invalid-1.xsd | 11 |
4 files changed, 113 insertions, 0 deletions
diff --git a/tests/schema/ref-type/idref.xsd b/tests/schema/ref-type/idref.xsd new file mode 100644 index 0000000..49ebe40 --- /dev/null +++ b/tests/schema/ref-type/idref.xsd @@ -0,0 +1,42 @@ +<?xml version="1.0"?> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:xse="http://www.codesynthesis.com/xmlns/xml-schema-extension" + xmlns:test="http://www.codesynthesis.com/xmlns/test" + targetNamespace="http://www.codesynthesis.com/xmlns/test"> + + <!-- attribute --> + + <xsd:attribute name="attribute" type="xsd:IDREF" xse:refType="test:a-author"/> + + <xsd:complexType name="a-author"> + <xsd:sequence> + <xsd:element name="name" type="xsd:string"/> + </xsd:sequence> + <xsd:attribute name="recommends" type="xsd:IDREF" xse:refType="test:a-author"/> + </xsd:complexType> + + + <!-- element --> + + <xsd:element name="element" type="xsd:IDREF" xse:refType="test:e-author"/> + + <xsd:complexType name="e-author"> + <xsd:sequence> + <xsd:element name="recommends" type="xsd:IDREF" xse:refType="test:e-author"/> + </xsd:sequence> + </xsd:complexType> + + <!-- base --> + + <xsd:simpleType name="author-ref"> + <xsd:restriction base="xsd:IDREF" xse:refType="test:e-author"/> + </xsd:simpleType> + + + <!-- itemType --> + + <xsd:simpleType name="author-refs"> + <xsd:list itemType="xsd:IDREF" xse:refType="test:e-author"/> + </xsd:simpleType> + +</xsd:schema> diff --git a/tests/schema/ref-type/idrefs.xsd b/tests/schema/ref-type/idrefs.xsd new file mode 100644 index 0000000..b68ed03 --- /dev/null +++ b/tests/schema/ref-type/idrefs.xsd @@ -0,0 +1,43 @@ +<?xml version="1.0"?> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:xse="http://www.codesynthesis.com/xmlns/xml-schema-extension" + xmlns:test="http://www.codesynthesis.com/xmlns/test" + targetNamespace="http://www.codesynthesis.com/xmlns/test"> + + <!-- attribute --> + + <xsd:attribute name="attribute" type="xsd:IDREFS" xse:refType="test:a-author"/> + + <xsd:complexType name="a-author"> + <xsd:sequence> + <xsd:element name="name" type="xsd:string"/> + </xsd:sequence> + <xsd:attribute name="recommends" type="xsd:IDREFS" xse:refType="test:a-author"/> + </xsd:complexType> + + + <!-- element --> + + <xsd:element name="element" type="xsd:IDREFS" xse:refType="test:e-author"/> + + <xsd:complexType name="e-author"> + <xsd:sequence> + <xsd:element name="recommends" type="xsd:IDREFS" xse:refType="test:e-author"/> + </xsd:sequence> + </xsd:complexType> + + <!-- base --> + + <xsd:simpleType name="author-refs"> + <xsd:restriction base="xsd:IDREFS" xse:refType="test:e-author"/> + </xsd:simpleType> + + + <!-- itemType - illegal --> + <!-- + <xsd:simpleType name="author-refss"> + <xsd:list itemType="xsd:IDREFS" xse:refType="test:e-author"/> + </xsd:simpleType> + --> + +</xsd:schema> diff --git a/tests/schema/ref-type/invalid-0.xsd b/tests/schema/ref-type/invalid-0.xsd new file mode 100644 index 0000000..7ce82ed --- /dev/null +++ b/tests/schema/ref-type/invalid-0.xsd @@ -0,0 +1,17 @@ +<?xml version="1.0"?> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:xse="http://www.codesynthesis.com/xmlns/xml-schema-extension" + xmlns:test="http://www.codesynthesis.com/xmlns/test" + xmlns:phony="http://www.codesynthesis.com/xmlns/phony" + targetNamespace="http://www.codesynthesis.com/xmlns/test"> + + <!-- unresolvable namespace prefix --> + + <xsd:attribute name="attribute1" type="xsd:IDREF" xse:refType="author"/> + <xsd:attribute name="attribute2" type="xsd:IDREF" xse:refType="t:author"/> + + <!-- unresolvable namespace --> + + <xsd:attribute name="attribute3" type="xsd:IDREF" xse:refType="phony:author"/> + +</xsd:schema> diff --git a/tests/schema/ref-type/invalid-1.xsd b/tests/schema/ref-type/invalid-1.xsd new file mode 100644 index 0000000..d989065 --- /dev/null +++ b/tests/schema/ref-type/invalid-1.xsd @@ -0,0 +1,11 @@ +<?xml version="1.0"?> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:xse="http://www.codesynthesis.com/xmlns/xml-schema-extension" + xmlns:test="http://www.codesynthesis.com/xmlns/test" + targetNamespace="http://www.codesynthesis.com/xmlns/test"> + + <!-- unresolvable type --> + + <xsd:attribute name="attribute" type="xsd:IDREF" xse:refType="test:author"/> + +</xsd:schema> |