diff options
author | Jörg Frings-Fürst <jff@merkur> | 2014-05-18 16:08:14 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <jff@merkur> | 2014-05-18 16:08:14 +0200 |
commit | a15cf65c44d5c224169c32ef5495b68c758134b7 (patch) | |
tree | 3419f58fc8e1b315ba8171910ee044c5d467c162 /libxsd-frontend/tests/schema/annotation |
Imported Upstream version 3.3.0.2upstream/3.3.0.2
Diffstat (limited to 'libxsd-frontend/tests/schema/annotation')
-rw-r--r-- | libxsd-frontend/tests/schema/annotation/makefile | 35 | ||||
-rw-r--r-- | libxsd-frontend/tests/schema/annotation/test-000.std | 67 | ||||
-rw-r--r-- | libxsd-frontend/tests/schema/annotation/test-000.xsd | 120 | ||||
-rw-r--r-- | libxsd-frontend/tests/schema/annotation/test-001.std | 36 | ||||
-rw-r--r-- | libxsd-frontend/tests/schema/annotation/test-001.xsd | 53 |
5 files changed, 311 insertions, 0 deletions
diff --git a/libxsd-frontend/tests/schema/annotation/makefile b/libxsd-frontend/tests/schema/annotation/makefile new file mode 100644 index 0000000..97f578b --- /dev/null +++ b/libxsd-frontend/tests/schema/annotation/makefile @@ -0,0 +1,35 @@ +# file : tests/schema/annotation/makefile +# author : Boris Kolpackov <boris@codesynthesis.com> +# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make + +tests := 000 001 + +driver := $(out_root)/tests/dump/driver +test := $(out_base)/.test +clean := $(out_base)/.clean + +# Convenience alias for default target. +# +$(out_base)/: $(driver) + +# Test. +# +test_targets := $(addprefix $(out_base)/.test-,$(tests)) + +$(test): $(test_targets) +$(test_targets): driver := $(driver) + +.PHONY: $(out_base)/.test-% +$(out_base)/.test-%: $(driver) $(src_base)/test-%.xsd $(src_base)/test-%.std + $(call message,test $(out_base)/$*,$(driver) $(src_base)/test-$*.xsd | diff -u $(src_base)/test-$*.std -) + +# Clean. +# +$(clean): + +# Dependencies. +# +$(call import,$(src_root)/tests/dump/makefile) diff --git a/libxsd-frontend/tests/schema/annotation/test-000.std b/libxsd-frontend/tests/schema/annotation/test-000.std new file mode 100644 index 0000000..15f3e89 --- /dev/null +++ b/libxsd-frontend/tests/schema/annotation/test-000.std @@ -0,0 +1,67 @@ +<schema documentation> +primary +{ + namespace test + { + <list type documentation> + list list http://www.w3.org/2001/XMLSchema#string + <union type documentation> + union union http://www.w3.org/2001/XMLSchema#int http://www.w3.org/2001/XMLSchema#string + <enumeration type documentation> + enumeration enum: http://www.w3.org/2001/XMLSchema#string + { + <enumerator documentation (male)> + enumerator male + <enumerator documentation (female)> + enumerator female + } + <complex type documentation> + complex type + { + <local element efoo documentation> + element efoo + <local element ebar documentation> + element ebar + <local element ebaz documentation> + element ebaz + <any documentation> + any 'any #0' + <local attribute afoo documentation> + optional attribute afoo http://www.w3.org/2001/XMLSchema#string + <local attribute abar documentation> + optional attribute abar + { + <list type documentation> + list <anonymous> http://www.w3.org/2001/XMLSchema#string + } + <local attribute abaz documentation> + optional attribute abaz http://www.w3.org/2001/XMLSchema#string + <anyAttribute documentation> + any-attribute 'any-attribute #0' + [1, 1] sequence + { + [1, 1] element efoo http://www.w3.org/2001/XMLSchema#string + [1, 1] element ebar + { + complex <anonymous> + { + <nested local element efoo documentation> + element efoo + <nested local attribute afoo documentation> + optional attribute afoo http://www.w3.org/2001/XMLSchema#string + [1, 1] sequence + { + [1, 1] element efoo http://www.w3.org/2001/XMLSchema#string + } + } + } + [1, 1] element ebaz http://www.w3.org/2001/XMLSchema#string + [1, 1] any 'any #0' + } + } + <global element documentation> + element ebaz http://www.w3.org/2001/XMLSchema#string + <global attribute documentation> + attribute abaz http://www.w3.org/2001/XMLSchema#string + } +} diff --git a/libxsd-frontend/tests/schema/annotation/test-000.xsd b/libxsd-frontend/tests/schema/annotation/test-000.xsd new file mode 100644 index 0000000..f768b45 --- /dev/null +++ b/libxsd-frontend/tests/schema/annotation/test-000.xsd @@ -0,0 +1,120 @@ +<?xml version="1.0"?> +<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:t="test" targetNamespace="test"> + + <annotation> + <documentation>schema documentation</documentation> + </annotation> + + <simpleType name="list"> + <annotation> + <documentation>list type documentation</documentation> + </annotation> + <list itemType="string"/> + </simpleType> + + <simpleType name="union"> + <annotation> + <documentation>union type documentation</documentation> + </annotation> + <union memberTypes="int string"/> + </simpleType> + + <simpleType name="enum"> + <annotation> + <documentation>enumeration type documentation</documentation> + </annotation> + <restriction base="string"> + <enumeration value="male"> + <annotation> + <documentation>enumerator documentation (male)</documentation> + </annotation> + </enumeration> + <enumeration value="female"> + <annotation> + <documentation>enumerator documentation (female)</documentation> + </annotation> + </enumeration> + </restriction> + </simpleType> + + <complexType name="type"> + <annotation> + <documentation>complex type documentation</documentation> + </annotation> + <sequence> + <element name="efoo" type="string"> + <annotation> + <documentation>local element efoo documentation</documentation> + </annotation> + </element> + <element name="ebar"> + <annotation> + <documentation>local element ebar documentation</documentation> + </annotation> + <complexType> + <sequence> + <element name="efoo" type="string"> + <annotation> + <documentation>nested local element efoo documentation</documentation> + </annotation> + </element> + </sequence> + <attribute name="afoo" type="string"> + <annotation> + <documentation>nested local attribute afoo documentation</documentation> + </annotation> + </attribute> + </complexType> + </element> + <element ref="t:ebaz"> + <annotation> + <documentation>local element ebaz documentation</documentation> + </annotation> + </element> + <any namespace="##other"> + <annotation> + <documentation>any documentation</documentation> + </annotation> + </any> + </sequence> + <attribute name="afoo" type="string"> + <annotation> + <documentation>local attribute afoo documentation</documentation> + </annotation> + </attribute> + <attribute name="abar"> + <annotation> + <documentation>local attribute abar documentation</documentation> + </annotation> + <simpleType> + <annotation> + <documentation>list type documentation</documentation> + </annotation> + <list itemType="string"/> + </simpleType> + </attribute> + <attribute ref="t:abaz"> + <annotation> + <documentation>local attribute abaz documentation</documentation> + </annotation> + </attribute> + <anyAttribute namespace="##other"> + <annotation> + <documentation>anyAttribute documentation</documentation> + </annotation> + </anyAttribute> + </complexType> + + <element name="ebaz" type="string"> + <annotation> + <documentation>global element documentation</documentation> + </annotation> + </element> + + <attribute name="abaz" type="string"> + <annotation> + <documentation>global attribute documentation</documentation> + </annotation> + </attribute> + +</schema> diff --git a/libxsd-frontend/tests/schema/annotation/test-001.std b/libxsd-frontend/tests/schema/annotation/test-001.std new file mode 100644 index 0000000..9e2c99a --- /dev/null +++ b/libxsd-frontend/tests/schema/annotation/test-001.std @@ -0,0 +1,36 @@ +primary +{ + namespace test + { + complex type + { + <global element ebar documentation> + element ebar + <group element efoo documentation> + element efoo + <global element ebar documentation> + element ebar + <global attribute abar documentation> + optional attribute abar http://www.w3.org/2001/XMLSchema#string + <group attribute afoo documentation> + optional attribute afoo http://www.w3.org/2001/XMLSchema#string + <global attribute abaz documentation> + optional attribute abaz http://www.w3.org/2001/XMLSchema#string + [1, 1] sequence + { + [1, 1] element ebar http://www.w3.org/2001/XMLSchema#string + [1, 1] choice + { + [1, 1] element efoo http://www.w3.org/2001/XMLSchema#string + [1, 1] element ebar http://www.w3.org/2001/XMLSchema#string + } + } + } + <global element ebar documentation> + element ebar http://www.w3.org/2001/XMLSchema#string + <global attribute abar documentation> + attribute abar http://www.w3.org/2001/XMLSchema#string + <global attribute abaz documentation> + attribute abaz http://www.w3.org/2001/XMLSchema#string + } +} diff --git a/libxsd-frontend/tests/schema/annotation/test-001.xsd b/libxsd-frontend/tests/schema/annotation/test-001.xsd new file mode 100644 index 0000000..286f63a --- /dev/null +++ b/libxsd-frontend/tests/schema/annotation/test-001.xsd @@ -0,0 +1,53 @@ +<?xml version="1.0"?> +<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:t="test" targetNamespace="test"> + + <!-- Test various ref constructs. --> + + <complexType name="type"> + <sequence> + <element ref="t:ebar"/> + <group ref="t:eg"/> + </sequence> + <attribute ref="t:abar"/> + <attributeGroup ref="t:ag"/> + </complexType> + + <group name="eg"> + <choice> + <element name="efoo" type="string"> + <annotation> + <documentation>group element efoo documentation</documentation> + </annotation> + </element> + <element ref="t:ebar"/> + </choice> + </group> + + <element name="ebar" type="string"> + <annotation> + <documentation>global element ebar documentation</documentation> + </annotation> + </element> + + <attributeGroup name="ag"> + <attribute name="afoo" type="string"> + <annotation> + <documentation>group attribute afoo documentation</documentation> + </annotation> + </attribute> + <attribute ref="t:abaz"/> + </attributeGroup> + + <attribute name="abar" type="string"> + <annotation> + <documentation>global attribute abar documentation</documentation> + </annotation> + </attribute> + + <attribute name="abaz" type="string"> + <annotation> + <documentation>global attribute abaz documentation</documentation> + </annotation> + </attribute> + +</schema> |