Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown xmlns prefix #15

Open
akbaruddink opened this issue Nov 2, 2020 · 6 comments
Open

Unknown xmlns prefix #15

akbaruddink opened this issue Nov 2, 2020 · 6 comments

Comments

@akbaruddink
Copy link

akbaruddink commented Nov 2, 2020

Not able to generate structs from xsd.

$ gocomply_xsd2go convert ~/Downloads/patent-document-v2.5\ 2/patent-document.xsd user.com/private ./go-type-from-xsd
Processing '/Users/mrkashif/Downloads/patent-document-v2.5 2/patent-document.xsd'
        Parsing: /Users/mrkashif/Downloads/patent-document-v2.5 2/patent-document.xsd
        Parsing: /Users/mrkashif/Downloads/patent-document-v2.5 2/citations.xsd
        Parsing: /Users/mrkashif/Downloads/patent-document-v2.5 2/patent-documents.xsd
        Parsing: /Users/mrkashif/Downloads/patent-document-v2.5 2/st32-merges.xsd
        Parsing: /Users/mrkashif/Downloads/patent-document-v2.5 2/xlink.xsd
        Parsing: /Users/mrkashif/Downloads/patent-document-v2.5 2/xml.xsd
panic: Internal error: Unknown xmlns prefix: 

goroutine 1 [running]:
github.com/gocomply/xsd2go/pkg/xsd.(*Schema).xmlnsByPrefix(...)
        /Users/mrkashif/go/pkg/mod/github.com/gocomply/[email protected]/pkg/xsd/schema.go:104
github.com/gocomply/xsd2go/pkg/xsd.(*Schema).findReferencedSchemaByPrefix(0xc00024c400, 0x0, 0x0, 0x1)
        /Users/mrkashif/go/pkg/mod/github.com/gocomply/[email protected]/pkg/xsd/schema.go:98 +0xe9
github.com/gocomply/xsd2go/pkg/xsd.(*Schema).findReferencedElement(0xc00024c400, 0xc000460eb0, 0xf, 0xc0002451a0)
        /Users/mrkashif/go/pkg/mod/github.com/gocomply/[email protected]/pkg/xsd/schema.go:71 +0x79
github.com/gocomply/xsd2go/pkg/xsd.(*Element).compile(0xc00046b380, 0xc00024c400, 0xc00046b200)
        /Users/mrkashif/go/pkg/mod/github.com/gocomply/[email protected]/pkg/xsd/element.go:145 +0x12d
github.com/gocomply/xsd2go/pkg/xsd.(*Sequence).compile(0xc0004521c0, 0xc00024c400, 0xc00046b200)
        /Users/mrkashif/go/pkg/mod/github.com/gocomply/[email protected]/pkg/xsd/sequence.go:21 +0x76
github.com/gocomply/xsd2go/pkg/xsd.(*ComplexType).compile(0xc000468480, 0xc00024c400, 0xc00046b200)
        /Users/mrkashif/go/pkg/mod/github.com/gocomply/[email protected]/pkg/xsd/types.go:69 +0x411
github.com/gocomply/xsd2go/pkg/xsd.(*Element).compile(0xc00046b200, 0xc00024c400, 0x0)
        /Users/mrkashif/go/pkg/mod/github.com/gocomply/[email protected]/pkg/xsd/element.go:130 +0xb3
github.com/gocomply/xsd2go/pkg/xsd.(*Schema).compile(0xc00024c400)
        /Users/mrkashif/go/pkg/mod/github.com/gocomply/[email protected]/pkg/xsd/schema.go:50 +0x59
github.com/gocomply/xsd2go/pkg/xsd.(*Workspace).loadXsd(0xc0000a31c0, 0xc00026c050, 0x45, 0x0, 0x0, 0x0)
        /Users/mrkashif/go/pkg/mod/github.com/gocomply/[email protected]/pkg/xsd/workspace.go:51 +0x394
github.com/gocomply/xsd2go/pkg/xsd.(*Import).load(0xc0000af560, 0xc0000a31c0, 0xc0000aa8c0, 0x30, 0xc000408090, 0x0)
        /Users/mrkashif/go/pkg/mod/github.com/gocomply/[email protected]/pkg/xsd/schema.go:256 +0xbe
github.com/gocomply/xsd2go/pkg/xsd.(*Workspace).loadXsd(0xc0000a31c0, 0xc0000aa8c0, 0x3e, 0x0, 0x0, 0x0)
        /Users/mrkashif/go/pkg/mod/github.com/gocomply/[email protected]/pkg/xsd/workspace.go:47 +0x32e
github.com/gocomply/xsd2go/pkg/xsd.(*Import).load(0xc0000af0e0, 0xc0000a31c0, 0x7ffeefbff6d0, 0x30, 0xc000408088, 0x0)
        /Users/mrkashif/go/pkg/mod/github.com/gocomply/[email protected]/pkg/xsd/schema.go:256 +0xbe
github.com/gocomply/xsd2go/pkg/xsd.(*Workspace).loadXsd(0xc0000a31c0, 0x7ffeefbff6d0, 0x44, 0x0, 0x0, 0x0)
        /Users/mrkashif/go/pkg/mod/github.com/gocomply/[email protected]/pkg/xsd/workspace.go:47 +0x32e
github.com/gocomply/xsd2go/pkg/xsd.NewWorkspace(0xc0000c0570, 0x23, 0x7ffeefbff6d0, 0x44, 0x2, 0xc0000c0570, 0x23)
        /Users/mrkashif/go/pkg/mod/github.com/gocomply/[email protected]/pkg/xsd/workspace.go:20 +0x8b
github.com/gocomply/xsd2go/pkg/xsd2go.Convert(0x7ffeefbff6d0, 0x44, 0x7ffeefbff715, 0x10, 0x7ffeefbff726, 0x12, 0xc0000bb748, 0x141e960)
        /Users/mrkashif/go/pkg/mod/github.com/gocomply/[email protected]/pkg/xsd2go/generate.go:12 +0x197
github.com/gocomply/xsd2go/cli/cmd.glob..func2(0xc0000ccdc0, 0x0, 0xc0000b9020)
        /Users/mrkashif/go/pkg/mod/github.com/gocomply/[email protected]/cli/cmd/cmd.go:33 +0x85
github.com/urfave/cli.HandleAction(0x13475a0, 0x13cb400, 0xc0000ccdc0, 0xc0000ccdc0, 0x0)
        /Users/mrkashif/go/pkg/mod/github.com/urfave/[email protected]/app.go:526 +0xfd
github.com/urfave/cli.Command.Run(0x13af1cb, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x13c29c9, 0x44, 0x0, ...)
        /Users/mrkashif/go/pkg/mod/github.com/urfave/[email protected]/command.go:174 +0x58e
github.com/urfave/cli.(*App).Run(0xc0000c8700, 0xc000136000, 0x5, 0x5, 0x0, 0x0)
        /Users/mrkashif/go/pkg/mod/github.com/urfave/[email protected]/app.go:279 +0x7e8
github.com/gocomply/xsd2go/cli/cmd.Execute(0xffffffff, 0xc00010e058)
        /Users/mrkashif/go/pkg/mod/github.com/gocomply/[email protected]/cli/cmd/cmd.go:18 +0x113
main.main()
        /Users/mrkashif/go/pkg/mod/github.com/gocomply/[email protected]/cli/gocomply_xsd2go/main.go:8 +0x25

patent-document.xsd

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:cit="http://alexandria.fairviewresearch.com/ns/cit/" xmlns:st32="http://alexandria.fairviewresearch.com/ns/st32/" xmlns:xlink="http://www.w3.org/1999/xlink">
  <xs:include schemaLocation="ext-dependencies.xsd"/>
  <xs:include schemaLocation="ifi-integrated-content.xsd"/>
  <xs:include schemaLocation="ifi-annotated-data.xsd"/>
  <xs:include schemaLocation="autags.xsd"/>
  <xs:import namespace="http://alexandria.fairviewresearch.com/ns/cit/" schemaLocation="citations.xsd"/>
  <xs:import namespace="http://alexandria.fairviewresearch.com/ns/st32/" schemaLocation="st32-merges.xsd"/>
  <!-- <xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="xlink.xsd"/> -->
  <!-- <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/> -->
  <xs:attributeGroup name="dfltattrs">
    <xs:attribute name="id" type="xs:ID"/>
    <!-- <xs:attribute name="mxw-id"/> -->
    <xs:attribute name="status" default="new">
      <xs:simpleType>
        <xs:restriction base="xs:token">
          <xs:enumeration value="n"/>
          <xs:enumeration value="new"/>
          <xs:enumeration value="c"/>
          <xs:enumeration value="corrected"/>
          <xs:enumeration value="d"/>
          <xs:enumeration value="deleted"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <!-- <xs:attribute name="load-source"/> -->
    <!-- <xs:attribute name="ref-ucid"/> -->
    <!-- <xs:attribute name="copyright-ref"/> -->
  </xs:attributeGroup>
  <!-- The contents of a paragraph or other block-level text element -->
  <xs:group name="ptext">
    <xs:sequence>
      <xs:choice minOccurs="0">
        <xs:element ref="b"/>
        <xs:element ref="i"/>
        <xs:element ref="u"/>
        <xs:element ref="o"/>
        <xs:element ref="sub"/>
        <xs:element ref="sup"/>
        <xs:element ref="smallcaps"/>
        <xs:element ref="br"/>
        <xs:element ref="pre"/>
        <xs:element ref="dl"/>
        <xs:element ref="ul"/>
        <xs:element ref="ol"/>
        <xs:element ref="sl"/>
        <xs:element ref="crossref"/>
        <xs:element ref="figref"/>
        <xs:group ref="cit:patcit"/>
        <xs:group ref="cit:nplcit"/>
        <xs:element ref="bio-deposit"/>
        <xs:element ref="img"/>
        <xs:element ref="imgref"/>
        <xs:element ref="chemistry"/>
        <xs:element ref="maths"/>
        <xs:element ref="tables"/>
        <xs:element ref="table-external-doc"/>
        <xs:element ref="sequence-cwu"/>
      </xs:choice>
    </xs:sequence>
  </xs:group>
  <!-- The contents of headings or other block-level elements -->
  <xs:group name="btext">
    <xs:sequence>
      <xs:choice minOccurs="0">
        <xs:element ref="img"/>
        <xs:element ref="imgref"/>
        <xs:element ref="b"/>
        <xs:element ref="i"/>
        <xs:element ref="u"/>
        <xs:element ref="o"/>
        <xs:element ref="sub"/>
        <xs:element ref="sup"/>
        <xs:element ref="smallcaps"/>
      </xs:choice>
    </xs:sequence>
  </xs:group>
  <xs:group name="nam">
    <xs:sequence>
      <xs:choice>
        <xs:element ref="name"/>
        <xs:sequence>
          <xs:element minOccurs="0" ref="prefix"/>
          <xs:choice>
            <xs:element ref="last-name"/>
            <xs:element ref="orgname"/>
          </xs:choice>
          <xs:element minOccurs="0" ref="first-name"/>
          <xs:element minOccurs="0" ref="middle-name"/>
          <xs:element minOccurs="0" ref="suffix"/>
          <xs:element minOccurs="0" ref="iid"/>
          <xs:element minOccurs="0" ref="role"/>
          <xs:element minOccurs="0" ref="orgname"/>
          <xs:element minOccurs="0" ref="department"/>
          <xs:element minOccurs="0" maxOccurs="unbounded" ref="synonym"/>
        </xs:sequence>
      </xs:choice>
      <xs:element minOccurs="0" ref="registered-number"/>
    </xs:sequence>
  </xs:group>
  <!--
    External dependenies
    These include Table and Math markup and all character references.
  -->
  <!-- The ST32 MATH and CHEM definitions -->
  <!-- Namespaces and elements defined above in st32-merges.dtd -->
  <xs:element name="st32math" abstract="true"/>
  <xs:element name="st32chem" abstract="true"/>
  <!-- The IFI integrated content definitions -->
  <!-- The IFI annotated data definitions -->
  <!-- AU register content definitions -->
  <!-- Content definitions for all elements related to citations -->
  <xs:element name="patent-document">
    <xs:complexType>
      <xs:choice>
        <xs:element maxOccurs="unbounded" ref="doc-page"/>
        <xs:sequence>
          <xs:element ref="bibliographic-data"/>
          <xs:element minOccurs="0" maxOccurs="unbounded" ref="abstract"/>
          <xs:element minOccurs="0" maxOccurs="unbounded" ref="description"/>
          <xs:element minOccurs="0" maxOccurs="unbounded" ref="claims"/>
          <xs:element minOccurs="0" maxOccurs="unbounded" ref="amended-claims"/>
          <xs:element minOccurs="0" maxOccurs="unbounded" ref="amended-claims-statement"/>
          <xs:element minOccurs="0" ref="drawings"/>
          <xs:element minOccurs="0" ref="attachments-external"/>
          <xs:element minOccurs="0" maxOccurs="unbounded" ref="search-report-data"/>
          <xs:element minOccurs="0" maxOccurs="unbounded" ref="keywords"/>
          <xs:element minOccurs="0" maxOccurs="unbounded" ref="legal-status"/>
          <xs:element minOccurs="0" ref="extended-patent-family"/>
          <xs:element minOccurs="0" ref="revision-history"/>
          <xs:element minOccurs="0" maxOccurs="unbounded" ref="copyright"/>
        </xs:sequence>
      </xs:choice>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="ucid" use="required"/>
      <xs:attribute name="file"/>
      <xs:attribute name="lang"/>
      <xs:attribute name="country" use="required"/>
      <xs:attribute name="doc-number" use="required"/>
      <xs:attribute name="kind"/>
      <xs:attribute name="date"/>
      <xs:attribute name="date-produced"/>
      <xs:attribute name="file-reference-id"/>
      <xs:attribute name="withdrawn">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="yes"/>
            <xs:enumeration value="no"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="family-id"/>
    </xs:complexType>
  </xs:element>
  <!--
    @ucid: unique identifier
    @file: internal (used by data provider)
    @lang: language of publication
    @country: originating office
    @doc-number: document publication number
    @kind: document kind code
    @date: date of publication
    @date-produced: internal (used by data provider)
    @family-id: DOCDB family identifer (use for grouping simple families)
    @file-reference-id: internal (used by data provider)
    @withdrawn: withdrawn status of document (yes is only value used)
    @family-id: DOCDB-provided indicator of family relationship. Integer value
                used to group members of a simple family
  -->
  <!--
    Used in EP/WO data for search-report section. WO also uses
    this element for references in the description and (amended) claims
    section of the document.
    @he: height
    @wi: width
    @type: image foramt
    @alt: descriptive text
    @pp: page range
    @ppf: first page
    @ppl: last page
    @file: relative location of external file
    @color: color or black and white page
                  NOTE: some US plant patents are color images
    @orientation: layout of page
  -->
  <xs:element name="doc-page">
    <xs:complexType>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="he" use="required"/>
      <xs:attribute name="wi" use="required"/>
      <xs:attribute name="type" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="jpg"/>
            <xs:enumeration value="pdf"/>
            <xs:enumeration value="tif"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="alt"/>
      <xs:attribute name="pp"/>
      <xs:attribute name="ppf"/>
      <xs:attribute name="ppl"/>
      <xs:attribute name="file" use="required"/>
      <xs:attribute name="color">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="color"/>
            <xs:enumeration value="bw"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="orientation" default="portrait">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="portrait"/>
            <xs:enumeration value="landscape"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="bibliographic-data">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="publication-reference"/>
        <xs:element minOccurs="0" ref="us-sir-flag"/>
        <xs:element minOccurs="0" ref="application-reference"/>
        <xs:element minOccurs="0" ref="priority-claims"/>
        <xs:element minOccurs="0" ref="dates-of-public-availability"/>
        <xs:element minOccurs="0" ref="rule-47-flag"/>
        <xs:element minOccurs="0" ref="term-of-grant"/>
        <xs:element minOccurs="0" ref="technical-data"/>
        <xs:element minOccurs="0" ref="related-documents"/>
        <xs:element minOccurs="0" ref="parties"/>
        <xs:element minOccurs="0" ref="international-convention-data"/>
        <xs:element minOccurs="0" ref="designated-states"/>
        <xs:element minOccurs="0" ref="office-specific-data"/>
        <xs:element minOccurs="0" ref="ifi-integrated-content"/>
        <xs:element minOccurs="0" ref="ifi-annotated-data"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="office-specific-data">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="autags"/>
        <xs:element ref="eptags"/>
        <xs:element ref="ustags"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="eptags">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="ep-no-a-document-published"/>
        <xs:element minOccurs="0" ref="ep-limitations"/>
        <xs:element minOccurs="0" ref="ep-petition-reviews"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="ep-no-a-document-published" type="xs:string"/>
  <xs:element name="ustags">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="us-gazette"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="us-gazette">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="us-adverse-decisions"/>
        <xs:element minOccurs="0" ref="us-certificates-of-correction"/>
        <xs:element minOccurs="0" ref="us-disclaimers"/>
        <xs:element minOccurs="0" ref="us-expirations"/>
        <xs:element minOccurs="0" ref="us-extensions"/>
        <xs:element minOccurs="0" ref="us-reexaminations"/>
        <xs:element minOccurs="0" ref="us-reinstatements"/>
        <xs:element minOccurs="0" ref="us-reissues"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="us-adverse-decisions">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="us-adverse-decision"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="us-adverse-decision">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
        <xs:element minOccurs="0" ref="number"/>
        <xs:element minOccurs="0" ref="text"/>
      </xs:sequence>
      <xs:attribute name="gazette-date" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="us-certificates-of-correction">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="us-certificate-of-correction"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="us-certificate-of-correction">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
      </xs:sequence>
      <xs:attribute name="gazette-date" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="us-disclaimers">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="us-disclaimer"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="us-disclaimer">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
        <xs:element minOccurs="0" ref="text"/>
      </xs:sequence>
      <xs:attribute name="gazette-date" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="us-expirations">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="us-expiration"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="us-expiration">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
      </xs:sequence>
      <xs:attribute name="gazette-date" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="us-extensions">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="us-extension"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="us-extension">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
        <xs:element minOccurs="0" ref="text"/>
        <xs:element minOccurs="0" ref="original-expiration-date"/>
        <xs:element minOccurs="0" ref="extended-expiration-date"/>
        <xs:element minOccurs="0" ref="product-name"/>
      </xs:sequence>
      <xs:attribute name="gazette-date" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="original-expiration-date" type="xs:string"/>
  <xs:element name="extended-expiration-date" type="xs:string"/>
  <xs:element name="product-name" type="xs:string"/>
  <xs:element name="us-reexaminations">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="us-reexamination"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="us-reexamination">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="application-reference"/>
        <xs:element minOccurs="0" ref="publication-reference"/>
        <xs:element minOccurs="0" ref="number"/>
        <xs:element minOccurs="0" ref="requester"/>
        <xs:element minOccurs="0" ref="text"/>
      </xs:sequence>
      <xs:attribute name="gazette-date" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="requester">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="addressbook"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="us-reinstatements">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="us-reinstatement"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="us-reinstatement">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
      </xs:sequence>
      <xs:attribute name="gazette-date" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="us-reissues">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="us-reissue"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="us-reissue">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="application-reference"/>
        <xs:element minOccurs="0" ref="publication-reference"/>
      </xs:sequence>
      <xs:attribute name="gazette-date" use="required"/>
    </xs:complexType>
  </xs:element>
  <!--
    @ucid: character identifier made up of country + document-number + kind,
           e.g., US-5551212-A; EP-0700000-B1
    @fvid: (internal) integer identifer used for QA/QC procedures
  -->
  <xs:element name="publication-reference">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="document-id"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="ucid" use="required"/>
      <xs:attribute name="fvid"/>
      <xs:attribute name="entity-status">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="micro"/>
            <xs:enumeration value="small"/>
            <xs:enumeration value="large"/>
            <xs:enumeration value="unknown"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <!--
    @appl-type: US application type. This is reserverd for US only
                but other values may be used in the future.
    @us-series-code: US-only
    @us-art-unit: US-only
    @is-representative: see DOCDB ST36
  -->
  <xs:element name="application-reference">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="document-id"/>
        <xs:element minOccurs="0" ref="effective-date"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="ucid"/>
      <xs:attribute name="appl-type"/>
      <xs:attribute name="us-series-code"/>
      <xs:attribute name="us-art-unit"/>
      <xs:attribute name="is-representative" default="NO">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="YES"/>
            <xs:enumeration value="NO"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="effective-date">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="priority-claims">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="priority-claim"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="priority-claim">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="document-id"/>
        <xs:element minOccurs="0" ref="office-of-filing"/>
        <xs:choice minOccurs="0">
          <xs:element ref="priority-doc-requested"/>
          <xs:element ref="priority-doc-attached"/>
        </xs:choice>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="ucid"/>
      <xs:attribute name="kind">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="national"/>
            <xs:enumeration value="regional"/>
            <xs:enumeration value="international"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="linkage-type"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="priority-doc-attached">
    <xs:complexType/>
  </xs:element>
  <xs:element name="priority-doc-requested">
    <xs:complexType/>
  </xs:element>
  <xs:element name="rule-47-flag">
    <xs:complexType/>
  </xs:element>
  <xs:element name="term-of-grant">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="text"/>
        <xs:element ref="disclaimer"/>
        <xs:element ref="length-of-grant"/>
        <xs:element ref="us-term-extension"/>
        <xs:element ref="lapse-of-patent"/>
      </xs:choice>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="disclaimer">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="date"/>
        <xs:element minOccurs="0" ref="text"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="length-of-grant" type="xs:string"/>
  <xs:element name="us-term-extension" type="xs:string"/>
  <xs:element name="lapse-of-patent">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="document-id"/>
        <xs:element minOccurs="0" ref="text"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <!--
    With the exception of gazette-date, one of the following dates
    will be identical to publication-reference/date.
    Individual usage depends on publication-reference/kind
    
    US (1836-1999):
        A, S, P
        H, E, I    (granted-publication-date)
    
       (2000-Present):
        B1, B2,
        P2, P3
        S1, E1
        H1         (granted-publication-date)
    
        A1, P1     (application-publication)
        A2         (republication-date)
        A9         (corrected-publication-date)
    
    EP
        A1, A2     (application-publication-date)
        A3         (search-report-publication-date)
        A8         (amended-publication-date)
        A9         (corrected-publication-date)
        B1         (grant-publication-date)
        B2         (republication-date)
        B8         (amended-publication-date)
        B9         (corrected-publication-date)
    
    WO
        A1, A2     (application-publication-date)
        A3         (search-report-publication-date)
        A8         (amended-publication-date)
        A9         (corrected-publication-date)
  -->
  <xs:element name="dates-of-public-availability">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="gazette-date"/>
        <xs:element minOccurs="0" ref="application-publication-date"/>
        <xs:element minOccurs="0" ref="grant-publication-date"/>
        <xs:element minOccurs="0" ref="intention-to-grant-date"/>
        <xs:element minOccurs="0" ref="registered-date"/>
        <xs:element minOccurs="0" ref="republication-date"/>
        <xs:element minOccurs="0" ref="search-report-publication-date"/>
        <xs:element minOccurs="0" ref="search-report-dispatch-date"/>
        <xs:element minOccurs="0" ref="corrected-search-report-dispatch-date"/>
        <xs:element minOccurs="0" ref="coming-into-force-date"/>
        <xs:element minOccurs="0" ref="preceding-publication-date"/>
        <xs:element minOccurs="0" ref="amended-publication-date"/>
        <xs:element minOccurs="0" ref="corrected-publication-date"/>
        <xs:element minOccurs="0" ref="declassified-date"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="gazette-date">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
        <xs:element minOccurs="0" ref="bulletin-number"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="application-publication-date">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
        <xs:element minOccurs="0" ref="bulletin-number"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="grant-publication-date">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
        <xs:element minOccurs="0" ref="bulletin-number"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="intention-to-grant-date">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
        <xs:element minOccurs="0" ref="bulletin-number"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="registered-date">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
        <xs:element minOccurs="0" ref="bulletin-number"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="republication-date">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
        <xs:element minOccurs="0" ref="bulletin-number"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="search-report-publication-date">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
        <xs:element minOccurs="0" ref="bulletin-number"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="search-report-dispatch-date">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
        <xs:element minOccurs="0" ref="bulletin-number"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="corrected-search-report-dispatch-date">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
        <xs:element minOccurs="0" ref="bulletin-number"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="coming-into-force-date">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
        <xs:element minOccurs="0" ref="bulletin-number"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="preceding-publication-date">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
        <xs:element minOccurs="0" ref="bulletin-number"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="amended-publication-date">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
        <xs:element minOccurs="0" ref="bulletin-number"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="corrected-publication-date">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
        <xs:element minOccurs="0" ref="bulletin-number"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="declassified-date">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
        <xs:element minOccurs="0" ref="bulletin-number"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="technical-data">
    <xs:complexType>
      <xs:sequence>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element ref="classification-ipc"/>
          <xs:element ref="classification-locarno"/>
        </xs:choice>
        <xs:element minOccurs="0" ref="classifications-ipcr"/>
        <xs:element minOccurs="0" ref="classification-national"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="classification-ecla"/>
        <xs:element minOccurs="0" ref="classifications-cpc"/>
        <xs:element minOccurs="0" ref="f-term-info"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="invention-title"/>
        <xs:group minOccurs="0" ref="cit:citations"/>
        <xs:element minOccurs="0" ref="figures"/>
        <xs:element minOccurs="0" ref="field-of-search"/>
        <xs:element minOccurs="0" ref="statistical-information"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="classification-ipc">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="edition"/>
        <xs:element ref="main-classification"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="further-classification"/>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element ref="additional-info"/>
          <xs:element ref="linked-indexing-code-group"/>
          <xs:element ref="unlinked-indexing-code"/>
        </xs:choice>
        <xs:element minOccurs="0" ref="text"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="edition" type="xs:string"/>
  <xs:element name="main-classification">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="jp-facet"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="further-classification">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="jp-facet"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="additional-info">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="linked-indexing-code-group">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="main-linked-indexing-code"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="sub-linked-indexing-code"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="group" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="main-linked-indexing-code">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="sub-linked-indexing-code">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="unlinked-indexing-code">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <!-- For US design patents only. -->
  <xs:element name="classification-locarno">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="edition"/>
        <xs:element ref="main-classification"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="further-classification"/>
        <xs:element minOccurs="0" ref="text"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="classifications-ipcr">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="classification-ipcr"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="classifications-ipcr-original">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="classification-ipcr"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <!--
    <!ATTLIST classifications-ipcr-original
      as-of-date CDATA #REQUIRED
    >
  -->
  <xs:element name="classifications-ipcr-current">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="classification-ipcr"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="classification-ipcr">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="sequence"/>
    </xs:complexType>
  </xs:element>
  <!--
    This element will appear mainly in US data and DOCDB (US, GB and CA).
    US data will make use of '(main|further)-classification' and
    DOCDB will be limited to the 'text' child. Where DOCDB delivers
    US classes (country=US) and there are classifications from USPTO,
    USPTO classes will be preferred and delivered and DOCDB US classes
    will be suppressed.
  -->
  <xs:element name="classification-national">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="edition"/>
        <xs:element minOccurs="0" ref="main-classification"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="further-classification"/>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element ref="additional-info"/>
          <xs:element ref="linked-indexing-code-group"/>
          <xs:element ref="unlinked-indexing-code"/>
        </xs:choice>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="text"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="country" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="classification-national-original">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="classification-national"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="classification-national-current">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="classification-national"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="classification-ecla">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="classification-symbol"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="classification-symbol">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="dfltattrs"/>
      <!-- <xs:attribute name="country"/> -->
      <xs:attribute name="scheme" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="EC"/>
            <xs:enumeration value="ICO"/>
            <xs:enumeration value="IDT"/>
            <xs:enumeration value="ECNO"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="classifications-cpc">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="classification-cpc"/>
        <xs:element minOccurs="0" ref="combination-sets"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="classification-cpc">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="scheme" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="CPC"/>
            <xs:enumeration value="CPCNO"/>
            <xs:enumeration value="CPCI"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="rank"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="combination-sets">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="combination-set"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="combination-set">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="classification-cpc"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="group" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="f-term-info">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="f-terms"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="f-terms">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="theme-code"/>
        <xs:element maxOccurs="unbounded" ref="f-term"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="f-term">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="theme-code" type="xs:string"/>
  <xs:element name="invention-title">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="lang" use="required"/>
    </xs:complexType>
  </xs:element>
  <!-- information about drawings and figures -->
  <xs:element name="figures">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="number-of-drawing-sheets"/>
        <xs:element minOccurs="0" ref="number-of-figures"/>
        <xs:element minOccurs="0" ref="figure-to-publish"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="number-of-drawing-sheets" type="xs:string"/>
  <xs:element name="number-of-figures" type="xs:string"/>
  <xs:element name="figure-to-publish" type="xs:string"/>
  <!-- search classifications -->
  <xs:element name="field-of-search">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="classification-national"/>
        <xs:element ref="classification-ipc"/>
        <xs:element ref="classifications-cpc"/>
        <xs:element ref="classification-locarno"/>
        <xs:element ref="classifications-ipcr"/>
      </xs:choice>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="statistical-information">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="number-of-pages"/>
        <xs:element minOccurs="0" ref="number-of-claims"/>
        <xs:element minOccurs="0" ref="exemplary-claim"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="number-of-pages" type="xs:string"/>
  <xs:element name="number-of-claims" type="xs:string"/>
  <xs:element name="exemplary-claim" type="xs:string"/>
  <xs:element name="related-documents">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="relation"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <!--
    ST32 Equivalence:
    previously-filed-application     => b270
    addition                         => b610
    division                         => b620
    division-into                    => b620ep
    continuation                     => b631
    continuation-in-part             => b632
    continuing-reissue               => b633
    reissue                          => b640
    us-divisional-reissue            => b641us
    reexamination                    => b645
    us-reexamination-reissue-merger  => b645us
    substitution                     => b660
    correction                       => b665
    utility-model-basis              => b670
    us-provisional-application       => b680
    related-publication              => b690
  -->
  <xs:element name="relation">
    <xs:complexType>
      <xs:choice>
        <xs:element maxOccurs="unbounded" ref="document-id"/>
        <xs:sequence>
          <xs:element ref="child-doc"/>
          <xs:element ref="parent-doc"/>
        </xs:sequence>
      </xs:choice>
      <xs:attribute name="type" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="a-371-of-international"/>
            <xs:enumeration value="addition"/>
            <xs:enumeration value="continuation"/>
            <xs:enumeration value="continuation-in-part"/>
            <xs:enumeration value="continuing-reissue"/>
            <xs:enumeration value="correction"/>
            <xs:enumeration value="division"/>
            <xs:enumeration value="division-into"/>
            <xs:enumeration value="later-filed-application"/>
            <xs:enumeration value="previously-filed-application"/>
            <xs:enumeration value="provisional"/>
            <xs:enumeration value="reexamination"/>
            <xs:enumeration value="reissue"/>
            <xs:enumeration value="related-publication"/>
            <xs:enumeration value="substitution"/>
            <xs:enumeration value="us-divisional-reissue"/>
            <xs:enumeration value="us-provisional-application"/>
            <xs:enumeration value="us-reexamination-reissue-merger"/>
            <xs:enumeration value="utility-model-basis"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="parent-doc">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="document-id"/>
        <xs:element minOccurs="0" ref="parent-grant-document"/>
        <xs:element minOccurs="0" ref="parent-pct-document"/>
      </xs:sequence>
      <xs:attribute name="ucid" use="required"/>
      <xs:attribute name="psta" default="unknown">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="granted"/>
            <xs:enumeration value="pending"/>
            <xs:enumeration value="abandoned"/>
            <xs:enumeration value="SIR"/>
            <xs:enumeration value="unknown"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="cpa">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="yes"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="parent-grant-document">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="document-id"/>
      </xs:sequence>
      <xs:attribute name="ucid" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="parent-pct-document">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="document-id"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="child-pct-document">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="document-id"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="child-doc">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="document-id"/>
        <xs:element minOccurs="0" ref="child-pct-document"/>
      </xs:sequence>
      <xs:attribute name="ucid" use="required"/>
    </xs:complexType>
  </xs:element>
  <!-- Attributes used to define data format of party -->
  <xs:simpleType name="fmtattrs">
    <xs:restriction base="xs:token">
      <xs:enumeration value="original"/>
      <xs:enumeration value="standard"/>
      <xs:enumeration value="epo"/>
      <xs:enumeration value="uspto"/>
      <xs:enumeration value="intermediate"/>
      <xs:enumeration value="original-translated"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="parties">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="applicants"/>
        <xs:element minOccurs="0" ref="inventors"/>
        <xs:element minOccurs="0" ref="assignees"/>
        <xs:element minOccurs="0" ref="assignee-history"/>
        <xs:element minOccurs="0" ref="correspondence-address"/>
        <xs:element minOccurs="0" ref="agents"/>
        <xs:element minOccurs="0" ref="examiners"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="applicants">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="applicant"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="applicant">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="addressbook"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="format" default="original" type="fmtattrs"/>
      <xs:attribute name="sequence"/>
      <xs:attribute name="applicant-category"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="inventors">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="inventor"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="inventor">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="addressbook"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="format" default="original" type="fmtattrs"/>
      <xs:attribute name="sequence"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="assignees">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="assignee"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <!--
    @us-assignee-type: for assignee type, one of the following codes is used.
      - 01 Unassigned
      - 02 United States company or corporation
      - 03 Foreign company or corporation
      - 04 United States individual
      - 05 Foreign individual
      - 06 U.S. Federal government
      - 07 Foreign government
      - 08 U.S. county government
      - 09 U.S. state government
  -->
  <xs:element name="assignee">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="addressbook"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="format" default="original" type="fmtattrs"/>
      <xs:attribute name="us-assignee-type"/>
      <xs:attribute name="sequence"/>
      <xs:attribute name="enabled"/>
      <xs:attribute name="disabled"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="assignors">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="assignor"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="assignor">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="addressbook"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="format" default="original" type="fmtattrs"/>
      <xs:attribute name="sequence"/>
      <xs:attribute name="execution-date"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="assignee-history" type="reassignments"/>
  <xs:complexType name="reassignments">
    <xs:sequence>
      <xs:element ref="reassignments"/>
    </xs:sequence>
  </xs:complexType>
  <xs:element name="reassignments">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="reassignment"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <!--
    Although reassignment information is available as a legal status
    event from PRS (EPO) data, the timeliness and completeness is
    very questionable.
    
    Each reassignment element corresponds to an entry in the reel/frame
    delivery of the USPTO Daily Reassignment data feed.
  -->
  <xs:element name="reassignment">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="assignees"/>
        <xs:element ref="assignors"/>
        <xs:element minOccurs="0" ref="correspondence-address"/>
        <xs:element minOccurs="0" ref="conveyance"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="reel-frame"/>
      <xs:attribute name="recorded-date" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="conveyance" type="xs:string"/>
  <xs:element name="agents">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="agent"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="agent">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="addressbook"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="format" default="original" type="fmtattrs"/>
      <xs:attribute name="sequence"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="correspondence-address">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="addressbook"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="format" default="original" type="fmtattrs"/>
      <xs:attribute name="sequence"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="examiners">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="examiner"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="examiner">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="addressbook"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="examiner-level" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="primary"/>
            <xs:enumeration value="assistant"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="format" default="original" type="fmtattrs"/>
      <xs:attribute name="sequence"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="name" type="xs:string"/>
  <xs:element name="prefix" type="xs:string"/>
  <xs:element name="last-name" type="xs:string"/>
  <xs:element name="orgname" type="xs:string"/>
  <xs:element name="first-name" type="xs:string"/>
  <xs:element name="middle-name" type="xs:string"/>
  <xs:element name="suffix" type="xs:string"/>
  <xs:element name="iid" type="xs:string"/>
  <xs:element name="role" type="xs:string"/>
  <xs:element name="department" type="xs:string"/>
  <xs:element name="synonym" type="xs:string"/>
  <xs:element name="registered-number" type="xs:string"/>
  <xs:complexType name="adr">
    <xs:choice>
      <xs:sequence>
        <xs:element minOccurs="0" ref="address-1"/>
        <xs:element minOccurs="0" ref="address-2"/>
        <xs:element minOccurs="0" ref="address-3"/>
        <xs:element minOccurs="0" ref="mailcode"/>
        <xs:element minOccurs="0" ref="pobox"/>
        <xs:element minOccurs="0" ref="room"/>
        <xs:element minOccurs="0" ref="address-floor"/>
        <xs:element minOccurs="0" ref="building"/>
        <xs:element minOccurs="0" ref="street"/>
        <xs:element minOccurs="0" ref="city"/>
        <xs:element minOccurs="0" ref="county"/>
        <xs:element minOccurs="0" ref="state"/>
        <xs:element minOccurs="0" ref="postcode"/>
        <xs:element minOccurs="0" ref="country"/>
        <xs:element minOccurs="0" ref="administrative-division"/>
      </xs:sequence>
      <xs:element ref="text"/>
    </xs:choice>
  </xs:complexType>
  <xs:element name="address-1" type="xs:string"/>
  <xs:element name="address-2" type="xs:string"/>
  <xs:element name="address-3" type="xs:string"/>
  <xs:element name="mailcode" type="xs:string"/>
  <xs:element name="pobox" type="xs:string"/>
  <xs:element name="room" type="xs:string"/>
  <xs:element name="address-floor" type="xs:string"/>
  <xs:element name="building" type="xs:string"/>
  <xs:element name="street" type="xs:string"/>
  <xs:element name="city" type="xs:string"/>
  <xs:element name="county" type="xs:string"/>
  <xs:element name="state" type="xs:string"/>
  <xs:element name="postcode" type="xs:string"/>
  <xs:element name="administrative-division" type="xs:string"/>
  <!-- country defined below -->
  <!-- text defined below -->
  <xs:element name="address" type="adr"/>
  <xs:element name="addressbook">
    <xs:complexType>
      <xs:choice>
        <xs:sequence>
          <xs:group ref="nam"/>
          <xs:element minOccurs="0" ref="address"/>
          <xs:element minOccurs="0" maxOccurs="unbounded" ref="phone"/>
          <xs:element minOccurs="0" maxOccurs="unbounded" ref="fax"/>
          <xs:element minOccurs="0" maxOccurs="unbounded" ref="email"/>
          <xs:element minOccurs="0" maxOccurs="unbounded" ref="url"/>
          <xs:element minOccurs="0" maxOccurs="unbounded" ref="ead"/>
          <xs:element minOccurs="0" ref="dtext"/>
        </xs:sequence>
        <xs:element ref="text"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="phone" type="xs:string"/>
  <xs:element name="fax" type="xs:string"/>
  <xs:element name="email" type="xs:string"/>
  <xs:element name="url" type="xs:string"/>
  <xs:element name="ead" type="xs:string"/>
  <!-- dtext defined below -->
  <!-- text defined below -->
  <xs:element name="international-convention-data">
    <xs:complexType>
      <xs:sequence>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element ref="pct-or-regional-filing-data"/>
          <xs:element ref="pct-or-regional-publishing-data"/>
        </xs:choice>
        <xs:element minOccurs="0" ref="designated-states"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="pct-or-regional-filing-data">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="document-id"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="national-entry-date"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="ucid" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="national-entry-date">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
      </xs:sequence>
      <xs:attribute name="type"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="pct-or-regional-publishing-data">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="document-id"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="ucid" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="designated-states">
    <xs:complexType>
      <xs:sequence>
        <xs:choice>
          <xs:element ref="pct-designated-states"/>
          <xs:element ref="ep-contracting-states"/>
        </xs:choice>
        <xs:element minOccurs="0" ref="ep-extended-states"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="pct-designated-states">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="country"/>
        <xs:element ref="regional"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="ep-contracting-states">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="country"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="ep-extended-states">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="ep-extended-state-data"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="ep-extended-state-data">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="country"/>
        <xs:element minOccurs="0" ref="date"/>
        <xs:element minOccurs="0" ref="withdrawal-date"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="withdrawal-date">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <!--
    DE T document additional info
    Coming soon...
  -->
  <!-- <!ELEMENT translation-data > -->
  <xs:element name="document-id">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="country"/>
        <xs:element minOccurs="0" ref="doc-number"/>
        <xs:element minOccurs="0" ref="kind"/>
        <xs:element minOccurs="0" ref="name"/>
        <xs:element minOccurs="0" ref="date"/>
        <xs:element minOccurs="0" ref="dtext"/>
        <xs:element minOccurs="0" ref="lang"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="format" default="original">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="original"/>
            <xs:enumeration value="standard"/>
            <xs:enumeration value="epo"/>
            <xs:enumeration value="uspto"/>
            <xs:enumeration value="mxw-std"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="sequence"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="regional">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="country"/>
      </xs:sequence>
      <xs:attribute name="region" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="country">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="region" type="xs:string"/>
  <xs:element name="doc-number" type="xs:string"/>
  <xs:element name="kind" type="xs:string"/>
  <xs:element name="date" type="xs:string"/>
  <xs:element name="bulletin-number" type="xs:string"/>
  <xs:element name="dtext" type="xs:string"/>
  <xs:element name="text" type="xs:string"/>
  <xs:element name="lang" type="xs:string"/>
  <xs:element name="office-of-filing">
    <xs:complexType>
      <xs:choice>
        <xs:sequence>
          <xs:element ref="region"/>
          <xs:element minOccurs="0" ref="country"/>
        </xs:sequence>
        <xs:element ref="country"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <!-- Country specific ... -->
  <xs:element name="us-sir-flag">
    <xs:complexType/>
  </xs:element>
  <!-- Textual Markup -->
  <xs:element name="abstract">
    <xs:complexType>
      <xs:choice>
        <xs:sequence>
          <xs:element ref="abst-problem"/>
          <xs:element ref="abst-solution"/>
        </xs:sequence>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element ref="heading"/>
          <xs:element ref="p"/>
          <xs:element ref="img"/>
          <xs:element ref="imgref"/>
        </xs:choice>
      </xs:choice>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="lang" use="required"/>
      <xs:attribute name="source"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="abst-problem">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="p"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="abst-solution">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="p"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="description">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="invention-title"/>
        <xs:choice maxOccurs="unbounded">
          <xs:element ref="technical-field"/>
          <xs:element ref="background-art"/>
          <xs:element ref="disclosure"/>
          <xs:element ref="description-of-drawings"/>
          <xs:element ref="best-mode"/>
          <xs:element ref="mode-for-invention"/>
          <xs:element ref="industrial-applicability"/>
          <xs:element ref="summary-of-invention"/>
          <xs:element ref="description-of-embodiments"/>
          <xs:element ref="reference-signs-list"/>
          <xs:element ref="reference-to-deposited-biological-material"/>
          <xs:element ref="citation-list"/>
          <xs:element ref="sequence-list-text"/>
          <xs:choice minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="heading"/>
            <xs:element ref="img"/>
            <xs:element ref="imgref"/>
            <xs:element ref="p"/>
          </xs:choice>
        </xs:choice>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="lang" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="technical-field">
    <xs:complexType>
      <xs:sequence maxOccurs="unbounded">
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="heading"/>
        <xs:element maxOccurs="unbounded" ref="p"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="background-art">
    <xs:complexType>
      <xs:sequence maxOccurs="unbounded">
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="heading"/>
        <xs:element maxOccurs="unbounded" ref="p"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="disclosure">
    <xs:complexType>
      <xs:choice>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element ref="tech-problem"/>
          <xs:element ref="tech-solution"/>
          <xs:element ref="advantageous-effects"/>
        </xs:choice>
        <xs:sequence maxOccurs="unbounded">
          <xs:element minOccurs="0" maxOccurs="unbounded" ref="heading"/>
          <xs:element maxOccurs="unbounded" ref="p"/>
        </xs:sequence>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="tech-problem">
    <xs:complexType>
      <xs:sequence maxOccurs="unbounded">
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="heading"/>
        <xs:element maxOccurs="unbounded" ref="p"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="tech-solution">
    <xs:complexType>
      <xs:sequence maxOccurs="unbounded">
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="heading"/>
        <xs:element maxOccurs="unbounded" ref="p"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="advantageous-effects">
    <xs:complexType>
      <xs:sequence maxOccurs="unbounded">
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="heading"/>
        <xs:element maxOccurs="unbounded" ref="p"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="description-of-drawings">
    <xs:complexType>
      <xs:sequence maxOccurs="unbounded">
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="heading"/>
        <xs:element maxOccurs="unbounded" ref="p"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="best-mode">
    <xs:complexType>
      <xs:sequence maxOccurs="unbounded">
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="heading"/>
        <xs:element maxOccurs="unbounded" ref="p"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="mode-for-invention">
    <xs:complexType>
      <xs:sequence maxOccurs="unbounded">
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="heading"/>
        <xs:element maxOccurs="unbounded" ref="p"/>
      </xs:sequence>
      <xs:attribute name="mode-num"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="industrial-applicability">
    <xs:complexType>
      <xs:sequence maxOccurs="unbounded">
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="heading"/>
        <xs:element maxOccurs="unbounded" ref="p"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="sequence-list-text">
    <xs:complexType>
      <xs:sequence maxOccurs="unbounded">
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="heading"/>
        <xs:element maxOccurs="unbounded" ref="p"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <!--
    BEGIN: new description sub-sections delivered by JPO
    NOTE: this is a bonus for USA-Redbook as summary-of-invention
          was disallowed until now
  -->
  <xs:element name="summary-of-invention">
    <xs:complexType>
      <xs:choice maxOccurs="unbounded">
        <xs:element ref="tech-problem"/>
        <xs:element ref="tech-solution"/>
        <xs:element ref="advantageous-effects"/>
        <xs:sequence maxOccurs="unbounded">
          <xs:element minOccurs="0" maxOccurs="unbounded" ref="heading"/>
          <xs:element minOccurs="0" maxOccurs="unbounded" ref="p"/>
        </xs:sequence>
      </xs:choice>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="description-of-embodiments">
    <xs:complexType>
      <xs:choice maxOccurs="unbounded">
        <xs:element ref="embodiments-example"/>
        <xs:sequence maxOccurs="unbounded">
          <xs:element minOccurs="0" maxOccurs="unbounded" ref="heading"/>
          <xs:element minOccurs="0" maxOccurs="unbounded" ref="p"/>
        </xs:sequence>
      </xs:choice>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="embodiments-example">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="p"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="ex-num"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="reference-signs-list">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="p"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="reference-to-deposited-biological-material">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="p"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="citation-list">
    <xs:complexType>
      <xs:choice maxOccurs="unbounded">
        <xs:element ref="patent-literature"/>
        <xs:element ref="non-patent-literature"/>
        <xs:sequence maxOccurs="unbounded">
          <xs:element minOccurs="0" maxOccurs="unbounded" ref="heading"/>
          <xs:element minOccurs="0" maxOccurs="unbounded" ref="p"/>
        </xs:sequence>
      </xs:choice>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="patent-literature">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="p"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="non-patent-literature">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="p"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <!-- END: new description sub-sections delivered by JPO -->
  <xs:element name="claims">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="claim-statement"/>
        <xs:element maxOccurs="unbounded" ref="claim"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="lang" use="required"/>
      <xs:attribute name="claim-type"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="claim-statement">
    <xs:complexType mixed="true">
      <xs:group minOccurs="0" maxOccurs="unbounded" ref="ptext"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="claim">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="claim-text"/>
      </xs:sequence>
      <xs:attribute name="id" type="xs:ID"/>
      <xs:attribute name="num"/>
      <xs:attribute name="claim-type"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="claim-text">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:group ref="ptext"/>
        <xs:element ref="st32chem"/>
        <xs:element ref="st32math"/>
        <xs:element ref="claim-text"/>
        <xs:element ref="claim-ref"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="claim-ref">
    <xs:complexType mixed="true">
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="claim-text"/>
      </xs:sequence>
      <xs:attribute name="idref" use="required" type="xs:IDREF"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="amended-claims">
    <xs:complexType>
      <xs:sequence maxOccurs="unbounded">
        <xs:element minOccurs="0" ref="heading"/>
        <xs:element maxOccurs="unbounded" ref="claim"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="amended-claims-statement"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="lang" use="required"/>
      <!-- <xs:attribute name="country"/> -->
      <xs:attribute name="amended-claim-type"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="amended-claims-statement">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="claims-statement"/>
      </xs:sequence>
      <xs:attribute name="id" type="xs:ID"/>
      <xs:attribute name="lang"/>
      <xs:attribute name="status"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="claims-statement">
    <xs:complexType>
      <xs:sequence maxOccurs="unbounded">
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="heading"/>
        <xs:element maxOccurs="unbounded" ref="p"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="drawings">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="figure"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="lang"/>
    </xs:complexType>
  </xs:element>
  <!--
    Search report data
    @srep-office 'EP'
    @date-produced: date finished by examiner
    @srep-type: determines layout of search report
        - epo-srep => normal layout
        - ep-Rule45partial => pre-EPC 2000
        - ep-Rule45declaration => layout for declaration, no citations
        - isr International Search Report layout
  -->
  <xs:element name="search-report-data">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="doc-page"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="lang"/>
      <xs:attribute name="srep-office"/>
      <xs:attribute name="date-produced"/>
      <xs:attribute name="srep-type"/>
    </xs:complexType>
  </xs:element>
  <!-- Keywords -->
  <xs:element name="keywords">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="keyword-set"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="lang" use="required"/>
      <xs:attribute name="format" default="original" type="fmtattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="keyword-set">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="keyword"/>
      </xs:sequence>
      <xs:attribute name="technical-field"/>
      <xs:attribute name="subjects-number"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="keyword">
    <xs:complexType mixed="true">
      <xs:attribute name="sequence"/>
      <xs:attribute name="pfq"/>
      <xs:attribute name="dvalue"/>
    </xs:complexType>
  </xs:element>
  <!-- Legal Status -->
  <xs:element name="legal-status">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="legal-event"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="legal-event">
    <xs:complexType>
      <xs:choice minOccurs="0">
        <xs:element ref="dtext"/>
        <xs:element ref="legal-event-body"/>
      </xs:choice>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="code" use="required"/>
      <xs:attribute name="country" use="required"/>
      <xs:attribute name="date" use="required"/>
      <xs:attribute name="impact"/>
      <xs:attribute name="class"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="legal-event-body">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="event-title"/>
        <xs:element minOccurs="0" ref="event-attributes"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="event-title" type="xs:string"/>
  <xs:element name="event-attributes">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="event-attribute"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="event-attribute">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="event-attribute-label"/>
        <xs:element ref="event-attribute-value"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="event-attribute-label" type="xs:string"/>
  <xs:element name="event-attribute-value" type="xs:string"/>
  <!-- currently unused -->
  <xs:element name="extended-patent-family">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="patent-family"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="patent-family">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="publication-reference"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="family-id" use="required"/>
    </xs:complexType>
  </xs:element>
  <!-- Revision History -->
  <xs:element name="revision-history">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="revision"/>
      </xs:sequence>
      <xs:attribute name="id"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="revision">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="previous-value"/>
        <xs:element ref="current-value"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="previous-value" type="xs:string"/>
  <xs:element name="current-value" type="xs:string"/>
  <xs:element name="copyright">
    <xs:complexType mixed="true">
      <xs:attribute name="copyright-id"/>
    </xs:complexType>
  </xs:element>
  <!--
    Data issues: these are produced on-demand and
    are currently not part of the standard XML data
    generation
  -->
  <xs:element name="data-issues">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="data-issue"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="data-issue">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="data-issue-level"/>
        <xs:element ref="data-issue-description"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="data-issue-level" type="xs:string"/>
  <xs:element name="data-issue-description" type="xs:string"/>
  <!--
    Limitations and Petitions
    See: http://www.epo.org/patents/law/legal-texts/html/epc/2000/e/contents.html
  -->
  <xs:element name="ep-limitations">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="ep-limitation-procedure"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="ep-limitation-procedure">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="ep-limitation-filing"/>
        <xs:element minOccurs="0" ref="ep-limitation-rejection"/>
        <xs:element minOccurs="0" ref="ep-limitation-allowed"/>
        <xs:element minOccurs="0" ref="ep-limitation-decision"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="limitation-sequence"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="ep-limitation-filing">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="ep-limitation-date"/>
        <xs:element ref="ep-limitation-filing-kind"/>
        <xs:element ref="ep-limitation-filing-decision"/>
        <xs:element ref="ep-limitation-payment-date"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="ep-limitation-date">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <!--
    01 = filed during oppoistion
    02 = filed after opposition
  -->
  <xs:element name="ep-limitation-filing-kind" type="xs:string"/>
  <!--
    01 = admissible
    02 = inadmissible
    03 = deemed not filed
    04  = deemed not filed, opposition pending
    05 = withdrawn
  -->
  <xs:element name="ep-limitation-filing-decision" type="xs:string"/>
  <xs:element name="ep-limitation-payment-date">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="ep-limitation-rejection">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="ep-limitation-rejection-kind"/>
        <xs:element ref="ep-limitation-rejection-dispatch-date"/>
        <xs:element ref="ep-limitation-rejection-legal-date"/>
        <xs:element ref="ep-limitation-rejection-bulletin-number"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <!--
    01 = substantive refusal
    02 = inadmissible for formal reasons (R.94)
    03 = no (late) reply to subset report
    04 = RALL (request allowed) requirements not fulfilled
  -->
  <xs:element name="ep-limitation-rejection-kind" type="xs:string"/>
  <xs:element name="ep-limitation-rejection-dispatch-date">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="ep-limitation-rejection-legal-date">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="ep-limitation-rejection-bulletin-number">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="bnum"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="ep-limitation-allowed">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="ep-limitation-allowed-dispatch-date"/>
        <xs:element ref="ep-limitation-allowed-trans-date"/>
        <xs:element ref="ep-limitation-allowed-payment-date"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="ep-limitation-allowed-dispatch-date">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="ep-limitation-allowed-trans-date">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="ep-limitation-allowed-payment-date">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="ep-limitation-decision">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="kind"/>
        <xs:element ref="date"/>
        <xs:element ref="bnum"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="limitation-sequence"/>
    </xs:complexType>
  </xs:element>
  <!-- ep-petition-reviews -->
  <xs:element name="ep-petition-reviews">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="ep-petition-review"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="ep-petition-review">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="ep-petition-review-appeal-number"/>
        <xs:element minOccurs="0" ref="ep-petition-review-petitioner-code"/>
        <xs:element minOccurs="0" ref="ep-petition-review-notice-date"/>
        <xs:element minOccurs="0" ref="ep-petition-review-decision-date"/>
        <xs:element minOccurs="0" ref="ep-petition-review-decision-kind"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
      <xs:attribute name="review-number" use="required"/>
    </xs:complexType>
  </xs:element>
  <!-- @review-number: Comprises a unique number for a given year. Eg R0001/08 -->
  <xs:element name="ep-petition-review-appeal-number" type="xs:string"/>
  <xs:element name="ep-petition-review-petitioner-code" type="xs:string"/>
  <xs:element name="ep-petition-review-notice-date">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="ep-petition-review-decision-date">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="ep-petition-review-decision-kind" type="xs:string"/>
  <!-- a bulletin number -->
  <xs:element name="bnum" type="xs:string"/>
  <xs:element name="figure">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="img"/>
      </xs:sequence>
      <xs:attribute name="id"/>
      <xs:attribute name="num" use="required"/>
      <xs:attribute name="figure-labels"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="heading">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:group ref="btext"/>
        <xs:element ref="st32math"/>
        <xs:element ref="st32chem"/>
      </xs:choice>
      <xs:attribute name="id"/>
      <xs:attribute name="num"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="p">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:group ref="ptext"/>
        <xs:element ref="st32chem"/>
        <xs:element ref="st32math"/>
      </xs:choice>
      <xs:attribute name="id"/>
      <xs:attribute name="num"/>
    </xs:complexType>
  </xs:element>
  <!--
    img/imgref in these content models is required to satisfy
    custom characters represented as images
  -->
  <xs:element name="b">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="i"/>
        <xs:element ref="u"/>
        <xs:element ref="o"/>
        <xs:element ref="sub"/>
        <xs:element ref="sup"/>
        <xs:element ref="smallcaps"/>
        <xs:element ref="img"/>
        <xs:element ref="imgref"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="i">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="b"/>
        <xs:element ref="u"/>
        <xs:element ref="o"/>
        <xs:element ref="sub"/>
        <xs:element ref="sup"/>
        <xs:element ref="smallcaps"/>
        <xs:element ref="img"/>
        <xs:element ref="imgref"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="u">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="b"/>
        <xs:element ref="i"/>
        <xs:element ref="o"/>
        <xs:element ref="sub"/>
        <xs:element ref="sup"/>
        <xs:element ref="smallcaps"/>
        <xs:element ref="img"/>
        <xs:element ref="imgref"/>
      </xs:choice>
      <xs:attribute name="style" default="single">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="single"/>
            <xs:enumeration value="double"/>
            <xs:enumeration value="dash"/>
            <xs:enumeration value="dots"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="o">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="b"/>
        <xs:element ref="i"/>
        <xs:element ref="u"/>
        <xs:element ref="sub"/>
        <xs:element ref="sup"/>
        <xs:element ref="smallcaps"/>
        <xs:element ref="img"/>
        <xs:element ref="imgref"/>
      </xs:choice>
      <xs:attribute name="ostyle" default="single">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="single"/>
            <xs:enumeration value="double"/>
            <xs:enumeration value="dash"/>
            <xs:enumeration value="dots"/>
            <xs:enumeration value="leftarrow"/>
            <xs:enumeration value="rightarrow"/>
            <xs:enumeration value="leftrightarriw"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="sub">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="b"/>
        <xs:element ref="i"/>
        <xs:element ref="u"/>
        <xs:element ref="o"/>
        <xs:element ref="sub"/>
        <xs:element ref="sup"/>
        <xs:element ref="smallcaps"/>
        <xs:element ref="sub2"/>
        <xs:element ref="sup2"/>
        <xs:element ref="img"/>
        <xs:element ref="imgref"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="sub2">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="b"/>
        <xs:element ref="i"/>
        <xs:element ref="u"/>
        <xs:element ref="o"/>
        <xs:element ref="sub"/>
        <xs:element ref="sup"/>
        <xs:element ref="smallcaps"/>
        <xs:element ref="sup2"/>
        <xs:element ref="img"/>
        <xs:element ref="imgref"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="sup">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="b"/>
        <xs:element ref="i"/>
        <xs:element ref="u"/>
        <xs:element ref="o"/>
        <xs:element ref="sub"/>
        <xs:element ref="smallcaps"/>
        <xs:element ref="sub2"/>
        <xs:element ref="sup2"/>
        <xs:element ref="img"/>
        <xs:element ref="imgref"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="sup2">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="b"/>
        <xs:element ref="i"/>
        <xs:element ref="u"/>
        <xs:element ref="o"/>
        <xs:element ref="sub"/>
        <xs:element ref="sup"/>
        <xs:element ref="smallcaps"/>
        <xs:element ref="sub2"/>
        <xs:element ref="img"/>
        <xs:element ref="imgref"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="smallcaps">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="b"/>
        <xs:element ref="i"/>
        <xs:element ref="u"/>
        <xs:element ref="o"/>
        <xs:element ref="sub"/>
        <xs:element ref="sup"/>
        <xs:element ref="sub2"/>
        <xs:element ref="sup2"/>
        <xs:element ref="img"/>
        <xs:element ref="imgref"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="br">
    <xs:complexType/>
  </xs:element>
  <!-- unformatted text (white space retained etc... ) -->
  <xs:element name="pre">
    <xs:complexType mixed="true">
      <xs:attribute ref="xml:space"/>
      <xs:attribute name="listing-type" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="tabular"/>
            <xs:enumeration value="equation"/>
            <xs:enumeration value="sequence"/>
            <xs:enumeration value="program-listing"/>
            <xs:enumeration value="other"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <!-- Lists -->
  <xs:element name="dl">
    <xs:complexType>
      <xs:sequence maxOccurs="unbounded">
        <xs:element ref="dt"/>
        <xs:element ref="dd"/>
      </xs:sequence>
      <xs:attribute name="id"/>
      <xs:attribute name="tsize"/>
      <xs:attribute name="compact">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="compact"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="dt">
    <xs:complexType mixed="true">
      <xs:group minOccurs="0" maxOccurs="unbounded" ref="btext"/>
      <xs:attribute name="id"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="dd">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:group ref="ptext"/>
        <xs:element ref="st32chem"/>
        <xs:element ref="st32math"/>
      </xs:choice>
      <xs:attribute name="id"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="ul">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="li"/>
      </xs:sequence>
      <xs:attribute name="id"/>
      <xs:attribute name="list-style" default="bullet">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="bullet"/>
            <xs:enumeration value="dash"/>
            <xs:enumeration value="none"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="compact">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="compact"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="sl">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="li"/>
      </xs:sequence>
      <xs:attribute name="id"/>
      <xs:attribute name="compact">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="compact"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="ol">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="li"/>
      </xs:sequence>
      <xs:attribute name="id"/>
      <xs:attribute name="ol-style"/>
      <xs:attribute name="compact">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="compact"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="li">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:group ref="ptext"/>
        <xs:element ref="st32chem"/>
        <xs:element ref="st32math"/>
      </xs:choice>
      <xs:attribute name="id"/>
      <xs:attribute name="num"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="crossref">
    <xs:complexType mixed="true">
      <xs:group minOccurs="0" maxOccurs="unbounded" ref="btext"/>
      <xs:attribute name="idref" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="figref">
    <xs:complexType mixed="true">
      <xs:group minOccurs="0" maxOccurs="unbounded" ref="btext"/>
      <xs:attribute name="idrefs"/>
      <xs:attribute name="num"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="bio-deposit">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="depositary"/>
        <xs:element ref="bio-accno"/>
        <xs:element minOccurs="0" ref="date"/>
        <xs:element minOccurs="0" ref="term"/>
        <xs:element minOccurs="0" ref="dtext"/>
      </xs:sequence>
      <xs:attribute name="id" type="xs:ID"/>
      <xs:attribute name="num" use="required"/>
      <xs:attribute name="url"/>
      <xs:attribute name="dnum"/>
    </xs:complexType>
  </xs:element>
  <!-- Information regarding the facility storing the biological deposit. -->
  <xs:element name="depositary">
    <xs:complexType mixed="true">
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="address"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <!-- Biological accession number: the identification assigned to the biological material by the depository. -->
  <xs:element name="bio-accno" type="xs:string"/>
  <xs:element name="term" type="xs:string"/>
  <xs:element name="img">
    <xs:complexType>
      <xs:attribute name="id"/>
      <xs:attribute name="file" use="required"/>
      <xs:attribute name="wi"/>
      <xs:attribute name="he"/>
      <xs:attribute name="img-content" default="drawing">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="abstract-drawing"/>
            <xs:enumeration value="ad"/>
            <xs:enumeration value="chem"/>
            <xs:enumeration value="cf"/>
            <xs:enumeration value="clip"/>
            <xs:enumeration value="ci"/>
            <xs:enumeration value="program-listing"/>
            <xs:enumeration value="cp"/>
            <xs:enumeration value="dna"/>
            <xs:enumeration value="dn"/>
            <xs:enumeration value="drawing"/>
            <xs:enumeration value="dr"/>
            <xs:enumeration value="undefined"/>
            <xs:enumeration value="figure"/>
            <xs:enumeration value="fg"/>
            <xs:enumeration value="graph"/>
            <xs:enumeration value="gr"/>
            <xs:enumeration value="math"/>
            <xs:enumeration value="mf"/>
            <xs:enumeration value="page"/>
            <xs:enumeration value="pa"/>
            <xs:enumeration value="photograph"/>
            <xs:enumeration value="ph"/>
            <xs:enumeration value="search-report"/>
            <xs:enumeration value="sr"/>
            <xs:enumeration value="table"/>
            <xs:enumeration value="tb"/>
            <xs:enumeration value="character"/>
            <xs:enumeration value="tx"/>
            <xs:enumeration value="flowchart"/>
            <xs:enumeration value="undefined-char"/>
            <xs:enumeration value="ff"/>
            <xs:enumeration value="undefined-image"/>
            <xs:enumeration value="ui"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="img-format" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="jpg"/>
            <xs:enumeration value="tif"/>
            <xs:enumeration value="st33"/>
            <xs:enumeration value="st35"/>
            <xs:enumeration value="pdf"/>
            <xs:enumeration value="gif"/>
            <xs:enumeration value="bmp"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="orientation" default="unknown">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="portrait"/>
            <xs:enumeration value="landscape"/>
            <xs:enumeration value="unknown"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="inline" default="no">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="yes"/>
            <xs:enumeration value="no"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="alt"/>
      <xs:attribute name="url"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="imgref">
    <xs:complexType>
      <xs:attribute name="idrefs"/>
      <xs:attribute name="num"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="attachments">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="attachment"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="attachments-external">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="attachment"/>
      </xs:sequence>
      <xs:attributeGroup ref="dfltattrs"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="attachment">
    <xs:complexType>
      <xs:attribute name="idref"/>
      <xs:attribute name="attachment-type" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="pdf"/>
            <xs:enumeration value="cdx"/>
            <xs:enumeration value="mol"/>
            <xs:enumeration value="nb"/>
            <xs:enumeration value="xml"/>
            <xs:enumeration value="seq-xml"/>
            <xs:enumeration value="table-xml"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="file" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="formula-text">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="b"/>
        <xs:element ref="i"/>
        <xs:element ref="u"/>
        <xs:element ref="o"/>
        <xs:element ref="sup"/>
        <xs:element ref="sub"/>
        <xs:element ref="smallcaps"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="chemistry">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="img"/>
        <xs:element ref="formula-text"/>
        <xs:element ref="attachments"/>
      </xs:choice>
      <xs:attribute name="id"/>
      <xs:attribute name="num"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="maths">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="math"/>
        <xs:element ref="equation"/>
        <xs:element ref="img"/>
        <xs:element ref="formula-text"/>
        <xs:element ref="attachments"/>
      </xs:choice>
      <xs:attribute name="id"/>
      <xs:attribute name="num"/>
    </xs:complexType>
  </xs:element>
  <!-- equation added to support US greenbook -->
  <xs:element name="equation" type="xs:string"/>
  <xs:element name="tables">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="table"/>
        <xs:element ref="img"/>
      </xs:choice>
      <xs:attribute name="id"/>
      <xs:attribute name="num"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="table-external-doc" type="xs:string"/>
  <xs:element name="number" type="xs:string"/>
</xs:schema>
@ss185427
Copy link

Having the same issue with a XSD file that has <xs:schema xmlns:xs = "http://www.w3.org/2001/XMLSchema"> and only xs namespace.

@isimluk
Copy link
Member

isimluk commented Nov 27, 2021

@mr-kashif, could you please provide all the XSD files for me to reproduce?

@Simerax
Copy link

Simerax commented Aug 1, 2022

@isimluk This specification from gaeb (a german standard for b2b communication) triggers the same error.
GAEB_DA_XML_Lib_3.3_2021-05.xsd.txt (renamed to .txt because github does not allow .xsd)

Processing 'GAEB_DA_XML_Lib_3.3_2021-05.xsd'
        Parsing: GAEB_DA_XML_Lib_3.3_2021-05.xsd
panic: Internal error: Unknown xmlns prefix:

goroutine 1 [running]:
github.com/gocomply/xsd2go/pkg/xsd.(*Schema).xmlnsByPrefix(...)
        C:/Users/xf/Desktop/tmp/gaeb/xsd2go/pkg/xsd/schema.go:111
github.com/gocomply/xsd2go/pkg/xsd.(*Schema).findReferencedSchemaByPrefix(0xc000185560?, {0x0, 0x0})
        C:/Users/xf/Desktop/tmp/gaeb/xsd2go/pkg/xsd/schema.go:105 +0x79
github.com/gocomply/xsd2go/pkg/xsd.(*Schema).findReferencedType(0xc0001bab40, {0xc000185560, 0xa})
        C:/Users/xf/Desktop/tmp/gaeb/xsd2go/pkg/xsd/schema.go:90 +0x8e
github.com/gocomply/xsd2go/pkg/xsd.(*Element).compile(0xc000350000, 0xc000034000?, 0x300000002?)
        C:/Users/xf/Desktop/tmp/gaeb/xsd2go/pkg/xsd/element.go:145 +0x1a6
github.com/gocomply/xsd2go/pkg/xsd.(*Sequence).compile(0xc000302850, 0x791be0?, 0x0?)
        C:/Users/xf/Desktop/tmp/gaeb/xsd2go/pkg/xsd/sequence.go:21 +0x5d
github.com/gocomply/xsd2go/pkg/xsd.(*ComplexType).compile(0xc00046a000, 0xc0001bab40, 0xc000012180?)
        C:/Users/xf/Desktop/tmp/gaeb/xsd2go/pkg/xsd/types.go:106 +0x6d
github.com/gocomply/xsd2go/pkg/xsd.(*Schema).compile(0xc0001bab40)
        C:/Users/xf/Desktop/tmp/gaeb/xsd2go/pkg/xsd/schema.go:61 +0x10a
github.com/gocomply/xsd2go/pkg/xsd.(*Workspace).loadXsd(0xc0001b0460, {0xc000012180, 0x1f}, 0x1)
        C:/Users/xf/Desktop/tmp/gaeb/xsd2go/pkg/xsd/workspace.go:95 +0xdfa
github.com/gocomply/xsd2go/pkg/xsd.NewWorkspace({0xc000185294, 0x9}, {0xc000012180, 0x1f}, {0x7e6638, 0x0, 0x0})
        C:/Users/xf/Desktop/tmp/gaeb/xsd2go/pkg/xsd/workspace.go:27 +0xfc
github.com/gocomply/xsd2go/pkg/xsd2go.Convert({0xc000012180, 0x1f}, {0xc00000a0f0, 0x4}, {0xc00000a100, 0x4}, {0x7e6638, 0x0, 0x0})
        C:/Users/xf/Desktop/tmp/gaeb/xsd2go/pkg/xsd2go/generate.go:12 +0x15a
github.com/gocomply/xsd2go/cli/cmd.glob..func2(0xc0001c82c0?)
        C:/Users/xf/Desktop/tmp/gaeb/xsd2go/cli/cmd/cmd.go:44 +0xd1
github.com/urfave/cli.HandleAction({0x505260?, 0x575d50?}, 0x7?)
        C:/Users/xf/Desktop/tmp/gaeb/xsd2go/vendor/github.com/urfave/cli/app.go:524 +0xa8
github.com/urfave/cli.Command.Run({{0x559143, 0x7}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x56d98c, 0x44}, {0x0, ...}, ...}, ...)
        C:/Users/xf/Desktop/tmp/gaeb/xsd2go/vendor/github.com/urfave/cli/command.go:173 +0x652
github.com/urfave/cli.(*App).Run(0xc0001bc380, {0xc000102000, 0x5, 0x8})
        C:/Users/xf/Desktop/tmp/gaeb/xsd2go/vendor/github.com/urfave/cli/app.go:277 +0x8a7
github.com/gocomply/xsd2go/cli/cmd.Execute()
        C:/Users/xf/Desktop/tmp/gaeb/xsd2go/cli/cmd/cmd.go:21 +0x128
main.main()
        C:/Users/xf/Desktop/tmp/gaeb/xsd2go/cli/gocomply_xsd2go/main.go:8 +0x19

@wannes-geysen
Copy link

@isimluk , I had the same problem and managed to create a minimal example:

<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <!-- definition of simple elements -->
    <xs:element name="name" type="xs:string"/>
    <!-- definition of complex elements -->
    <xs:element name="referencingthename">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="name"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

Could you have a look at it?

@v1gnesh
Copy link

v1gnesh commented Jul 7, 2023

Yes please to the above comment.

@sandmannmax
Copy link

The problem occurs when the parser searches a referenced element without a prefix like ref="name" and then does not find a namespace for it. To resolve it, you can specify a targetNamespace for your schema like this:

<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="exampleNamespace">
    <!-- definition of simple elements -->
    <xs:element name="name" type="xs:string"/>
    <!-- definition of complex elements -->
    <xs:element name="referencingthename">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="name"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants