<?xml version="1.0"?>
<!-- 
    Copyright (C) 2006 W3C (R) (MIT ERCIM Keio), All Rights Reserved.
    W3C liability, trademark and document use rules apply.

    http://www.w3.org/Consortium/Legal/ipr-notice
    http://www.w3.org/Consortium/Legal/copyright-documents

    $Header: /w3ccvs/WWW/2002/ws/databinding/edcopy/patterns/patterns.xml,v 1.103 2008/02/13 17:05:47 pdowney Exp $
-->

<patterns xmlns="http://www.w3.org/2002/ws/databinding/patterns/6/09/" 
    xmlns:ex="http://www.w3.org/2002/ws/databinding/examples/6/09/" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

   <ns prefix="xs" uri="http://www.w3.org/2001/XMLSchema"/>
   <ns prefix="xsi" uri="http://www.w3.org/2001/XMLSchema-instance"/>
   <ns prefix="soap11enc" uri="http://schemas.xmlsoap.org/soap/envelope/"/>
   <ns prefix="soap11" uri="http://schemas.xmlsoap.org/soap/envelope/"/>
   <ns prefix="wsdl11" uri="http://schemas.xmlsoap.org/wsdl/"/>

   <ex:version>$Id: patterns.xml,v 1.103 2008/02/13 17:05:47 pdowney Exp $</ex:version>

  <group groupid="SchemaElement">
    <title>Schema Element</title>
  </group>

  <group groupid="Properties">
    <title>Properties</title>
  </group>

  <group groupid="Import">
    <title>Import and Include</title>
  </group>

   <group groupid="Group">
      <title>Group</title>
   </group>

   <group groupid="Unique">
      <title>Unique</title>
   </group>

   <group groupid="SimpleType">
    <title>SimpleType Declarations</title>
  </group>

  <group groupid="ElementPredefinedTypes">
    <title>Element Predefined Types</title>
  </group>

  <group groupid="AttributePredefinedTypes">
    <title>Attribute Predefined Types</title>
  </group>

  <group groupid="numbers">
    <title>Numbers</title>
  </group>

  <group groupid="restriction">
    <title>Restricted Schema Types</title>
  </group>

  <group groupid="enumerations">
    <title>EnumerationTypes</title>
  </group>

  <group groupid="GlobalElement">
    <title>Global Element Declarations</title>
  </group>

  <group groupid="GlobalAttribute">
    <title>Global Attribute Declarations</title>
  </group>

  <group groupid="GlobalComplexType">
    <title>Global ComplexType Declarations</title>
  </group>

  <group groupid="GlobalSimpleType">
    <title>Global SimpleType Declarations</title>
  </group>

  <group groupid="Element">
    <title>Element Declarations</title>
  </group>

  <group groupid="Attribute">
    <title>Attribute Declarations</title>
  </group>

  <group groupid="ComplexType">
    <title>ComplexType Declarations</title>
  </group>

  <group groupid="Sequence">
    <title>Sequences</title>
  </group>

  <group groupid="Unions">
    <title>Unions</title>
  </group>

  <group groupid="lists">
    <title>Lists</title>
  </group>

  <group groupid="Annotations">
    <title>Annotations</title>
  </group>

  <group groupid="Choice">
    <title>Choices</title> 
  </group>
   
  <group groupid="pending">
    <title>@@@ Catchall Patterns @@@</title>
    <definition>@@@ these patterns shouldn't appear in either the Basic or Advanced documents @@@</definition>
  </group>


   <pattern xml:id="TargetNamespace" status="basic" origin="ISSUE-27" groupid="SchemaElement">
	<!-- TBD - must be absolute for Basic -->
      <xpath>.[@targetNamespace]/
		(., @targetNamespace)</xpath>
   </pattern>

<!-- TBD - relative is Advanced 
   <pattern xml:id="TargetNamespaceRelative" status="advanced" origin="ISSUE-70" groupid="SchemaElement">
      <xpath>./[@targetNamespace match ""]/
		(., @targetNamespace)</xpath>
   </pattern>
-->

   <pattern xml:id="NoTargetNamespace" status="advanced" origin="ISSUE-27" groupid="SchemaElement">
      <xpath>.[not(@targetNamespace)]/
		(.)</xpath>
   </pattern>
   <pattern xml:id="QualifiedLocalElements" status="basic" origin="ISSUE-26" groupid="SchemaElement">
      <xpath>.[@elementFormDefault = 'qualified']/
		(@elementFormDefault)</xpath>
   </pattern>
   <pattern xml:id="UnqualifiedLocalElements" status="advanced" origin="ISSUE-26" groupid="SchemaElement">
      <xpath>.[not(@elementFormDefault) or @elementFormDefault = 'unqualified']/
		(., @elementFormDefault)</xpath>
   </pattern>
   <pattern xml:id="QualifiedLocalAttributes" status="advanced" origin="ISSUE-26" groupid="SchemaElement">
      <xpath>.[@attributeFormDefault = 'qualified']/
		(@attributeFormDefault)</xpath>
   </pattern>
   <pattern xml:id="UnqualifiedLocalAttributes" status="basic" origin="ISSUE-26" groupid="SchemaElement">
      <xpath>.[not(@attributeFormDefault) or @attributeFormDefault = 'unqualified']/
		(., @attributeFormDefault)</xpath>
   </pattern>

   <pattern xml:id="SchemaVersion" status="basic" origin="ISSUE-42" groupid="SchemaElement">
      <xpath>./@version</xpath>
   </pattern>

   <pattern xml:id="FinalDefault" status="basic" origin="ISSUE-83" groupid="SchemaElement">
      <xpath>./@finalDefault</xpath>
   </pattern>
   <pattern xml:id="BlockDefault" status="basic" origin="ISSUE-83" groupid="SchemaElement">
      <xpath>./@blockDefault</xpath>
   </pattern>


   <pattern xml:id="DocumentationElement" status="basic" origin="ISSUE-41" groupid="Annotations">
      <xpath>.//xs:annotation/xs:documentation/
		(.., ., .//*, .//@*)</xpath>
   </pattern>

   <pattern xml:id="AppinfoElement" status="advanced" origin="pending" groupid="Annotations">
      <xpath>.//xs:annotation/xs:appinfo/
		(.., ., .//*, .//@*)</xpath>
   </pattern>

   <!-- these patterns may allow @name values in unexpected places? -->
   <pattern xml:id="IdentifierName" status="basic" origin="ISSUE-10" groupid="Properties">
      <xpath>.//.[matches(@name, "^[A-Za-z_]([A-Za-z0-9_]{0,31})$")]/
		(@name)</xpath>
   </pattern>
   <pattern xml:id="NonIdentifierName" status="basic" origin="ISSUE-10" groupid="Properties">
      <xpath>.//.[@name and not(matches(@name, "^[A-Za-z_]([A-Za-z0-9_]{0,31})$"))]/
		(@name)</xpath>
   </pattern>


   <pattern xml:id="ImportTypesNamespace" status="basic" origin="ISSUE-39" groupid="Import">
      <xpath>.//xs:import[@namespace
		and not(@schemaLocation) 
		and (@namespace = ../../xs:schema/@targetNamespace)]/ 
		(., @namespace)</xpath>
   </pattern>
   <pattern xml:id="ImportNamespace" status="basic" origin="ISSUE-39" groupid="Import">
      <xpath>./xs:import[@namespace and not(@schemaLocation)
		and not(@namespace = 'http://www.w3.org/2001/XMLSchema')]/
		(., @namespace)</xpath>
   </pattern>
   <pattern xml:id="ImportSchema" status="basic" origin="ISSUE-39" groupid="Import">
      <xpath>./xs:import[@namespace and @schemaLocation]/
		(., @namespace, @schemaLocation)</xpath>
   </pattern>
   <pattern xml:id="ImportSchemaNamespace" status="advanced" origin="ISSUE-68" groupid="Import">
      <xpath>./xs:import[not(@schemaLocation)
		and @namespace = 'http://www.w3.org/2001/XMLSchema']/
		(., @namespace)</xpath>
   </pattern>

   <pattern xml:id="Include" status="basic" origin="ISSUE-57" groupid="Import">
      <xpath>./xs:include[@schemaLocation]/
		(., @schemaLocation)</xpath>
   </pattern>


   <pattern xml:id="GlobalElement" status="basic" origin="ISSUE-43" groupid="GlobalElement">
      <xpath>./xs:element[@name 
		and @type and contains(@type, ':')]/
		(., @name, @type)</xpath>
   </pattern>
   <pattern xml:id="GlobalElementUnqualifiedType" status="advanced" origin="ISSUE-43" groupid="GlobalElement">
      <xpath>./xs:element[@name 
		and @type and not(contains(@type, ':'))]/
		(., @name, @type)</xpath>
   </pattern>

   <pattern xml:id="GlobalAttribute" status="basic" origin="ISSUE-43" groupid="GlobalAttribute">
      <xpath>./xs:attribute[@name and @type and contains(@type, ":")]/
		(., @name, @type)</xpath>
   </pattern>
   <pattern xml:id="GlobalAttributeUnqualifiedType" status="advanced" origin="ISSUE-43" groupid="GlobalAttribute">
      <xpath>./xs:attribute[@name and @type and not(contains(@type, ':'))]/
		(., @name, @type)</xpath>
   </pattern>

   <pattern xml:id="GlobalAttributeSimpleType" status="advanced" origin="ISSUE-79" groupid="GlobalAttribute">
      <xpath>./xs:attribute/xs:simpleType/
		(../(., @name), .)</xpath>
   </pattern>

   <pattern xml:id="ElementTypeDefaultNamespace" status="advanced" origin="ISSUE-43" groupid="GlobalElement">
      <xpath>.//xs:element[@name and @type and not(contains(@type, ':'))]/
		(@name, @type)</xpath>
   </pattern>

   <pattern xml:id="NotMixed" status="basic" origin="ISSUE-23" groupid="Properties">
      <xpath>.//.[@mixed = 'false']/
		(@mixed)</xpath>
   </pattern>

   <pattern xml:id="MixedComplexContent" status="advanced" origin="ISSUE-23" groupid="Properties">
      <xpath>.//xs:complexContent[@mixed = 'true']/
		(@mixed)</xpath>
   </pattern>

   <pattern xml:id="MixedContentType" status="advanced" origin="ISSUE-23" groupid="Properties">
      <xpath>.//xs:complexType[@mixed = 'true']/
		(@mixed)</xpath>
   </pattern>

   <pattern xml:id="MinOccurs1" status="basic" origin="" groupid="Properties">
      <xpath>.//.[@minOccurs = '1']/
		(@minOccurs)</xpath>
   </pattern>

   <pattern xml:id="MaxOccurs1" status="basic" origin="" groupid="Properties">
      <xpath>.//.[@maxOccurs = '1']/
		(@maxOccurs)</xpath>
   </pattern>

   <pattern xml:id="Id" status="basic" origin="ISSUE-88" groupid="Properties">
     <xpath>.//@id</xpath>
   </pattern>



   <pattern xml:id="ElementMinOccurs0" status="basic" origin="ISSUE-37" groupid="Element">
      <xpath>.//xs:element[@minOccurs = '0' and (not(@maxOccurs) or @maxOccurs = '1')]/
		(@minOccurs, @maxOccurs)</xpath>
   </pattern>
   <pattern xml:id="ElementMinOccurs1" status="basic" origin="input" groupid="Element">
      <xpath>.//xs:element[@minOccurs = '1' and (not(@maxOccurs) or @maxOccurs = '1')]/
		(@minOccurs, @maxOccurs)</xpath>
   </pattern>
   <pattern xml:id="ElementMaxOccurs1" status="basic" origin="input" groupid="Element">
      <xpath>.//xs:element[(not(@minOccurs) or @minOccurs = '1') and @maxOccurs = '1']/
		(@minOccurs, @maxOccurs)</xpath>
   </pattern>

   <pattern xml:id="ElementMinOccurs0MaxOccursUnbounded" status="basic" origin="input" groupid="Element">
      <xpath>.//xs:element[@minOccurs = '0' and @maxOccurs = 'unbounded']/
		(@minOccurs, @maxOccurs)</xpath>
   </pattern>
   <pattern xml:id="ElementMinOccurs1MaxOccursUnbounded" status="basic" origin="ISSUE-32" groupid="Element">
      <xpath>.//xs:element[(not(@minOccurs) or @minOccurs = '1') and @maxOccurs = 'unbounded']/
		(@minOccurs, @maxOccurs)</xpath>
   </pattern>

   <pattern xml:id="ElementMinOccursFinite" status="advanced" origin="ISSUE-32" groupid="Element">
      <xpath>.//xs:element[xs:integer(@minOccurs) gt 1]/
		(@minOccurs, @maxOccurs)</xpath>
   </pattern>

   <pattern xml:id="ElementMinOccurs0MaxOccursFinite" status="advanced" origin="lc-psd-2" groupid="Element">
      <xpath>.//xs:element[@minOccurs = '0' and @maxOccurs and not(@maxOccurs = '0' or @maxOccurs = '1' or @maxOccurs = 'unbounded')]/
		(@minOccurs, @maxOccurs)</xpath>
   </pattern>

   <pattern xml:id="ElementMaxOccursFinite" status="advanced" origin="ISSUE-32" groupid="Element">
      <xpath>.//xs:element[@maxOccurs and not(@maxOccurs = '0' or @maxOccurs = '1' or @maxOccurs = 'unbounded')]/
		(@maxOccurs)</xpath>
   </pattern>

   <pattern xml:id="ElementFormQualified" status="basic" origin="ISSUE-26" groupid="Element">
      <xpath>.//xs:element[@form='qualified']/
		(@form)</xpath>
   </pattern>
   <pattern xml:id="ElementFormUnqualified" status="advanced" origin="ISSUE-26" groupid="Element">
      <xpath>.//xs:element[@form='unqualified']/
		(@form)</xpath>
   </pattern>

   <pattern xml:id="AttributeFormQualified" status="advanced" origin="ISSUE-26" groupid="Attribute">
      <xpath>.//xs:attribute[@form='qualified']/
		(@form)</xpath>
   </pattern>
   <pattern xml:id="AttributeFormUnqualified" status="basic" origin="ISSUE-26" groupid="Attribute">
      <xpath>.//xs:attribute[@form='unqualified']/
		(@form)</xpath>
   </pattern>


   <pattern xml:id="ElementDefault" status="advanced" origin="ISSUE-14" groupid="Attribute">
      <xpath>.//xs:element[@default]/
		(@default)</xpath>
   </pattern>
   <pattern xml:id="AttributeOptional" status="basic" origin="ISSUE-45" groupid="Attribute">
      <xpath>.//xs:attribute[@use = 'optional']/ 
		(@use)</xpath>
   </pattern>
   <pattern xml:id="AttributeRequired" status="advanced" origin="ISSUE-45" groupid="Attribute">
      <xpath>.//xs:attribute[@use = 'required']/ 
		(@use)</xpath>
   </pattern>
   <pattern xml:id="AttributeFixed" status="advanced" origin="ISSUE-46" groupid="Attribute">
      <xpath>.//xs:attribute[@fixed] / 
		(@fixed)</xpath>
   </pattern>
   <pattern xml:id="AttributeDefault" status="advanced" origin="ISSUE-14" groupid="Attribute">
      <xpath>.//xs:attribute[@default] / 
		(@default)</xpath>
   </pattern>

   <pattern xml:id="GlobalSimpleType" status="basic" origin="ISSUE-31" groupid="GlobalSimpleType">
      <xpath>./xs:simpleType[@name]/
		(., @name)</xpath>
   </pattern>

   <pattern xml:id="GlobalComplexType" status="basic" origin="input" groupid="GlobalComplexType">
      <xpath>./xs:complexType[@name]/
		(., @name)</xpath>
   </pattern>

   <pattern xml:id="GlobalComplexTypeAbstract" status="advanced" origin="ISSUE-80" groupid="GlobalComplexType">
      <xpath>./xs:complexType[@abstract='true']/
		(@abstract)</xpath>
   </pattern>
   <pattern xml:id="ComplexTypeConcrete" status="basic" origin="ISSUE-90" groupid="Properties">
     <xpath>.//xs:complexType[@abstract='false']/
		(@abstract)</xpath>
   </pattern>

   <pattern xml:id="GlobalElementAbstract" status="advanced" origin="ISSUE-81" groupid="GlobalElement">
      <xpath>./xs:element[@abstract='true']/
		(@abstract)</xpath>
   </pattern>
   <pattern xml:id="GlobalElementConcrete" status="basic" origin="ISSUE-90" groupid="Properties">
     <xpath>./xs:element[@abstract='false']/
		(@abstract)</xpath>
   </pattern>

   <pattern xml:id="GlobalElementBlock" status="basic" origin="ISSUE-89" groupid="GlobalElement">
      <xpath>./xs:element/
		(@block)</xpath>
   </pattern>

   <pattern xml:id="GlobalElementFinal" status="basic" origin="ISSUE-89" groupid="GlobalElement">
     <xpath>./xs:element/
		(@final)</xpath>
   </pattern>

   <pattern xml:id="GlobalComplexTypeBlock" status="basic" origin="ISSUE-90" groupid="GlobalComplexType">
      <xpath>./xs:complexType/ 
		(@block)</xpath>
   </pattern>
   <pattern xml:id="ElementFinal" status="basic" origin="ISSUE-90" groupid="Properties">
     <xpath>.//xs:element/
		(@final)</xpath>
   </pattern>

   <pattern xml:id="StringEnumerationType" status="basic" origin="ISSUE-31" groupid="SimpleType">
      <xpath>.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:string') and xs:enumeration]/
		(., @base, xs:enumeration/(., @value))</xpath>
   </pattern>

   <pattern xml:id="NMTOKENEnumerationType" status="advanced" origin="ISSUE-31" groupid="SimpleType">
      <xpath>.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:NMTOKEN') and xs:enumeration]/
		(., @base, xs:enumeration/(., @value))</xpath>
   </pattern>

   <pattern xml:id="IntEnumerationType" status="advanced" origin="ISSUE-31" groupid="SimpleType">
      <xpath>.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:int') and xs:enumeration]/
		(., @base, xs:enumeration/(., @value))</xpath>
   </pattern>
   <pattern xml:id="ShortEnumerationType" status="advanced" origin="ISSUE-31" groupid="SimpleType">
      <xpath>.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:short') and xs:enumeration]/
		(., @base, xs:enumeration/(., @value))</xpath>
   </pattern>
   <pattern xml:id="LongEnumerationType" status="advanced" origin="ISSUE-31" groupid="SimpleType">
      <xpath>.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:long') and xs:enumeration]/
		(., @base, xs:enumeration/(., @value))</xpath>
   </pattern>
   <pattern xml:id="DoubleEnumerationType" status="advanced" origin="ISSUE-31" groupid="SimpleType">
      <xpath>.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:double') and xs:enumeration]/
		(., @base, xs:enumeration/(., @value))</xpath>
   </pattern>
   <pattern xml:id="IntegerEnumerationType" status="advanced" origin="ISSUE-31" groupid="SimpleType">
      <xpath>.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:integer') and xs:enumeration]/
		(., @base, xs:enumeration/(., @value))</xpath>
   </pattern>
   <pattern xml:id="DecimalEnumerationType" status="advanced" origin="ISSUE-31" groupid="SimpleType">
      <xpath>.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:decimal') and xs:enumeration]/
		(., @base, xs:enumeration/(., @value))</xpath>
   </pattern>
   <pattern xml:id="FloatEnumerationType" status="advanced" origin="ISSUE-31" groupid="SimpleType">
      <xpath>.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:float') and xs:enumeration]/
		(., @base, xs:enumeration/(., @value))</xpath>
   </pattern>
   <pattern xml:id="NonNegativeIntegerEnumerationType" status="advanced" origin="ISSUE-31" groupid="SimpleType">
      <xpath>.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:nonNegativeInteger') and xs:enumeration]/
		(., @base, xs:enumeration/(., @value))</xpath>
   </pattern>
   <pattern xml:id="PositiveIntegerEnumerationType" status="advanced" origin="ISSUE-31" groupid="SimpleType">
      <xpath>.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:positiveInteger')
		and xs:enumeration]/
		(., @base, xs:enumeration/(., @value))</xpath>
   </pattern>
   <pattern xml:id="UnsignedIntEnumerationType" status="advanced" origin="ISSUE-31" groupid="SimpleType">
      <xpath>.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:unsignedInt') and xs:enumeration]/
		(., @base, xs:enumeration/(., @value))</xpath>
   </pattern>
   <pattern xml:id="UnsignedLongEnumerationType" status="advanced" origin="ISSUE-31" groupid="SimpleType">
      <xpath>.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:unsignedLong') and xs:enumeration]/
		(., @base, xs:enumeration/(., @value))</xpath>
   </pattern>
   <pattern xml:id="UnsignedShortEnumerationType" status="advanced" origin="ISSUE-31" groupid="SimpleType">
      <xpath>.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:unsignedShort') and xs:enumeration]/
		(., @base, xs:enumeration/(., @value))</xpath>
   </pattern>
   <pattern xml:id="TokenEnumerationType" status="advanced" origin="ISSUE-31" groupid="SimpleType">
      <xpath>.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:token') and xs:enumeration]/
         (., @base, xs:enumeration/(., @value))</xpath>
   </pattern>
   <pattern xml:id="LanguageEnumerationType" status="advanced" origin="ISSUE-31" groupid="SimpleType">
      <xpath>.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:language') and xs:enumeration]/
         (., @base, xs:enumeration/(., @value))</xpath>
   </pattern>
   
   <pattern xml:id="SimpleTypeEnumerationType" status="advanced" origin="pending" groupid="SimpleType">
      <xpath>.//xs:simpleType/xs:restriction[@base and
	    namespace-uri-from-QName(resolve-QName(@base,.)) != 'http://www.w3.org/2001/XMLSchema' ]/
		(., @base, xs:enumeration/(., @value))</xpath>
   </pattern>

   <pattern xml:id="ComplexTypeAll" status="advanced" origin="ISSUE-19" groupid="ComplexType">
      <xpath>.//xs:complexType/xs:all/
		(., xs:element/(., @name))</xpath>
   </pattern>
   <pattern xml:id="ComplexTypeChoice" status="advanced" origin="ISSUE-19" groupid="ComplexType">
      <xpath>.//xs:complexType/xs:choice/
		(., xs:element/(., @name))</xpath>
   </pattern>
   <pattern xml:id="ComplexTypeSequenceChoice" status="advanced" origin="ISSUE-54" groupid="Sequence">
      <xpath>.//xs:complexType/xs:sequence/xs:choice/
         (., xs:element/(., @name))</xpath>
   </pattern>
   
   <pattern xml:id="ComplexTypeAttribute" status="basic" origin="input" groupid="ComplexType">
      <xpath>.//xs:complexType/xs:attribute[@name]/
		(., @name)</xpath>
   </pattern>

   <pattern xml:id="ComplexTypeOnlyAttributes" status="advanced" origin="input" groupid="ComplexType">
      <xpath>.//xs:complexType/xs:attribute[../not(xs:choice or xs:sequence or xs:all or xs:anyAttribute or xs:group 
         or xs:attributeGroup or xs:simpleContent or xs:complexContent)]/
         (., ..,@use)</xpath>
   </pattern>
   
   <pattern xml:id="ComplexTypeOnlyAttributeGroup" status="advanced" origin="pending" groupid="ComplexType">
      <xpath>.//xs:complexType/xs:attributeGroup[../not(xs:choice or xs:sequence or xs:all or xs:anyAttribute 
         or xs:group or xs:simpleContent or xs:complexContent)]/(., ..,@ref)</xpath> 
   </pattern> 
   
   <pattern xml:id="ComplexTypeSequence" status="basic" origin="input" groupid="ComplexType">
      <xpath>.//xs:complexType/xs:sequence/
		(., xs:element/(., @name))</xpath>
   </pattern>

   <pattern xml:id="SequenceSequenceElement" status="basic" origin="ISSUE-96" groupid="Sequence">
	<xpath>.//xs:sequence/xs:sequence/xs:element/
		(., ..)</xpath>
    </pattern>

   <pattern xml:id="SequenceMinOccurs0" status="advanced" origin="ISSUE-96" groupid="Sequence">
      <xpath>.//xs:sequence[@minOccurs = '0' and (not(@maxOccurs) or @maxOccurs = '1')]/
		 (@minOccurs, @maxOccurs)</xpath>
   </pattern>
   <pattern xml:id="SequenceMinOccurs1" status="basic" origin="ISSUE-96" groupid="Sequence">
      <xpath>.//xs:sequence[@minOccurs = '1' and (not(@maxOccurs) or @maxOccurs = '1')]/
		 (@minOccurs, @maxOccurs)</xpath>
   </pattern>
   <pattern xml:id="SequenceMaxOccurs1" status="basic" origin="ISSUE-96" groupid="Sequence">
      <xpath>.//xs:sequence[(not(@minOccurs) or @minOccurs = '1') and @maxOccurs = '1']/
		 (@minOccurs, @maxOccurs)</xpath>
   </pattern>
   
   <pattern xml:id="SequenceMinOccurs0MaxOccursUnbounded" status="advanced" origin="ISSUE-96" groupid="Sequence">
      <xpath>.//xs:sequence[@minOccurs = '0' and @maxOccurs = 'unbounded']/
		 (@minOccurs, @maxOccurs)</xpath>
   </pattern>
   <pattern xml:id="SequenceMinOccurs1MaxOccursUnbounded" status="advanced" origin="ISSUE-96" groupid="Sequence">
      <xpath>.//xs:sequence[(not(@minOccurs) or @minOccurs = '1') and @maxOccurs = 'unbounded']/
		 (@minOccurs, @maxOccurs)</xpath>
   </pattern>
   
   <pattern xml:id="SequenceMinOccursFinite" status="advanced" origin="ISSUE-96" groupid="Sequence">
      <xpath>.//xs:sequence[xs:integer(@minOccurs) gt 1]/
		 (@minOccurs, @maxOccurs)</xpath>
   </pattern>
   <pattern xml:id="SequenceMaxOccursFinite" status="advanced" origin="ISSUE-96" groupid="Sequence">
      <xpath>.//xs:sequence[@maxOccurs and not(@maxOccurs = '0' or @maxOccurs = '1' or @maxOccurs = 'unbounded')]/
		 (@maxOccurs)</xpath>
   </pattern>

   <pattern xml:id="GlobalElementSequence" status="basic" origin="ISSUE-19" groupid="GlobalElement">
      <xpath>./xs:element[@name]/xs:complexType/xs:sequence[xs:element]/
		(../../(., @name), .., ., xs:element/(., @name))</xpath>
   </pattern>
   <pattern xml:id="GlobalElementAll" status="advanced" origin="ISSUE-19" groupid="GlobalElement">
      <xpath>./xs:element[@name]/xs:complexType/xs:all[xs:element]/
		(../../(., @name), .., ., xs:element/(., @name))</xpath>
   </pattern>
   <pattern xml:id="GlobalElementChoice" status="advanced" origin="ISSUE-19" groupid="GlobalElement">
      <xpath>./xs:element[@name]/xs:complexType/xs:choice[xs:element]/
		(../../(., @name), .., ., xs:element/(., @name))</xpath>
   </pattern>
   <pattern xml:id="GlobalElementSimpleType" status="advanced" origin="pending" groupid="GlobalElement">
      <xpath>./xs:element[@name]/xs:simpleType/
		(../(., @name), .)</xpath>
   </pattern>

   <pattern xml:id="GlobalElementSequenceAny" status="advanced" origin="pending" groupid="ComplexType">
      <xpath>./xs:element[@name]/xs:complexType/xs:sequence[xs:any and not(xs:element)]/
		(../../(., @name))</xpath>
   </pattern>

   <pattern xml:id="ComplexTypeAnyAttribute" status="advanced" origin="ISSUE-20" groupid="ComplexType">
	<xpath>.//xs:complexType/xs:anyAttribute</xpath>
   </pattern>

   <pattern xml:id="SimpleContentAnyAttribute" status="advanced" origin="pending" groupid="ComplexType">
	<xpath>.//xs:complexType/xs:simpleContent/xs:extension/xs:anyAttribute</xpath>
   </pattern>



   <pattern xml:id="AnyAttributeStrict" status="advanced" origin="ISSUE-20" groupid="ComplexType">
      <xpath>.//xs:complexType/xs:anyAttribute[(not(@processContents) or @processContents = 'strict')
	    and (not(@namespace) or @namespace = '##any')]/
	    (., @processContents, @namespace)</xpath>
   </pattern>
   <pattern xml:id="AnyAttributeLax" status="advanced" origin="ISSUE-20" groupid="ComplexType">
      <xpath>.//xs:complexType/xs:anyAttribute[(@processContents = 'lax')
	    and (not(@namespace) or @namespace = '##any')]/
	    (., @processContents, @namespace)</xpath>
   </pattern>
   <pattern xml:id="AnyAttributeSkip" status="advanced" origin="ISSUE-20" groupid="ComplexType">
      <xpath>.//xs:complexType/xs:anyAttribute[(@processContents = 'skip')
	    and (not(@namespace) or @namespace = '##any')]/
	    (., @processContents, @namespace)</xpath>
   </pattern>

   <pattern xml:id="AnyAttributeOtherStrict" status="advanced" origin="ISSUE-20" groupid="ComplexType">
      <xpath>.//xs:complexType/xs:anyAttribute[(not(@processContents) or @processContents = 'strict')
	    and (@namespace = '##other')]/
	    (., @processContents, @namespace)</xpath>
   </pattern>
   <pattern xml:id="AnyAttributeOtherLax" status="advanced" origin="ISSUE-20" groupid="ComplexType">
      <xpath>.//xs:complexType/xs:anyAttribute[(@processContents = 'lax')
	    and (@namespace = '##other')]/
	    (., @processContents, @namespace)</xpath>
   </pattern>
   <pattern xml:id="AnyAttributeOtherSkip" status="advanced" origin="ISSUE-20" groupid="ComplexType">
      <xpath>.//xs:complexType/xs:anyAttribute[(@processContents = 'skip')
	    and (@namespace = '##other')]/
	    (., @processContents, @namespace)</xpath>
   </pattern>


   <pattern xml:id="ExtendedSequenceStrict" status="advanced" origin="ISSUE-20" groupid="Sequence">
      <xpath>.//xs:sequence/xs:any[(not(@processContents) or @processContents = 'strict')
	    and (not (@minOccurs) or @minOccurs = '1' or @minOccurs = '0')
	    and (not (@maxOccurs) or @maxOccurs = '1' or @maxOccurs='unbounded')
	    and @namespace = '##targetNamespace']/
	    (., @processContents, @minOccurs, @maxOccurs, @namespace)</xpath>
   </pattern>
   <pattern xml:id="ExtendedSequenceLax" status="advanced" origin="ISSUE-20" groupid="Sequence">
      <xpath>.//xs:sequence/xs:any[@processContents = 'lax'
	    and (not (@minOccurs) or @minOccurs = '1' or @minOccurs = '0')
	    and (not (@maxOccurs) or @maxOccurs = '1' or @maxOccurs='unbounded')
	    and @namespace = '##targetNamespace']/
	    (., @processContents, @minOccurs, @maxOccurs, @namespace)</xpath>
   </pattern>
   <pattern xml:id="ExtendedSequenceSkip" status="advanced" origin="ISSUE-20" groupid="Sequence">
      <xpath>.//xs:sequence/xs:any[@processContents = 'skip'
	    and (not (@minOccurs) or @minOccurs = '1' or @minOccurs = '0')
	    and (not (@maxOccurs) or @maxOccurs = '1' or @maxOccurs='unbounded')
	    and @namespace = '##targetNamespace']/
	    (., @processContents, @minOccurs, @maxOccurs, @namespace)</xpath>
   </pattern>

   <pattern xml:id="ExtendedSequenceStrictAny" status="advanced" origin="ISSUE-20" groupid="Sequence">
      <xpath>.//xs:sequence/xs:any[(not(@processContents) or @processContents = 'strict')
	    and (not (@minOccurs) or @minOccurs = '1' or @minOccurs = '0')
	    and (not (@maxOccurs) or @maxOccurs = '1' or @maxOccurs='unbounded')
	    and (not(@namespace) or @namespace = '##any')]/
	    (., @processContents, @minOccurs, @maxOccurs, @namespace)</xpath>
   </pattern>
   <pattern xml:id="ExtendedSequenceLaxAny" status="advanced" origin="ISSUE-20" groupid="Sequence">
      <xpath>.//xs:sequence/xs:any[@processContents = 'lax'
	    and (not (@minOccurs) or @minOccurs = '1' or @minOccurs = '0')
	    and (not (@maxOccurs) or @maxOccurs = '1' or @maxOccurs='unbounded')
	    and (not(@namespace) or @namespace = '##any')]/
	    (., @processContents, @minOccurs, @maxOccurs, @namespace)</xpath>
   </pattern>
   <pattern xml:id="ExtendedSequenceSkipAny" status="advanced" origin="ISSUE-20" groupid="Sequence">
      <xpath>.//xs:sequence/xs:any[@processContents = 'skip'
	    and (not (@minOccurs) or @minOccurs = '1' or @minOccurs = '0')
	    and (not (@maxOccurs) or @maxOccurs = '1' or @maxOccurs='unbounded')
	    and (not(@namespace) or @namespace = '##any')]/
	    (., @processContents, @minOccurs, @maxOccurs, @namespace)</xpath>
   </pattern>

   <pattern xml:id="ExtendedSequenceStrictOther" status="advanced" origin="ISSUE-20" groupid="Sequence">
      <xpath>.//xs:sequence/xs:any[(not(@processContents) or @processContents = 'strict')
	    and (not (@minOccurs) or @minOccurs = '1' or @minOccurs = '0')
	    and (not (@maxOccurs) or @maxOccurs = '1' or @maxOccurs='unbounded')
	    and @namespace = '##other']/
	    (., @processContents, @minOccurs, @maxOccurs, @namespace)</xpath>
   </pattern>
   <pattern xml:id="ExtendedSequenceLaxOther" status="advanced" origin="ISSUE-20" groupid="Sequence">
      <xpath>.//xs:sequence/xs:any[@processContents = 'lax'
	    and (not (@minOccurs) or @minOccurs = '1' or @minOccurs = '0')
	    and (not (@maxOccurs) or @maxOccurs = '1' or @maxOccurs='unbounded')
	    and @namespace = '##other']/
	    (., @processContents, @minOccurs, @maxOccurs, @namespace)</xpath>
   </pattern>
   <pattern xml:id="ExtendedSequenceSkipOther" status="advanced" origin="ISSUE-20" groupid="Sequence">
      <xpath>.//xs:sequence/xs:any[@processContents = 'skip'
	    and (not (@minOccurs) or @minOccurs = '1' or @minOccurs = '0')
	    and (not (@maxOccurs) or @maxOccurs = '1' or @maxOccurs='unbounded')
	    and @namespace = '##other']/
	    (., @processContents, @minOccurs, @maxOccurs, @namespace)</xpath>
   </pattern>

   <pattern xml:id="SequenceAnyStrict" status="advanced" origin="pending" groupid="Sequence">
      <xpath>.//xs:sequence/xs:any[(not(@processContents) or @processContents = 'strict')
	    and (not (@minOccurs) or @minOccurs = '1' or @minOccurs = '0')
	    and (not (@maxOccurs) or @maxOccurs = '1' or @maxOccurs='unbounded')
	    and (not (@namespace) or @namespace = '##any')]/
	(., @processContents, @minOccurs, @maxOccurs, @namespace)</xpath>
   </pattern>

   <pattern xml:id="ExtendedSimpleContent" status="advanced" origin="ISSUE-47" groupid="ComplexType">
      <!-- TBD: should the base type be enumerated? -->
      <xpath>.//xs:complexType/xs:simpleContent/xs:extension[@base]/
	    (.., ., ./@base, xs:attribute/
		(., @name))</xpath>
   </pattern>

   <pattern xml:id="ChoiceSequence" status="advanced" origin="input" groupid="Choice">
      <xpath>.//xs:choice/xs:sequence/(.)</xpath>
   </pattern>
   <pattern xml:id="SequenceChoice" status="advanced" origin="input" groupid="Choice">
      <xpath>.//xs:sequence/xs:choice/(.)</xpath>
   </pattern>
   <pattern xml:id="ChoiceChoice" status="advanced" origin="input" groupid="Choice">
      <xpath>.//xs:choice/xs:choice/(.)</xpath>
   </pattern>
   <pattern xml:id="ChoiceElement" status="advanced" origin="input" groupid="Element">
      <xpath>.//xs:choice/xs:element/(.)</xpath>
   </pattern>
   <pattern xml:id="SequenceElement" status="basic" origin="input" groupid="Element">
      <xpath>.//xs:sequence/xs:element/(.)</xpath>
   </pattern>
   <pattern xml:id="AllElement" status="advanced" origin="input" groupid="Element">
      <xpath>.//xs:all/xs:element/(.)</xpath>
   </pattern>


   <pattern xml:id="SequenceSingleRepeatedElement" status="basic" origin="input" groupid="Element">
      <xpath>.//xs:sequence[count(xs:element) = 1]/xs:element[@maxOccurs = 'unbounded']/
		(., @maxOccurs)</xpath>
   </pattern>

   <pattern xml:id="NullEnumerationType" status="basic" origin="ISSUE-15" groupid="SimpleType">
      <xpath>.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:string') 
		and count(xs:enumeration) le 1 and xs:enumeration = '']/
		(@base, xs:enumeration/(., @value))</xpath>
   </pattern>

   <pattern xml:id="ElementEmptySequence" status="basic" origin="ISSUE-70" groupid="Element">
      <xpath>.//xs:element[@name]/xs:complexType/xs:sequence[not(node())]/
	    (., .., ../.., ../../@name)</xpath>
   </pattern>

   <pattern xml:id="ElementEmptyComplexType" status="basic" origin="ISSUE-15" groupid="Element">
      <xpath>.//xs:element[@name]/xs:complexType[not(node())]/
	    (., .., ../@name)</xpath>
   </pattern>

   <pattern xml:id="AttributeElementNameClash" status="advanced" origin="ISSUE-51" groupid="Element">
      <xpath>.//xs:complexType/xs:sequence/xs:element[@name = ../../xs:attribute/@name]/
	    (@name)</xpath>
   </pattern>

   <pattern xml:id="NillableElement" status="basic" origin="ISSUE-37" groupid="Element">
      <xpath>.//xs:element[@nillable = 'true' and not(@minOccurs = '0')]/
	    (@nillable)</xpath>
   </pattern>

   <pattern xml:id="NillableOptionalElement" status="advanced" origin="ISSUE-7" groupid="Element">
      <xpath>.//xs:element[@nillable = 'true' and @minOccurs = '0']/
	    (@nillable, @minOccurs)</xpath>
   </pattern>

   <pattern xml:id="NotNillableElement" status="basic" origin="ISSUE-7" groupid="Element">
      <xpath>.//xs:element[@nillable = 'false']/
	    (@nillable)</xpath>
   </pattern>

   <pattern xml:id="ElementTypeReference" status="basic" origin="ISSUE-48" groupid="Element">
      <xpath>.//xs:element[@name and @type 
	    and namespace-uri-from-QName(resolve-QName(@type,.)) != 'http://www.w3.org/2001/XMLSchema' 
	    and contains(@type, ':')]/
	    (., @name, @type)</xpath>
   </pattern>
   <pattern xml:id="ElementTypeReferenceUnqualified" status="advanced" origin="ISSUE-48" groupid="Element">
      <xpath>.//xs:element[@name and @type 
	    and namespace-uri-from-QName(resolve-QName(@type,.)) != 'http://www.w3.org/2001/XMLSchema' 
	    and not(contains(@type, ':'))]/
	    (., @name, @type)</xpath>
   </pattern>

   <pattern xml:id="ElementReference" status="basic" origin="ISSUE-48" groupid="Element">
      <xpath>.//xs:element[@ref and contains(@ref, ':')]/
	    (., @ref)</xpath>
   </pattern>
   <pattern xml:id="ElementReferenceUnqualified" status="advanced" origin="ISSUE-26" groupid="Element">
      <xpath>.//xs:element[@ref and not(contains(@ref, ':'))]/
	    (., @ref)</xpath>
   </pattern>

   <pattern xml:id="AttributeReference" status="basic" origin="ISSUE-60" groupid="Attribute">
      <xpath>.//xs:attribute[@ref and contains(@ref, ":")]/
	    (., @ref)</xpath>
   </pattern>
   <pattern xml:id="AttributeReferenceUnqualified" status="advanced" origin="ISSUE-26" groupid="Attribute">
      <xpath>.//xs:attribute[@ref and not(contains(@ref, ':'))]/
	    (., @ref)</xpath>
   </pattern>

   <pattern xml:id="AttributeTypeReference" status="basic" origin="ISSUE-48" groupid="Attribute">
      <xpath>.//xs:attribute[@name and @type 
	    and namespace-uri-from-QName(resolve-QName(@type,.)) != 'http://www.w3.org/2001/XMLSchema' 
	    and contains(@type, ':')]/
	    (., @name, @type)</xpath>
   </pattern>
   <pattern xml:id="AttributeTypeReferenceUnqualified" status="advanced" origin="ISSUE-48" groupid="Attribute">
      <xpath>.//xs:attribute[@name and @type 
	    and namespace-uri-from-QName(resolve-QName(@type,.)) != 'http://www.w3.org/2001/XMLSchema' 
	    and not(contains(@type, ':'))]/
		(., @name, @type)</xpath>
   </pattern>


   <pattern xml:id="UnionMemberTypes" status="advanced" origin="ISSUE-9" groupid="Unions">
      <xpath>.//xs:simpleType/xs:union[@memberTypes and not(xs:simpleType)]/
		(., @memberTypes)</xpath>
   </pattern>
   <pattern xml:id="UnionSimpleTypes" status="advanced" origin="ISSUE-64" groupid="Unions">
      <xpath>.//xs:simpleType/xs:union[not(@memberTypes)]/xs:simpleType/
		(.., .)</xpath>
   </pattern>
   <pattern xml:id="UnionSimpleAndMemberTypes" status="advanced" origin="ISSUE-9" groupid="Unions">
      <xpath>.//xs:simpleType/xs:union[@memberTypes and xs:simpleType]/
		(., @memberTypes, xs:simpleType)</xpath>
   </pattern>

   <pattern xml:id="List" status="advanced" origin="ISSUE-85" groupid="lists">
      <xpath>.//xs:list[@itemType]/
		(., @itemType)</xpath>
   </pattern>

   <pattern xml:id="AnySimpleTypeElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:anySimpleType')]</xpath>
   </pattern>
   <pattern xml:id="AnySimpleTypeAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:anySimpleType')]</xpath>
   </pattern>
   <pattern xml:id="AnyTypeElement" status="advanced" origin="ISSUE-50" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:anyType')]</xpath>
   </pattern>
   <pattern xml:id="StringElement" status="basic" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:string')]</xpath>
   </pattern>
   <pattern xml:id="StringAttribute" status="basic" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:string')]</xpath>
   </pattern>
   <pattern xml:id="BooleanElement" status="basic" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:boolean')]</xpath>
   </pattern>
   <pattern xml:id="BooleanAttribute" status="basic" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:boolean')]</xpath>
   </pattern>
   <pattern xml:id="DecimalElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:decimal')]</xpath>
   </pattern>
   <pattern xml:id="DecimalAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:decimal')]</xpath>
   </pattern>
   <pattern xml:id="FloatElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:float')]</xpath>
   </pattern>
   <pattern xml:id="FloatAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:float')]</xpath>
   </pattern>
   <pattern xml:id="DoubleElement" status="basic" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:double')]</xpath>
   </pattern>
   <pattern xml:id="DoubleAttribute" status="basic" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:double')]</xpath>
   </pattern>
   <pattern xml:id="DurationElement" status="advanced" origin="ISSUE-17" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:duration')]</xpath>
   </pattern>
   <pattern xml:id="DurationAttribute" status="advanced" origin="ISSUE-17" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:duration')]</xpath>
   </pattern>
   <pattern xml:id="DateTimeElement" status="basic" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:dateTime')]</xpath>
   </pattern>
   <pattern xml:id="DateTimeAttribute" status="basic" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:dateTime')]</xpath>
   </pattern>
   <pattern xml:id="TimeElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:time')]</xpath>
   </pattern>
   <pattern xml:id="TimeAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:time')]</xpath>
   </pattern>
   <pattern xml:id="DateElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:date')]</xpath>
   </pattern>
   <pattern xml:id="DateAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:date')]</xpath>
   </pattern>
   <pattern xml:id="GYearMonthElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:gYearMonth')]</xpath>
   </pattern>
   <pattern xml:id="GYearMonthAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:gYearMonth')]</xpath>
   </pattern>
   <pattern xml:id="GYearElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:gYear')]</xpath>
   </pattern>
   <pattern xml:id="GYearAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:gYear')]</xpath>
   </pattern>
   <pattern xml:id="GMonthDayElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:gMonthDay')]</xpath>
   </pattern>
   <pattern xml:id="GMonthDayAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:gMonthDay')]</xpath>
   </pattern>
   <pattern xml:id="GDayElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:gDay')]</xpath>
   </pattern>
   <pattern xml:id="GDayAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:gDay')]</xpath>
   </pattern>
   <pattern xml:id="GMonthElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:gMonth')]</xpath>
   </pattern>
   <pattern xml:id="GMonthAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:gMonth')]</xpath>
   </pattern>
   <pattern xml:id="HexBinaryElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:hexBinary')]</xpath>
   </pattern>
   <pattern xml:id="HexBinaryAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:hexBinary')]</xpath>
   </pattern>
   <pattern xml:id="Base64BinaryElement" status="basic" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:base64Binary')]</xpath>
   </pattern>
   <pattern xml:id="Base64BinaryAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:base64Binary')]</xpath>
   </pattern>
   <pattern xml:id="AnyURIElement" status="basic" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:anyURI')]</xpath>
   </pattern>
   <pattern xml:id="AnyURIAttribute" status="basic" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:anyURI')]</xpath>
   </pattern>
   <pattern xml:id="QNameElement" status="basic" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:QName')]</xpath>
   </pattern>
   <pattern xml:id="QNameAttribute" status="basic" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:QName')]</xpath>
   </pattern>
   <pattern xml:id="NormalizedStringElement" status="basic" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:normalizedString')]</xpath>
   </pattern>
   <pattern xml:id="NormalizedStringAttribute" status="basic" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:normalizedString')]</xpath>
   </pattern>
   <pattern xml:id="TokenElement" status="basic" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:token')]</xpath>
   </pattern>
   <pattern xml:id="TokenAttribute" status="basic" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:token')]</xpath>
   </pattern>
   <pattern xml:id="LanguageElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:language')]</xpath>
   </pattern>
   <pattern xml:id="LanguageAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:language')]</xpath>
   </pattern>
   <pattern xml:id="NMTOKENElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:NMTOKEN')]</xpath>
   </pattern>
   <pattern xml:id="NMTOKENAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:NMTOKEN')]</xpath>
   </pattern>
   <pattern xml:id="NMTOKENSElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:NMTOKENS')]</xpath>
   </pattern>
   <pattern xml:id="NMTOKENSAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:NMTOKENS')]</xpath>
   </pattern>
   <pattern xml:id="NameElement" status="basic" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:Name')]</xpath>
   </pattern>
   <pattern xml:id="NameAttribute" status="basic" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:Name')]</xpath>
   </pattern>
   <pattern xml:id="NCNameElement" status="basic" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:NCName')]</xpath>
   </pattern>
   <pattern xml:id="NCNameAttribute" status="basic" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:NCName')]</xpath>
   </pattern>
   <pattern xml:id="IDElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:ID')]</xpath>
   </pattern>
   <pattern xml:id="IDAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:ID')]</xpath>
   </pattern>
   <pattern xml:id="IDREFElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:IDREF')]</xpath>
   </pattern>
   <pattern xml:id="IDREFAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:IDREF')]</xpath>
   </pattern>
   <pattern xml:id="IDREFSElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:IDREFS')]</xpath>
   </pattern>
   <pattern xml:id="IDREFSAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:IDREFS')]</xpath>
   </pattern>
   <pattern xml:id="ENTITYElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:ENTITY')]</xpath>
   </pattern>
   <pattern xml:id="ENTITYAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:ENTITY')]</xpath>
   </pattern>
   <pattern xml:id="ENTITIESElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:ENTITIES')]</xpath>
   </pattern>
   <pattern xml:id="ENTITIESAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:ENTITIES')]</xpath>
   </pattern>
   <pattern xml:id="IntegerElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:integer')]</xpath>
   </pattern>
   <pattern xml:id="IntegerAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:integer')]</xpath>
   </pattern>
   <pattern xml:id="NonPositiveIntegerElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:nonPositiveInteger')]</xpath>
   </pattern>
   <pattern xml:id="NonPositiveIntegerAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:nonPositiveInteger')]</xpath>
   </pattern>
   <pattern xml:id="NegativeIntegerElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:negativeInteger')]</xpath>
   </pattern>
   <pattern xml:id="NegativeIntegerAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:negativeInteger')]</xpath>
   </pattern>
   <pattern xml:id="LongElement" status="basic" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:long')]</xpath>
   </pattern>
   <pattern xml:id="LongAttribute" status="basic" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:long')]</xpath>
   </pattern>
   <pattern xml:id="IntElement" status="basic" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:int')]</xpath>
   </pattern>
   <pattern xml:id="IntAttribute" status="basic" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:int')]</xpath>
   </pattern>
   <pattern xml:id="ShortElement" status="basic" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:short')]</xpath>
   </pattern>
   <pattern xml:id="ShortAttribute" status="basic" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:short')]</xpath>
   </pattern>
   <pattern xml:id="ByteElement" status="basic" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:byte')]</xpath>
   </pattern>
   <pattern xml:id="ByteAttribute" status="basic" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:byte')]</xpath>
   </pattern>
   <pattern xml:id="NonNegativeIntegerElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:nonNegativeInteger')]</xpath>
   </pattern>
   <pattern xml:id="NonNegativeIntegerAttribute" status="basic" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:nonNegativeInteger')]</xpath>
   </pattern>
   <pattern xml:id="UnsignedLongElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:unsignedLong')]</xpath>
   </pattern>
   <pattern xml:id="UnsignedLongAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:unsignedLong')]</xpath>
   </pattern>
   <pattern xml:id="UnsignedIntElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:unsignedInt')]</xpath>
   </pattern>
   <pattern xml:id="UnsignedIntAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:unsignedInt')]</xpath>
   </pattern>
   <pattern xml:id="UnsignedShortElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:unsignedShort')]</xpath>
   </pattern>
   <pattern xml:id="UnsignedShortAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:unsignedShort')]</xpath>
   </pattern>
   <pattern xml:id="UnsignedByteElement" status="advanced" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:unsignedByte')]</xpath>
   </pattern>
   <pattern xml:id="UnsignedByteAttribute" status="advanced" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:unsignedByte')]</xpath>
   </pattern>
   <pattern xml:id="PositiveIntegerElement" status="basic" origin="ISSUE-30" groupid="ElementPredefinedTypes">
      <xpath>.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:positiveInteger')]</xpath>
   </pattern>
   <pattern xml:id="PositiveIntegerAttribute" status="basic" origin="ISSUE-30" groupid="AttributePredefinedTypes">
      <xpath>.//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:positiveInteger')]</xpath>
   </pattern>

   <pattern xml:id="StringSimpleTypePattern" status="advanced" origin="ISSUE-8" groupid="restriction">
      <xpath>.//xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:string')]/xs:pattern[@value]/
		(.., ../@base, ., @value)</xpath>
   </pattern>
   <pattern xml:id="IntSimpleTypePattern" status="advanced" origin="ISSUE-8" groupid="restriction">
      <xpath>.//xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:int')]/xs:pattern[@value]/
		(.., ../@base, ., @value)</xpath>
   </pattern>
   <pattern xml:id="IntegerSimpleTypePattern" status="advanced" origin="ISSUE-8" groupid="restriction">
      <xpath>.//xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:integer')]/xs:pattern[@value]/
		(.., ../@base, ., @value)</xpath>
   </pattern>
   <pattern xml:id="LongSimpleTypePattern" status="advanced" origin="ISSUE-8" groupid="restriction">
      <xpath>.//xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:long')]/xs:pattern[@value]/
		(.., ../@base, ., @value)</xpath>
   </pattern>
   <pattern xml:id="DecimalSimpleTypePattern" status="advanced" origin="ISSUE-8" groupid="restriction">
      <xpath>.//xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:decimal')]/xs:pattern[@value]/
		(.., ../@base, ., @value)</xpath>
   </pattern>
   <pattern xml:id="FloatSimpleTypePattern" status="advanced" origin="ISSUE-8" groupid="restriction">
      <xpath>.//xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:float')]/xs:pattern[@value]/
		(.., ../@base, ., @value)</xpath>
   </pattern>
   <pattern xml:id="DoubleSimpleTypePattern" status="advanced" origin="ISSUE-8" groupid="restriction">
      <xpath>.//xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:double')]/xs:pattern[@value]/
		(.., ../@base, ., @value)</xpath>
   </pattern>
   <pattern xml:id="ShortSimpleTypePattern" status="advanced" origin="ISSUE-8" groupid="restriction">
      <xpath>.//xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:short')]/xs:pattern[@value]/
		(.., ../@base, ., @value)</xpath>
   </pattern>
   <pattern xml:id="ByteSimpleTypePattern" status="advanced" origin="input" groupid="restriction">
      <xpath>.//xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:byte')]/xs:pattern[@value]/
         (.., ../@base, ., @value)</xpath> 
   </pattern>   
   <pattern xml:id="NonNegativeIntegerSimpleTypePattern" status="advanced" origin="ISSUE-8" groupid="restriction">
      <xpath>.//xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:nonNegativeInteger')]/xs:pattern[@value]/
		(.., ../@base, ., @value)</xpath>
   </pattern>
   <pattern xml:id="PositiveIntegerSimpleTypePattern" status="advanced" origin="ISSUE-8" groupid="restriction">
      <xpath>.//xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:positiveInteger')]/xs:pattern[@value]/
		(.., ../@base, ., @value)</xpath>
   </pattern>
   <pattern xml:id="UnsignedLongSimpleTypePattern" status="advanced" origin="ISSUE-8" groupid="restriction">
      <xpath>.//xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:unsignedLong')]/xs:pattern[@value]/
		(.., ../@base, ., @value)</xpath>
   </pattern>
   <pattern xml:id="UnsignedIntSimpleTypePattern" status="advanced" origin="ISSUE-8" groupid="restriction">
      <xpath>.//xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:unsignedInt')]/xs:pattern[@value]/
		(.., ../@base, ., @value)</xpath>
   </pattern>
   <pattern xml:id="UnsignedShortSimpleTypePattern" status="advanced" origin="ISSUE-8" groupid="restriction">
      <xpath>.//xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:unsignedShort')]/xs:pattern[@value]/
		(.., ../@base, ., @value)</xpath>
   </pattern>
   <pattern xml:id="DateSimpleTypePattern" status="advanced" origin="ISSUE-8" groupid="restriction">
      <xpath>.//xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:date')]/xs:pattern[@value]/
         (.., ../@base, ., @value)</xpath>
   </pattern>
   <pattern xml:id="GYearSimpleTypePattern" status="advanced" origin="ISSUE-8" groupid="restriction">
      <xpath>.//xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:gYear')]/xs:pattern[@value]/
		(.., ../@base, ., @value)</xpath>
   </pattern>
   <pattern xml:id="GMonthSimpleTypePattern" status="advanced" origin="ISSUE-8" groupid="restriction">
      <xpath>.//xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:gMonth')]/xs:pattern[@value]/
		(.., ../@base, ., @value)</xpath>
   </pattern>
   <pattern xml:id="GDaySimpleTypePattern" status="advanced" origin="ISSUE-8" groupid="restriction">
      <xpath>.//xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:gDay')]/xs:pattern[@value]/
		(.., ../@base, ., @value)</xpath>
   </pattern>
   <pattern xml:id="GYearMonthSimpleTypePattern" status="advanced" origin="ISSUE-8" groupid="restriction">
      <xpath>.//xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:gYearMonth')]/xs:pattern[@value]/
		(.., ../@base, ., @value)</xpath>
   </pattern>
   <pattern xml:id="GMonthDaySimpleTypePattern" status="advanced" origin="ISSUE-8" groupid="restriction">
      <xpath>.//xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:gMonthDay')]/xs:pattern[@value]/
		(.., ../@base, ., @value)</xpath>
   </pattern>
   <pattern xml:id="TokenSimpleTypePattern" status="advanced" origin="input" groupid="restriction">
      <xpath>.//xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:token')]/xs:pattern[@value]/
         (.., ../@base, ., @value)</xpath> 
   </pattern>
   <pattern xml:id="RestrictedStringMinLength" status="advanced" origin="ISSUE-56" groupid="restriction">
      <xpath>.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:string')]/xs:minLength[@value]/
		(.., ../@base, ., @value)</xpath>
   </pattern>
   <pattern xml:id="RestrictedStringMaxLength" status="advanced" origin="ISSUE-56" groupid="restriction">
      <xpath>.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:string')]/xs:maxLength[@value]/
		(.., ../@base, ., @value)</xpath>
   </pattern>

   <pattern xml:id="RestrictedStringMinMaxLength" status="advanced" origin="ISSUE-56" groupid="restriction">
      <xpath>
	.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:string') 
		and xs:minLength/@value
		and xs:maxLength/@value]/
		(., @base, xs:minLength/(., @value), xs:maxLength/(., @value))
	</xpath>
   </pattern>

   <pattern xml:id="SimpleTypeRenamed" status="advanced" origin="pending" groupid="restriction">
      <xpath>.//xs:simpleType/xs:restriction[@base and count(./*) = 0]/
		(., @base)</xpath>
   </pattern>

   <pattern xml:id="RestrictedMinInclusive" status="advanced" origin="ISSUE-97" groupid="restriction">
      <xpath>.//xs:simpleType/xs:restriction/xs:minInclusive[@value]/(.., ../@base, ., @value)</xpath>
   </pattern>
   <pattern xml:id="RestrictedMaxInclusive" status="advanced" origin="ISSUE-97" groupid="restriction">
      <xpath>.//xs:simpleType/xs:restriction/xs:maxInclusive[@value]/(.., ../@base, ., @value)</xpath>
   </pattern>
   <pattern xml:id="RestrictedMinExclusive" status="advanced" origin="ISSUE-97" groupid="restriction">
      <xpath>.//xs:simpleType/xs:restriction/xs:minExclusive[@value]/(.., ../@base, ., @value)</xpath>
   </pattern>
   <pattern xml:id="RestrictedMaxExclusive" status="advanced" origin="ISSUE-97" groupid="restriction">
      <xpath>.//xs:simpleType/xs:restriction/xs:maxExclusive[@value]/(.., ../@base, ., @value)</xpath>
   </pattern>
   <pattern xml:id="RestrictedLength" status="advanced" origin="ISSUE-97" groupid="restriction">
      <xpath>.//xs:simpleType/xs:restriction/xs:length[@value]/(.., ../@base, ., @value)</xpath>
   </pattern>
   <pattern xml:id="RestrictedMaxLength" status="advanced" origin="ISSUE-101" groupid="restriction">
      <xpath>.//xs:simpleType/xs:restriction/xs:maxLength[@value]/(.., ../@base, ., @value)</xpath>
   </pattern>
   <pattern xml:id="RestrictedMinLength" status="advanced" origin="ISSUE-101" groupid="restriction">
      <xpath>.//xs:simpleType/xs:restriction/xs:minLength[@value]/(.., ../@base, ., @value)</xpath>
   </pattern>
   
   <pattern xml:id="ComplexTypeAttributeExtension" status="basic" origin="ISSUE-21" groupid="ComplexType">
      <xpath>.//xs:complexType/xs:complexContent[xs:extension[@base]/xs:attribute]/
		(., xs:extension/(., @base, xs:attribute/(., @name)))</xpath>
   </pattern>

   <pattern xml:id="ComplexTypeSequenceExtension" status="basic" origin="ISSUE-21" groupid="ComplexType">
      <xpath>.//xs:complexType/xs:complexContent[xs:extension[@base]/xs:sequence]/
		(., xs:extension/
		(., @base, xs:sequence/(., xs:element/(., @name))))</xpath>
   </pattern>

   <pattern xml:id="GlobalElementComplexTypeSequenceExtension" status="advanced" origin="ISSUE-21" groupid="GlobalElement">
      <xpath>./xs:element[@name]/xs:complexType/xs:complexContent[xs:extension[@base]/xs:sequence]/
		(../../(., @name), 
		.., ., 
		xs:extension/(., @base, 
		xs:sequence/(., xs:element/(., @name), 
		xs:attribute/(., @name))))</xpath>
   </pattern>

   <pattern xml:id="GlobalElementComplexTypeEmptyExtension" status="advanced" origin="pending" groupid="GlobalElement">
      <xpath>./xs:element[@name]/xs:complexType/xs:complexContent[xs:extension[@base]/not(*)]/
		(../../(., @name), .., ., xs:extension/(., @base))</xpath>
   </pattern>

   <pattern xml:id="GlobalComplexTypeEmptyExtension" status="advanced" origin="pending" groupid="GlobalComplexType">
      <xpath>./xs:complexType[@name]/xs:complexContent[xs:extension[@base]/not(*)]/
		(../../(., @name), .., ., xs:extension/(., @base))</xpath>
   </pattern>

   <pattern xml:id="PrecisionDecimal" status="advanced" origin="ISSUE-75" groupid="numbers">
      <xpath>.//xs:simpleType/xs:union[
	    xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:decimal')]/xs:totalDigits[@value ='16']
	    and xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:double')]
	    and xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:string') 
		    and xs:enumeration/@value='NaN' and xs:enumeration/@value='-INF' and not(xs:enumeration[3])]
	    and not(xs:simpleType[4] | xs:simpleType[@*])
	]/(., xs:simpleType/(., xs:restriction/(., @base, xs:totalDigits/(., @value), xs:enumeration/(., @value))))
      </xpath>
   </pattern>

   <pattern xml:id="LocalElementSimpleType" status="advanced" origin="pending" groupid="Element">
	<xpath>.//xs:element[not(parent::xs:schema)]/xs:simpleType</xpath>
   </pattern>
   <pattern xml:id="LocalElementComplexType" status="basic" origin="ISSUE-84" groupid="Element">
	<xpath>.//xs:element[not(parent::xs:schema)]/xs:complexType</xpath>
   </pattern>


<!--
	duplicate of ISSUE-76?
   <pattern xml:id="GlobalAttributeSimpleType" status="advanced" origin="ISSUE-86" groupid="Attribute">
     <xpath>./xs:attribute/xs:simpleType</xpath>
   </pattern>
-->

   <pattern xml:id="ChoiceMaxOccursUnbounded" status="advanced" origin="ISSUE-87" groupid="Choice">
     <xpath>.//xs:choice[@maxOccurs = 'unbounded']/
		(@maxOccurs) </xpath>
   </pattern>

   <pattern xml:id="ChoiceMaxOccursFinite" status="advanced" origin="pending" groupid="Choice">
      <xpath>.//xs:choice[@maxOccurs and not(@maxOccurs = '0' or @maxOccurs = '1' or @maxOccurs = 'unbounded')]/
         (@maxOccurs)</xpath>
   </pattern>
   
   <pattern xml:id="ChoiceMinOccurs0" status="advanced" origin="pending" groupid="Choice">
      <xpath>.//xs:choice[@minOccurs='0']/
         (@minOccurs) </xpath>
   </pattern>
   
   <pattern xml:id="ChoiceMinOccursFinite" status="advanced" origin="pending" groupid="Choice">
      <xpath>.//xs:choice[@minOccurs and not(@minOccurs = '0' or @minOccurs = '1')]/
         (@minOccurs)</xpath>
   </pattern>

   <pattern xml:id="LocalAttributeSimpleType" status="advanced" origin="ISSUE-86" groupid="Attribute">
     <xpath>.//xs:attribute[not(parent::xs:schema)]/xs:simpleType</xpath>
   </pattern>

   <pattern xml:id="SOAPEncodedArray" status="advanced" origin="pending" groupid="ComplexType">
     <xpath>./xs:complexType[@name]/xs:complexContent/xs:restriction[
	    @base/resolve-QName(.,..) = xs:QName('soap11enc:Array')]/
	    xs:attribute[(@ref/resolve-QName(.,..) = xs:QName('soap11enc:arrayType')) 
	    and @wsdl11:arrayType]/
	    (../.., ../(., @base), ., @ref, @wsdl11:arrayType)</xpath>
   </pattern>

   <pattern xml:id="DecimalSimpleTypeTotalDigits" status="advanced" origin="ISSUE-95" groupid="SimpleType">
      <xpath>.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:decimal') and xs:totalDigits/@value]/
	    (., @base, xs:totalDigits/(., @value))</xpath>
   </pattern>

   <pattern xml:id="DecimalSimpleTypeFractionDigits" status="advanced" origin="ISSUE-95" groupid="SimpleType">
      <xpath>.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:decimal') and xs:fractionDigits/@value]/
         (., @base, xs:fractionDigits/(., @value))</xpath>
   </pattern>

   <pattern xml:id="AttributeGroup" status="advanced" origin="ISSUE-59" groupid="Group">
      <xpath>.//xs:attributeGroup/(.,@name,@ref,xs:attribute)</xpath>
   </pattern>

   <pattern xml:id="ElementGroup" status="advanced" origin="pending" groupid="Group">
      <xpath>.//xs:group/(.,@name,@ref,xs:sequence,xs:all,xs:choice)</xpath>
   </pattern>
   
   <pattern xml:id="Unique" status="advanced" origin="input" groupid="Unique">
      <xpath>.//xs:unique/(.,xs:selector,xs:selector/@xpath,xs:field,xs:field/@xpath)</xpath> 
   </pattern>

   <pattern xml:id="SubstitutionGroup" status="advanced" origin="pending" groupid="Group">
      <xpath>.//xs:element[@substitutionGroup]/(.,@name,@substitutionGroup)</xpath> 
   </pattern>

</patterns>
