diff options
Diffstat (limited to 'libxsd-frontend/tests/schema/attribute-group')
5 files changed, 114 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..00746a3 --- /dev/null +++ b/libxsd-frontend/tests/schema/attribute-group/makefile @@ -0,0 +1,34 @@ +# file      : tests/schema/attribute-group/makefile +# copyright : Copyright (c) 2006-2014 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> | 
