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/attribute-group |
Imported Upstream version 3.3.0.2upstream/3.3.0.2
Diffstat (limited to 'libxsd-frontend/tests/schema/attribute-group')
5 files changed, 115 insertions, 0 deletions
diff --git a/libxsd-frontend/tests/schema/attribute-group/makefile b/libxsd-frontend/tests/schema/attribute-group/makefile new file mode 100644 index 0000000..e96c0c7 --- /dev/null +++ b/libxsd-frontend/tests/schema/attribute-group/makefile @@ -0,0 +1,35 @@ +# file : tests/schema/attribute-group/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/attribute-group/test-000.std b/libxsd-frontend/tests/schema/attribute-group/test-000.std new file mode 100644 index 0000000..61ad802 --- /dev/null +++ b/libxsd-frontend/tests/schema/attribute-group/test-000.std @@ -0,0 +1,17 @@ +primary +{ + namespace test + { + complex type + { + optional attribute foo2 http://www.w3.org/2001/XMLSchema#string + required attribute bar2 http://www.w3.org/2001/XMLSchema#string + optional attribute foo3 http://www.w3.org/2001/XMLSchema#string + required attribute bar3 http://www.w3.org/2001/XMLSchema#string + } + attribute foo2 http://www.w3.org/2001/XMLSchema#string + attribute bar2 http://www.w3.org/2001/XMLSchema#string + attribute foo3 http://www.w3.org/2001/XMLSchema#string + attribute bar3 http://www.w3.org/2001/XMLSchema#string + } +} diff --git a/libxsd-frontend/tests/schema/attribute-group/test-000.xsd b/libxsd-frontend/tests/schema/attribute-group/test-000.xsd new file mode 100644 index 0000000..9087a2b --- /dev/null +++ b/libxsd-frontend/tests/schema/attribute-group/test-000.xsd @@ -0,0 +1,31 @@ +<?xml version="1.0"?> +<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:t="test" targetNamespace="test"> + + <!-- Multiple levels of forward reference. --> + + <complexType name="type"> + <attributeGroup ref="t:g1"/> + </complexType> + + <attributeGroup name="g1"> + <attributeGroup ref="t:g2"/> + <attributeGroup ref="t:g3"/> + </attributeGroup> + + <attributeGroup name="g2"> + <attribute ref="t:foo2"/> + <attribute ref="t:bar2" use="required"/> + </attributeGroup> + + <attributeGroup name="g3"> + <attribute ref="t:foo3"/> + <attribute ref="t:bar3" use="required"/> + </attributeGroup> + + <attribute name="foo2" type="string"/> + <attribute name="bar2" type="string"/> + + <attribute name="foo3" type="string"/> + <attribute name="bar3" type="string"/> + +</schema> diff --git a/libxsd-frontend/tests/schema/attribute-group/test-001.std b/libxsd-frontend/tests/schema/attribute-group/test-001.std new file mode 100644 index 0000000..54a1e96 --- /dev/null +++ b/libxsd-frontend/tests/schema/attribute-group/test-001.std @@ -0,0 +1,12 @@ +primary +{ + namespace test + { + complex type + { + any-attribute 'any-attribute #1' + optional attribute foo http://www.w3.org/2001/XMLSchema#string + any-attribute 'any-attribute #0' + } + } +} diff --git a/libxsd-frontend/tests/schema/attribute-group/test-001.xsd b/libxsd-frontend/tests/schema/attribute-group/test-001.xsd new file mode 100644 index 0000000..dc44a70 --- /dev/null +++ b/libxsd-frontend/tests/schema/attribute-group/test-001.xsd @@ -0,0 +1,20 @@ +<?xml version="1.0"?> +<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:t="test" targetNamespace="test"> + + <!-- AnyAttribute in attribute groups. --> + + <complexType name="type"> + <attributeGroup ref="t:g1"/> + <attributeGroup ref="t:g2"/> + </complexType> + + <attributeGroup name="g1"> + <anyAttribute namespace="http://www.foo.com"/> + </attributeGroup> + + <attributeGroup name="g2"> + <attribute name="foo" type="string"/> + <anyAttribute namespace="http://www.bar.com"/> + </attributeGroup> + +</schema> |