XML syntax for XBRL specifications 0.2

The specification for specifications

Internal Working Draft 11 July 2008

Copyright ©2008 XBRL International Inc., All Rights Reserved.

This version:
spec4specs-IWD-2008-07-11.html
Editors:
Geoff Shuetrim, Galexy Pty. Limited <geoff@galexy.net>
Hugh Wallis, XBRL International Inc. <hughwallis@xbrl.org>
Contributors:
Mark Goodhand, Decisionsoft <mrg@decisionsoft.com>
John Turner, Corefiling <john.turner@corefiling.com>
Philip Allen, Corefiling <plega@corefiling.com>
Walter Hamscher, Standard Advantage <walter@hamscher.com>

Status

Circulation of this Internal Working Draft is restricted to participants in XBRL International and is not appropriate to cite from other sources. This document is normative. Other documents may supersede this document. Recipients are invited to submit comments to s4s-feedback@xbrl.org, and to submit notification of any relevant patent rights of which they are aware and provide supporting documentation.

NOTICE:

This document serves as an example of how to use the syntax that it defines.

It will probably always remain an Internal Working Draft as it is not intended that it should ever become an XBRL Recommendation, nor proceed on that track. It is conceivable that it could become a Working Group Note at some future date but that is viewed as being unlikely.

Abstract

This is the specification for XBRL specifications written in XML. This specification is closely aligned to the XMLspec materials provided by the W3C (See [XMLSPEC] ). It has been adapted to more closely fit the needs of technical XBRL specifications. It does so by trimming down some of the XMLspec features and added a small number of additional features including structured content models for revision tracking, errata tracking and a container for XML that is to be reproduced verbatim in the specification.

Comments

1 Geoff Shuetrim: This is an example editorial comment.
2 Geoff Shuetrim: It renders in line with the surrounding text.

Table of Contents

1 Introduction
1.1 Background
1.2 Relationship to other work
1.3 Language independence
1.4 Terminology
1.5 Document conventions
1.6 Namespaces and namespace prefixes
1.7 Element and attribute notation
2 Syntax
2.1 Common attributes ( @id, @role, @diff, @changeref)
2.2 Element: <spec>
2.2.1 Element: <header>
2.2.1.1 Element: <wg>
2.2.1.2 Element: <title>
2.2.1.3 Element: <subtitle?>
2.2.1.4 Element: <pubtype?>
2.2.1.5 Element: <id>
2.2.1.6 Element: <parentid?>
2.2.1.7 Element: <feedback>
2.2.1.8 Element: <namespaces>
2.2.1.8.1 Element: <namespace>
2.2.1.9 Element: <version>
2.2.1.10 Element: <status>
2.2.1.11 Element: <date>
2.2.1.12 Element: <authors>
2.2.1.12.1 Element: <person+>
2.2.1.12.1.1 Element: <name>
2.2.1.12.1.2 Element: <affiliation?>
2.2.1.12.1.3 Element: <email?>
2.2.1.13 Element: <contributors>
2.2.1.14 Element: <abstract>
2.2.1.15 Element: <notice?>
2.2.2 Element: <body>
2.2.2.1 Element: <section*>
2.2.2.1.1 Element: <head>
2.2.3 Element: <back>
2.3 Element: <chunk.class> (abstract)
2.3.1 Element: <includeChunk>
2.3.2 Element: <p>
2.3.3 Element: <table>
2.3.3.1 Element: <caption>
2.3.3.2 Element: <col>
2.3.3.3 Element: <colgroup>
2.3.3.4 Element: <thead>
2.3.3.5 Element: <tbody>
2.3.3.5.1 Element: <tr>
2.3.3.5.1.1 Element: <th>
2.3.3.5.1.2 Element: <td>
2.3.3.6 Element: <tfoot>
2.3.4 Element: <figure>
2.3.4.1 Element: <img>
2.3.5 Element: <example>
2.3.6 Element: <list.class> (abstract)
2.3.6.1 Element: <slist>
2.3.6.1.1 Element: <item>
2.3.6.2 Element: <ulist>
2.3.6.3 Element: <olist>
2.3.6.4 Element: <bibliography>
2.3.6.4.1 Element: <reference>
2.3.6.5 Element: <revisions>
2.3.6.5.1 Element: <revision>
2.3.6.6 Element: <errata>
2.3.6.6.1 Element: <erratum>
2.4 Element: <phrase.class> (abstract)
2.4.1 Element: <includePhrase>
2.4.2 Element: <code.class> (abstract)
2.4.2.1 Element: <elt>
2.4.2.2 Element: <att>
2.4.2.3 Element: <val>
2.4.2.4 Element: <var>
2.4.2.5 Element: <code>
2.4.3 Element: <ref.class> (abstract)
2.4.3.1 Element: <sectionref>
2.4.3.2 Element: <figureref>
2.4.3.3 Element: <exampleref>
2.4.3.4 Element: <tableref>
2.4.3.5 Element: <bibref>
2.4.3.6 Element: <xref>
2.4.3.7 Element: <termref>
2.4.3.8 Element: <requirementref>
2.4.3.9 Element: <principleref>
2.4.3.10 Element: <xtermref>
2.4.3.11 Element: <xmlref>
2.4.3.12 Element: <dateref>
2.4.3.13 Element: <wgref>
2.4.3.14 Element: <personref>
2.4.3.15 Element: <namespaceref>
2.4.4 Element: <rfc2119>
2.4.5 Element: <em>
2.4.6 Element: <strong>
2.4.7 Element: <center>
2.4.8 Element: <quote>
2.4.9 Element: <footnote>
2.4.10 Element: <subscript>
2.4.11 Element: <superscript>
2.4.12 Element: <phrase>
2.4.13 Element: <nbsp>
2.4.14 Element: <br>
2.4.15 Element: <amp>
2.4.16 Element: <verbatim>
2.4.17 Element: <comment>
2.4.18 Element: <definition>
2.4.19 Element: <error>
2.4.20 Elements: <principle> and <requirement>
2.4.20.1 Element: <short>
2.4.20.2 Element: <long>

Appendices

A Normative schema
B Transformation stylesheets
C References
D Intellectual property status (non-normative)
E Acknowledgements (non-normative)
E.1 Sub-section of an appendix.
F Document history (non-normative)
G Errata corrections in this document

End note

Table

1 Namespaces and namespace prefixes

Figure

1 Example figure

Examples

1 A normative example
2 A non-normative example
3 An example of poor usage
4 Marked-up differences

Definition

XML schema


1 Introduction

This is the specification for XBRL specifications written in XML. This specification is closely aligned to the XMLspec materials provided by the W3C (See [XMLSPEC]). It has been adapted to more closely fit the needs of technical XBRL specifications. It does so by trimming down some of the XMLspec features and added a small number of additional features including structured content models for revision tracking, errata tracking and a container for XML that is to be reproduced verbatim in the specification.

1.1 Background

This specification has grown out of a need to overcome a range of limitations associated with previous specification drafting tools and processes.

1.2 Relationship to other work

This specification has been derived from the XMLspec used by the W3C. See [XMLSPEC] .

1.3 Language independence

The official language of XBRL International's own work products is English and the preferred spelling convention is UK English.

1.4 Terminology

Where this document refers to an XML schema, it is referring to an XML document [XML] that contains a declaration of a schema that is compliant with XML Schema [XML Schema Structures 1.0].

Definitions can be referenced from within the text using <termref> elements. See Section 2.4.3.7 for details. The content model for the <termref> element is set out in the normative XML schema supporting this document. See Appendix A .

1.5 Document conventions

The following formatting is used for normative technical material in this document:

Example 1: A normative example

Text of the normative example.

The following formatting is used for non-normative examples in this document:

Example 1: A non-normative example

Text of the helpful example.

Example 3 shows the formatting for non-normative bad examples (examples of poor, discouraged or disallowed usage) in this document:

Example 1: An example of poor usage

The example itself.

Figure 1 shows the formatting for figures. The image has been taken from XML Saves The World. [ 1 ]

Figure 1: Example figure

[Geoff Shuetrim: This is an example editorial comment. ]

Here is an example inline comment. [Geoff Shuetrim: It renders in line with the surrounding text. ] This can be useful for providing better context for comments.

1.6 Namespaces and namespace prefixes

Namespace prefixes will be used for elements and attributes in the form ns:name where ns is the namespace prefix and name is the local name. Throughout this specification, the mappings from namespace prefixes to actual namespaces is consistent with Table 1 .

Table 1: Namespaces and namespace prefixes
namespace prefix 1 namespace
http://xbrl.org/specification/2007
eg http://example.com/

1. These prefixes will be used throughout the specification.

1.7 Element and attribute notation

When referring to a specific element, it will be identified by its namespace prefix and local name. For example, the root element for a specification container element would be referred to as s:spec .

Attributes are also identified by their local name and, where appropriate, their namespace prefix. Attributes are distinguished from elements by prefixing them by an @ symbol. Thus, @id refers to the attribute with the name id .

When referring to any attribute, so long as it has a specific namespace, the local name is replaced by an asterisk, * . Thus, the notation, @xml:* , specifies any attribute in the namespace http://www.w3.org/XML/1998/namespace .

2 Syntax

2.1 Common attributes ( @id, @role, @diff, @changeref)

All elements MAY have any of the following attributes:

  • @id? , an id for the element that MUST be unique within the document
  • @role? , taking any string value to associate a particular custom purpose for an element
  • @diff? , taking a value of chg , new , del , or off to document the nature of differences at the element level between specification versions. off means that even though higher level elements have differences, this one does not.
  • @changeref? , taking a value that MUST match an @id attribute value on an <erratum> element or a <revision> element. This attribute works in conjunction with a @diff attribute, to relate the actual changes made to the revision or erratum entry summarising the changes.

Example 1: Marked-up differences

This is a paragraph with no differences.

This is a paragraph that has been added.

This is a paragraph that has been deleted.

This is a paragraph that has been changed where the changes involve new text and removeddeleted text.

2.2 Element: <spec>

The root element of the specification is the <spec> element .

Attributes include:

Child elements are:

  1. <header>
  2. <body>
  3. <back>

2.2.1 Element: <header>

The <header> element contains the specification metadata.

Child elements are:

  1. <wg>
  2. <title>
  3. <subtitle?>
  4. <pubtype?> , with a value that is one of Specification , WGN (Working Group Note), RFC (Request for Comments), PN (Practice Note), or REQ (Requirements)
  5. <id>
  6. <parentid?>
  7. <namespaces?>
  8. <version>
  9. <status> , with a value that is one of REC (Recommendation), RR (Rescinded Recommendation), DRR (Draft Rescinded Recommendation), PER (Proposed Edited Recommendation), DPER (Draft Proposed Edited Recommendation), PR (Proposed Recommendation), DPR (Draft Proposed Recommendation), CR (Candidate Recommendation), DCR (Draft Candidate Recommendation) FWGN (Final Working Group Note), DFWGN (Draft Final Working Group Note), WGN (Working Group Note), DWGN (Draft Working Group Note), PWD (Public Working Draft), DPWD (Draft Public Working Draft), IWD (Internal Working Draft), or WGWD (Working Group Working Draft)
  10. <date>
  11. <url>
  12. <authors>
  13. <contributors?>
  14. <notice?>
  15. <abstract>

2.2.1.1 Element: <wg>

The <wg> element is intended to contain the name of the working group responsible for the specification.

2.2.1.2 Element: <title>

The <title> element has text content and is intended to contain the main title of the specification.

2.2.1.3 Element: <subtitle?>

The <subtitle> element has text content and is intended to contain the subtitle of the specification, if such exists.

2.2.1.4 Element: <pubtype?>

The <pubtype> element has text content and dentifies the type of document to be used in constructing the document URL for publication. Valid types are Specification, WGN (Working Group Note), RFC (Request for Comments), PN (Practice Note) and REQ (Requirements). If omitted, Specification is assumed. This value is used as the top level folder into which the output HTML is placed.

2.2.1.5 Element: <id>

The <id> element contains an identifying string (with no spaces or odd characters) that will be used when constructing the URL for the specification.

2.2.1.6 Element: <parentid?>

The <parentid> element contains an identifying string for the document that this document supports, to be used in constructing the document URL. If omitted <id> is used to construct the URL. This is designed to ensure that documents that are intended to be published together, as part of a package, are automatically placed in the same folder for publication.

2.2.1.7 Element: <feedback>

The <feedback> element contains the email address to use to provide feedback on the document.

2.2.1.8 Element: <namespaces>

The <namespaces> element contains an a child element for a namespace defined in the specification. Each child element is a <namespace> element.

2.2.1.8.1 Element: <namespace>

The <namespace> element documents a namespace defined in the specification. It MUST have an @id attribute.

The <namespace> element MUST have a @value attribute that contains the absolute URI that is the namespace itself.

It MAY have a @prefix attribute indicating that, in the text of the specification, this namespace will be referred to using the prefix contained by the @prefix attribute . If the @prefix attribute is omitted, then the namespace is referred to, in the text of the specification, without a namespace prefix.

It MAY have a @url attribute, in which case, the attribute MUST contain the absolute URL of a normative schema with the specified namespace.

The <namespace> element MAY contain a description of the purpose of the namespace.

2.2.1.9 Element: <version>

The <version> element has text content.

2.2.1.10 Element: <status>

The <status> element has text content indicating the status of the document. It can take one of the following values:

  • REC (Recommendation)
  • RR (Rescinded Recommendation)
  • DRR (Draft Rescinded Recommendation)
  • PER (Proposed Edited Recommendation)
  • DPER (Draft Proposed Edited Recommendation)
  • PR (Proposed Recommendation)
  • DPR (Draft Proposed Recommendation)
  • CR (Candidate Recommendation)
  • DCR (Draft Candidate Recommendation)
  • FWGN (Final Working Group Note)
  • DFWGN (Draft Final Working Group Note)
  • WGN (Working Group Note)
  • DWGN (Draft Working Group Note)
  • PWD (Public Working Draft)
  • DPWD (Draft Public Working Draft)
  • IWD (Internal Working Draft)
  • WGWD (Working Group Working Draft)

This controls both some of the boilerplate text that is inserted into the output and whether the output is placed into a publication or a non publication folder. In addition, the URL that is inserted into the output text is only a hyperlink if the status is one of those that is published to the XII website (such as PWD )

Unless requested by XII staff, editors MUST NOT use any of the status codes related to published documents (such as PWD). Instead they MAY use an associated code indicating that the document is a "not to be published" draft (such as DPWD).

2.2.1.11 Element: <date>

The <date> element holds information about the publication date.

Attributes include:

  • Common attributes (See Section 2.1 )
  • @day? , in DD format
  • @month , in MM format
  • @year , in YYYY format

2.2.1.12 Element: <authors>

The <authors> element is a container for authors/editors.

Child elements are:

  1. <person+>
2.2.1.12.1 Element: <person+>

The <person> element documents an author or contributor.

Attributes include:

  • Common attributes (See Section 2.1 )
  • @id is required for authors and contributors

Child elements are:

  1. <name>
  2. <affiliation?>
  3. <email?>
2.2.1.12.1.1 Element: <name>

The <name> element contains the full name of the person, as a text string.

2.2.1.12.1.2 Element: <affiliation?>

The <affiliation> element contains the name of the organisation that the person is affiliated with, as a text string.

2.2.1.12.1.3 Element: <email?>

The <email> element contains the email address of the person, as a text string.

2.2.1.13 Element: <contributors>

The <contributors> element is a container for contributors.

Child elements are:

  1. <person*> (See Section 2.2.1.12.1 )

Leave it empty if there are no contributors.

2.2.1.14 Element: <abstract>

The <abstract> element is a container for a brief summary of the content of the document.

Child elements are:

  1. <chunk.class*> See Section 2.3

2.2.1.15 Element: <notice?>

The optional <notice> element is a container for additional notices that need to be bought to the attention of readers.

Child elements are:

  1. <chunk.class*> See Section 2.3

2.2.2 Element: <body>

The <body> element contains the main content of the document, organised into sections.

Child elements are:

  1. <section*>

2.2.2.1 Element: <section*>

The <section> element contains a section of the document body or back.

Child elements are:

  1. <head>
  2. <chunk.class*> See Section 2.3
  3. <section*>
2.2.2.1.1 Element: <head>

The <head> element contains the section heading.

This element has mixed content. Along with text, it MAY contain any element that is in the substitution group for the <phrase.class> element (See Section 2.4 ).

2.2.3 Element: <back>

The <back> element contains the document appendices, organised into sections.

Child elements are:

  1. <section*> (See Section 2.2.2.1 )

2.3 Element: <chunk.class> (abstract)

The <chunk.class> element is the head of the substitution group that contains all elements that are container for chunks of sections.

The following elements are in the substitution group for <chunk.class> .

  • <includeChunk> for references to external XML resources that are to be included in the specification
  • <p> for paragraph chunks
  • <table> for tables
  • <figure> for figures
  • <example> for examples
  • <list.class> for lists. See Section 2.3.6 .

2.3.1 Element: <includeChunk>

The <includeChunk> element allows referencing to external XML resources that can be substituted into the specification in its place.

The <includeChunk> element is in the substitution group for the chunk:class element defined in Section 2.3 .

Attributes include:

  • Common attributes (See Section 2.1 )
  • @ref , provides the URL of the external XML resource.

Content of the <includeChunk> element can is not reproduced in the specification. This element enables content to be maintained in one place and used in several documents.

The <includeChunk> element can be used to substitute for any element that is in the substitution group for the <chunk.class> element or for:

  • any child element of the <header> element
  • the <section> element
  • the <person> element
  • the <reference> element
  • the <tr> element

In the event that a number of chunks are to be included by a single <includeChunk> element, those chunks MUST be contained by a <container> element in the external resource. The <container> element serves as the root of the external XML resource and is not copied into the merged document.

2.3.2 Element: <p>

The <p> element is a container for paragraph content.

The <p> element is in the substitution group for the chunk:class element defined in Section 2.3 .

Attributes include:

  • Common attributes (See Section 2.1 )
  • @role? , provides the class name for the paragraph.

The <p> element can contain mixed content including any element in the substitution group for the <phrase.class> element Section 2.4 .

2.3.3 Element: <table>

The <table> element is a container for a table structure. It has a content model that mirrors that of HTML tables.

Child elements are:

  1. <caption?> (See Section 2.3.3.1 )
  2. <col?> | <colgroup?>
  3. <thead?>
  4. <tbody+>
  5. <tfoot?>

Only tables with captions will be included in a list of tables in the table of contents.

2.3.3.1 Element: <caption>

The <caption> element provides the caption for a table, a figure or an example. It can have mixed content.

Child elements are:

  1. <phrase.class*> (abstract) (See Section 2.4 )

2.3.3.2 Element: <col>

The <col> element Defines the attribute values for one or more columns in a table. You can only use this element inside a <table> ( Section 2.3.3 ) or a <colgroup> ( Section 2.3.3.3 ).

Attributes include:

  • Common attributes (See Section 2.1 )
  • @span?
  • @width?
  • @align?
  • @char?
  • @charoff?
  • @valign?

Aside from the common attributes, these attributes behave identically to their HTML analogs.

2.3.3.3 Element: <colgroup>

The <colgroup> element is a container for a sequence of <col> elements.

Attributes include:

  • Common attributes (See Section 2.1 )
  • @span?
  • @width?
  • @align?
  • @char?
  • @charoff?
  • @valign?

Child elements are:

  1. <col*> (See Section 2.3.3.2 )

Its syntax matches that of the corresponding HTML element.

2.3.3.4 Element: <thead>

The <thead> element is a container for the header rows of a table.

Child elements are:

  1. <tr> (See Section 2.3.3.5.1 )

2.3.3.5 Element: <tbody>

The <tbody> element is a container for the body rows of a table. Its syntax matches that of the corresponding HTML element.

2.3.3.5.1 Element: <tr>

The <tr> element is a container for the cells of a table row. Its syntax matches that of the corresponding HTML element.

2.3.3.5.1.1 Element: <th>

The <th> element is a container for a table header cell. Its syntax matches that of the corresponding HTML element. This element is generally used in table rows in the table header structure.

2.3.3.5.1.2 Element: <td>

The <td> is a container for a table body or footer cell. Its syntax matches that of the corresponding HTML element. This element is generally used in the table rows in the table body and footer structures.

2.3.3.6 Element: <tfoot>

The <tfoot> element is a container for the footer rows of a table. Its syntax matches that of the corresponding HTML element.

Child elements are:

  1. <tr> (See Section 2.3.3.5.1 )

2.3.4 Element: <figure>

The <figure> element is a container for a figure, illustrating some aspect of the specification. The illustration does not have to be a graphic image. It could be a snippet of XML or some other structure.

Child elements that are allowed are:

  1. <img> (See Section 2.3.4.1 )
  2. <p> (See Section 2.3.2 )
  3. <table> (See Section 2.3.3 )
  4. <verbatim> (See Section 2.4.16 )

2.3.4.1 Element: <img>

The <img> element MUST have a @src attribute that specifies the URL of an external graphic to be included as an image in the specification. It MAY also have an @alt attribute that give a text alternative to the image for those that are unable to view it.

2.3.5 Element: <example>

The <example> element is a container for an example.

Examples can be normative, normal examples or counter examples. This distinction is expressed by the @role attribute on the <example> element. A value of normative indicates that the example is normative. A value of counter indicates tha the example is a counter example. By omitting the @role attribute, the example is identified as a normal example.

Child elements that are allowed are:

  1. <img> (See Section 2.3.4.1 )
  2. <p> (See Section 2.3.2 )
  3. <table> (See Section 2.3.3 )
  4. <verbatim> (See Section 2.4.16 )

2.3.6 Element: <list.class> (abstract)

The <list.class> element is the head of the substitution group that contains all elements that are list containers.

The following elements are in the substitution group for <list.class> .

  • <slist> for simple unordered lists without any bullets
  • <ulist> for unordered lists
  • <olist> for ordered lists (i.e. with "numbers" as bullets)
  • <bibliography> for lists of citations
  • <revisions> for lists of revisions to the specification
  • <errata> for lists of errata that have been corrected in the specification

2.3.6.1 Element: <slist>

The <slist> element is used for simple unordered and non-bulleted lists.

The child elements are:

  1. <item*> for items in the list
2.3.6.1.1 Element: <item>

The <item> element is used for simple unordered and non-bulleted lists.

The content is a mix of text, and the following elements:

2.3.6.2 Element: <ulist>

The <ulist> element is used for unordered but bulleted lists.

The child elements are:

  1. <item*> (See Section 2.3.6.1.1 )

2.3.6.3 Element: <olist>

The <olist> element is used for ordered lists (i.e. with "numbers" as bullets).

The child elements are:

  1. <item*> (See Section 2.3.6.1.1 )

2.3.6.4 Element: <bibliography>

The <bibliography> element is the container for the bibliographic references.

The child elements are:

  1. <reference+> , one for each citation.
2.3.6.4.1 Element: <reference>

The <reference> element is the container for the details of an individual citation.

Attributes include:

  • Common attributes (See Section 2.1 )
  • @id the unique ID of the citation
  • @day? the day in DD format
  • @month the month in MM format
  • @year the month in YYYY format
  • @href? the URL of the cited work
  • @key the text to use to sort the citation and to reference it from within the body of the specification

Child elements are:

  1. <title> , for the reference title
  2. <publisher?> , for the name of the publishing organisation
  3. <authors?> (See Section 2.2.1.12 )

2.3.6.5 Element: <revisions>

The <revisions> element is the container for the revision history.

The child elements are:

  1. <revision+> , one for each revision event.
2.3.6.5.1 Element: <revision>

The <revision> element is the container for the details of an individual revision.

Attributes include:

  • Common attributes (See Section 2.1 )
  • @id the unique ID of the citation
  • @day the day in DD format
  • @month the month in MM format
  • @year the month in YYYY format
  • @href? the URL of the cited work

Child elements are:

  1. <chunk.class+> (See Section 2.3 )

2.3.6.6 Element: <errata>

The <errata> element is the container for a collection of errata that have been fixed in the current version.

The child elements are:

  1. <erratum*> , one for each erratum that has been addressed. If left empty, the tag indicates that no errata have been addressed in the specification.
2.3.6.6.1 Element: <erratum>

The <erratum> element is the container for the details of an individual erratum that has been addressed.

Attributes include:

  • Common attributes (See Section 2.1 )
  • @day the day in DD format
  • @month the month in MM format
  • @year the month in YYYY format

Child elements are:

  1. <chunk.class+> (See Section 2.3 )
  2. <sectionref*> (See Section 2.4.3.1 )

2.4 Element: <phrase.class> (abstract)

The <phrase.class> element is the head of the substitution group that contains all elements that are containers for the phrases that make up parts of chunks of sections. Phases typically are presented inline.

The following elements are in the substitution group for <phrase.class> .

  • <includePhrase> for references to external XML resources that are to be substituted into the document.
  • <code.class> (abstract) for phrases that are to be styled as code
  • <ref.class> (abstract) for various kinds of cross references
  • <definition> for definitions
  • <requirements> for groups of related requirements
  • <principles> for groups of related design principles
  • <rfc2119> for terms defined in [IETF RFC 2119]
  • <error> for error codes
  • <em> for phrases requiring emphasis
  • <strong> for phrases to be rendered inside <strong> tags
  • <center> for phrases to be rendered inside <center> tags (i.e. centred on the page or table cell)
  • <quote> for phrases needing to be quoted
  • <footnote> for footnotes and table notes
  • <subscript> for phrases to be presented as subscripts
  • <superscript> for phrases to be presented as superscripts
  • <nbsp> for non-breaking spaces
  • <amp> for ampersands spaces
  • <verbatim> for XML that is to be rendered verbatim
  • <comment> for editorial comments

2.4.1 Element: <includePhrase>

The <includePhrase> element allows referencing to external XML resources that can be substituted into the specification in its place.

The <includePhrase> element is in the substitution group for the phrase.class element defined in Section 2.4 .

Attributes include:

  • Common attributes (See Section 2.1 )
  • @ref , provides the URL of the external XML resource.

Content of the <includePhrase> element can is not reproduced in the specification. This element enables content to be maintained in one place and used in several documents.

In the event that a number of phrases are to be included by a single <includePhrase> element, those phrases MUST be contained by a <container> element in the external resource. The <container> element serves as the root of the external XML resource and is not copied into the merged document.

2.4.2 Element: <code.class> (abstract)

The <code.class> element is the head of the substitution group that contains all elements that are containers for the phrases that are variants on code.

The following elements are in the substitution group for <code.class> .

  • <elt> for XML element names
  • <att> for XML attribute names
  • <val> for values
  • <var> for variable names
  • <code> for other kinds of code

2.4.2.1 Element: <elt>

The <elt> element is for XML element names.

This element has mixed content. Along with text, it MAY contain any element that is in the substitution group for the <phrase.class> element.

2.4.2.2 Element: <att>

The <att> element is for XML attribute names.

This element has mixed content. Along with text, it MAY contain any element that is in the substitution group for the <phrase.class> element.

2.4.2.3 Element: <val>

The <val> element is for values.

This element has mixed content. Along with text, it MAY contain any element that is in the substitution group for the <phrase.class> element.

2.4.2.4 Element: <var>

The <var> element is for variable names.

This element has mixed content. Along with text, it MAY contain any element that is in the substitution group for the <phrase.class> element.

2.4.2.5 Element: <code>

The <code> element is for phrases that are required to be represented as code.

This element has mixed content. Along with text, it MAY contain any element that is in the substitution group for the <phrase.class> element.

2.4.3 Element: <ref.class> (abstract)

The <ref.class> element is the head of the substitution group that contains all elements that express cross-references.

The following elements are in the substitution group for <ref.class> .

  • <sectionref> for references to sections in the same document
  • <tableref> for references to tables in the same document
  • <figureref> for references to figures in the same document
  • <exampleref> for references to examples in the same document
  • <termref> for references to definitions in the same document
  • <errorref> for references to errors in the same document
  • <requirementref> for references to requirements expressed in the same document
  • <principleref> for references to design principles in the same document
  • <xmlref> for references to XML fragments
  • <bibref> for references to bibliographic citations
  • <xref> for links to external resources
  • <dateref> for references to the specification date
  • <wgref> for references to the working group responsible for the specification
  • <personref> for references to an author or contributor

2.4.3.1 Element: <sectionref>

The <sectionref> element is for references to sections in the same document. It MUST have a @ref attribute that contains the value of the @id attribute on a <section> element (See Section 2.2.2.1 ).

2.4.3.2 Element: <figureref>

The <figureref> element is for references to figure in the same document. It MUST have a @ref attribute that contains the value of the @id attribute on a <figure> element (See Section 2.3.4 ).

2.4.3.3 Element: <exampleref>

The <exampleref> element is for references to examples in the same document. It MUST have a @ref attribute that contains the value of the @id attribute on an <example> element (See Section 2.3.5 ).

2.4.3.4 Element: <tableref>

The <tableref> element is for references to tables in the same document. It MUST have a @ref attribute that contains the value of the @id attribute on a <table> element (See Section 2.3.3 ).

2.4.3.5 Element: <bibref>

The <bibref> element is for references to bibliographic citations. It MUST have a @ref attribute that contains the value of the @id attribute on a <reference> element (see Section 2.3.6.4.1 ).

2.4.3.6 Element: <xref>

The <xref> element is for references to external resources. It MUST have a @ref attribute that contains the value of the URL of the external resource. It MAY also have text content. Such content is intended to be presented as the text that is hyperlinked in the rendered specification.

2.4.3.7 Element: <termref>

The <termref> element is for references to definitions. It MUST have a @ref attribute that contains the value of the @id attribute on the <definition> element containing the term definition. It MAY also have text content. Such content should be the usage of the term that is being cross referenced to the term definition.

2.4.3.8 Element: <requirementref>

The <requirementref> element is for references to requirements. It MUST have a @ref attribute that contains the value of the @id attribute on the <requirement> element containing the statement of the requirement.

2.4.3.9 Element: <principleref>

The <principleref> element is for references to principles. It MUST have a @ref attribute that contains the value of the @id attribute on the <principle> element containing the statement of the principle.

2.4.3.10 Element: <xtermref>

The <xtermref> element is for references to external term definitions (in fact, it MAY be used to reference any anchor in an external document). It MUST have a @bibref attribute that contains the value of the @id attribute on the bibliographic reference that contains the definition of the term. It MAY also contain an @idref attribute that, if provided, specifies the ID of the term definition within the bibliographic reference. The external terminology reference MUST also have text content. Such content is intended to be presented as the text that is hyperlinked in the rendered specification.

2.4.3.11 Element: <xmlref>

The <xmlref> element is for references to XML fragments. It MUST have a @ref attribute that contains the value of the @id attribute on an element that is nested within a <verbatim> element. It MAY also have text content. Such content SHOULD be the text that is cross-referenced to the XML fragment.

2.4.3.12 Element: <dateref>

The <dateref> element is used to insert various representations of the specification date into the text of the specification.

Attributes include:

  • Common attributes (See Section 2.1)
  • @style, which MUST have one of the following values:
    • DD-MM-YYYY
    • DD Month YYYY
    • YYYYMMDD

2.4.3.13 Element: <wgref>

The <wgref> element is for references to the name of the working group responsible for the specification. It is generally used as an empty element that acts as the placeholder for the full name of the working group, where it is to be inserted into the text of the specification.

2.4.3.14 Element: <personref>

The <personref> element is for references to the name of an author or contributor on the specification. It MUST have a @ref attribute that contains the value of the @id attribute on the <person> element containing the name of the person being referenced. Note that it is also possible to use this element to reference authors of cited resources, if they have @id attributes.

2.4.3.15 Element: <namespaceref>

The <namespaceref> element is for references to namespaces defined in the specification. It MUST have a @ref attribute that contains the value of the @id attribute on the <namespace> element containing the value of the namespace being referenced.

The value of the @use attribute on the <namespaceref> element determines what information about the namespace is provided in place of the <namespaceref> element. The @use attribute can have any one of the following values:

  • namespace - for the namespace itself
  • prefix - for the prefix used for the namespace
  • description - for the one sentence description of the namespace
  • url - for the URL of the normative schema in which the namespace is defined.

2.4.4 Element: <rfc2119>

The <rfc2119> element is for phrases like "MUST" , "MUST NOT" , "MAY" as defined in [IETF RFC 2119] .

This element has mixed content. Along with text, it MAY contain any element that is in the substitution group for the <phrase.class> element.

2.4.5 Element: <em>

The <em> element is for phrases requiring emphasis.

This element has mixed content. Along with text, it MAY contain any element that is in the substitution group for the <phrase.class> element.

2.4.6 Element: <strong>

The <strong> element is for phrases to be rendered inside <strong> tags in the output HTML.

This element has mixed content. Along with text, it MAY contain any element that is in the substitution group for the <phrase.class> element.

2.4.7 Element: <center>

The <center> element (note American spelling) is for phrases to be rendered inside <center> tags in the output HTML. Here is an example:

This causes the output to be centred on the page or in a table cell.

This element has mixed content. Along with text, it MAY contain any element that is in the substitution group for the <phrase.class> element.

2.4.8 Element: <quote>

The <quote> element is for phrases that need to be expressed as a quote. In other words, this places quotation marks ("") around its content.

This element has mixed content. Along with text, it MAY contain any element that is in the substitution group for the <phrase.class> element.

2.4.9 Element: <footnote>

The <footnote> element is for footnotes and table notes.

This element has mixed content. Along with text, it MAY contain any element that is in the substitution group for the <phrase.class> element.

2.4.10 Element: <subscript>

The <subscript> element is for subscript text.

This element has mixed content. Along with text, it MAY contain any element that is in the substitution group for the <phrase.class> element.

2.4.11 Element: <superscript>

The <superscript> element is for superscript text.

This element has mixed content. Along with text, it MAY contain any element that is in the substitution group for the <phrase.class> element.

2.4.12 Element: <phrase>

The <phrase> element is for attaching the common attributes (see Section 2.1 ) to a phrase.

This element has mixed content. Along with text, it MAY contain any element that is in the substitution group for the <phrase.class> element.

2.4.13 Element: <nbsp>

The <nbsp> element is an empty element that can be used for non-breaking spaces.

2.4.14 Element: <br>

The <br> element is an empty element that can be used to force a new line in the rendered HTML

2.4.15 Element: <amp>

The <amp> element is an empty element that can be used for ampersands.

2.4.16 Element: <verbatim>

The <verbatim> element is a container for XML that is to be rendered verbatim.

2.4.17 Element: <comment>

The <comment> element is a container for editorial comments.

The <comment> element is in the substitution group for the phrase:class element defined in Section 2.4 .

Attributes include:

  • Common attributes (See Section 2.1 )
  • @by, provides a reference to the commenting author or contributor. This attribute takes an IDREF value.

The <comment> element can contain mixed content including any element in the substitution group for the <phrase.class> element Section 2.4.

2.4.18 Element: <definition>

The <definition> element is a container for definitions of terms used in a technical sense in the specification.

The <definition> element is in the substitution group for the phrase:class element (See Section 2.4).

Attributes include:

  • Common attributes (See Section 2.1)
  • @term, contains the reference value of the term being defined.
  • @noindex, contains true if you do not want the definition to be included as an entry in the table of contents. Otherwise omit it or give it a value of false.

It is convention (but not absolutely required) that the @id attribute starts with term- and then has the value of the @term attribute, translated to lower case everywhere and with spaces replaced by hyphens. This makes it easier for a human to locate the reference while editing the document.

The <definition> element can contain mixed content including any element in the substitution group for the <phrase.class> element Section 2.4.

Often a definition will also contain a <term> element that contains the term being defined, as it is used in the definition itself.

2.4.19 Element: <error>

The <error> element is used as a container for text specifying the circumstances under which a specific error code is to be thrown.

This element has mixed content. Along with text, it MAY contain any element that is in the substitution group for the <phrase.class> element.

The <error> element can contain mixed content including any element in the substitution group for the <phrase.class> element Section 2.4.

An <error> element MUST contain exactly one <errorcode> element that is transformed into the specific error code that is to be thrown.

2.4.20 Elements: <principle> and <requirement>

The <principle> element is a container for statements of principles that are expected to be adhered to. The <requirement> element is a container for statements of a requirements that are expected to be met. Both elements have the same content model.

They are in the substitution group for the phrase:class element (See Section 2.4).

Both elements can be used as phrases within other text. However, they are also both permitted as the sole child element of table row elements (See Section 2.3.3.5.1). When they are the only child of a table row element, then the principle or requirement is typically expressed using three columns within the table, the first for the name, the second for the short description and the last for the long statement of the principle or requirement.

Attributes include:

  • Common attributes (See Section 2.1)
  • @name, which contains the unique identifier that will be used by people when referring unambiguously to the principle or requirement.
  • @noindex, contains true if you do not want the principle or requirement to be included as an entry in the table of contents. Otherwise omit it or give it a value of false.

It is convention (but not absolutely required) that the @id attribute starts with requirement- or principle- as appropriate and then has the value of the @name attribute, translated to lower case everywhere and with spaces replaced by hyphens. This makes it easier for a human to locate the reference while editing the document.

The <principle> element and the <requirement> element both contain two child elements, the <short> element followed by the <long> element.

2.4.20.1 Element: <short>

The <short> element is a container for a brief text title for the principle or requirement.

2.4.20.2 Element: <long>

The <long> element is a container for a detailed explanation of the principle or requirement. It MAY contain any markup that could be contained by a <td> element.

Appendix A Normative schema

This schema defines the allowable content that is documented in this specification

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://xbrl.org/specification/2007" elementFormDefault="qualified">
<!-- Attribute declarations -->
<xs:attributeGroup name="date.att">
<xs:attribute name="day">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="01"/>
<xs:enumeration value="02"/>
<xs:enumeration value="03"/>
<xs:enumeration value="04"/>
<xs:enumeration value="05"/>
<xs:enumeration value="06"/>
<xs:enumeration value="07"/>
<xs:enumeration value="08"/>
<xs:enumeration value="09"/>
<xs:enumeration value="10"/>
<xs:enumeration value="11"/>
<xs:enumeration value="12"/>
<xs:enumeration value="13"/>
<xs:enumeration value="14"/>
<xs:enumeration value="15"/>
<xs:enumeration value="16"/>
<xs:enumeration value="17"/>
<xs:enumeration value="18"/>
<xs:enumeration value="19"/>
<xs:enumeration value="20"/>
<xs:enumeration value="21"/>
<xs:enumeration value="22"/>
<xs:enumeration value="23"/>
<xs:enumeration value="24"/>
<xs:enumeration value="25"/>
<xs:enumeration value="26"/>
<xs:enumeration value="27"/>
<xs:enumeration value="28"/>
<xs:enumeration value="29"/>
<xs:enumeration value="30"/>
<xs:enumeration value="31"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="month" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="01"/>
<xs:enumeration value="02"/>
<xs:enumeration value="03"/>
<xs:enumeration value="04"/>
<xs:enumeration value="05"/>
<xs:enumeration value="06"/>
<xs:enumeration value="07"/>
<xs:enumeration value="08"/>
<xs:enumeration value="09"/>
<xs:enumeration value="10"/>
<xs:enumeration value="11"/>
<xs:enumeration value="12"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="year" use="required" type="xs:token"/>
</xs:attributeGroup>
<xs:attributeGroup name="diff.att">
<xs:attribute name="diff">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="chg"/>
<xs:enumeration value="add"/>
<xs:enumeration value="del"/>
<xs:enumeration value="off"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:attributeGroup>
<xs:attributeGroup name="changeref.att">
<xs:attribute name="changeref" type="xs:IDREF"/>
</xs:attributeGroup>
<xs:attributeGroup name="common.att">
<xs:attribute name="id" type="xs:ID"/>
<xs:attribute name="role" type="xs:NMTOKEN"/>
<xs:attributeGroup ref="diff.att"/>
<xs:attributeGroup ref="changeref.att"/>
</xs:attributeGroup>
<xs:attributeGroup name="common-idreq.att">
<xs:attribute name="id" use="required" type="xs:ID"/>
<xs:attribute name="role" type="xs:NMTOKEN"/>
<xs:attributeGroup ref="diff.att"/>
<xs:attributeGroup ref="changeref.att"/>
</xs:attributeGroup>
<xs:attributeGroup name="href.att">
<xs:attribute name="href" use="optional"/>
</xs:attributeGroup>
<xs:attributeGroup name="href-req.att">
<xs:attribute name="href" use="required"/>
</xs:attributeGroup>
<xs:attributeGroup name="ref-req.att">
<xs:attribute name="ref" use="required" type="xs:IDREF"/>
</xs:attributeGroup>
<xs:attributeGroup name="date.style.att">
<xs:attribute name="style">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="YYYYMMDD"/>
<xs:enumeration value="DD-MM-YYYY"/>
<xs:enumeration value="DD Month YYYY"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:attributeGroup>
<!-- Element groups that are re-used -->
<xs:group name="simple.section.group">
<xs:choice>
<xs:element ref="p"/>
<xs:element ref="comment"/>
<xs:element ref="list.class"/>
</xs:choice>
</xs:group>
<!-- Container element for external resources -->
<xs:element name="container">
<xs:annotation>
<xs:documentation>
This element serves as a root element for external XML resources where those external XML resources are a series of chunks or phrases that are to be included into the specification.
</xs:documentation>
</xs:annotation>
</xs:element>
<!-- Inline text structures -->
<xs:element name="phrase.class" abstract="true"/>
<xs:element name="phrase" type="text.model" substitutionGroup="phrase.class"/>
<xs:element name="em" type="text.model" substitutionGroup="phrase.class"/>
<xs:element name="strong" type="text.model" substitutionGroup="phrase.class"/>
<xs:element name="center" type="text.model" substitutionGroup="phrase.class"/>
<xs:element name="quote" type="text.model" substitutionGroup="phrase.class"/>
<xs:element name="footnote" type="text.model" substitutionGroup="phrase.class"/>
<xs:element name="subscript" type="text.model" substitutionGroup="phrase.class"/>
<xs:element name="superscript" type="text.model" substitutionGroup="phrase.class"/>
<xs:element name="error" substitutionGroup="phrase.class">
<xs:complexType mixed="true">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="phrase.class"/>
</xs:sequence>
<xs:attributeGroup ref="common-idreq.att"/>
</xs:complexType>
</xs:element>
<xs:element name="errorcode" substitutionGroup="phrase.class">
<xs:complexType>
<xs:attribute name="code" type="xs:NMTOKEN"/>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
</xs:element>
<xs:element name="nbsp" substitutionGroup="phrase.class">
<xs:annotation>
<xs:documentation>
An empty element to use where a non-breaking space is required.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
</xs:element>
<xs:element name="br" substitutionGroup="phrase.class">
<xs:annotation>
<xs:documentation>
An empty element to use where a new line is required (see HTML br element).
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
</xs:element>
<xs:element name="amp" substitutionGroup="phrase.class">
<xs:annotation>
<xs:documentation>
An empty element to use where an ampersand is required.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
</xs:element>
<xs:element name="definition" substitutionGroup="phrase.class">
<xs:annotation>
<xs:documentation>
Definition container
</xs:documentation>
</xs:annotation>
<xs:complexType mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="phrase.class"/>
</xs:choice>
<xs:attribute name="term" type="xs:string" use="required"/>
<xs:attribute name="noindex" type="xs:boolean" use="optional"/>
<xs:attributeGroup ref="common-idreq.att"/>
</xs:complexType>
</xs:element>
<xs:element name="principle" type="principle.requirement.model" substitutionGroup="phrase.class"/>
<xs:element name="requirement" type="principle.requirement.model" substitutionGroup="phrase.class"/>
<xs:complexType name="principle.requirement.model">
<xs:sequence>
<xs:element name="short" type="text.model"/>
<xs:element name="long">
<xs:complexType mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="chunk.class"/>
<xs:element ref="phrase.class"/>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="noindex" type="xs:boolean" use="optional"/>
<xs:attributeGroup ref="common-idreq.att"/>
</xs:complexType>
<xs:element name="term" type="text.model" substitutionGroup="phrase.class">
<xs:annotation>
<xs:documentation>
Contains a term that is defined in a definition. Usually nested within a definition.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="code" type="text.model" substitutionGroup="phrase.class">
<xs:annotation>
<xs:documentation>
Contains text marked up as code
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="att" type="text.model" substitutionGroup="phrase.class">
<xs:annotation>
<xs:documentation>
Contains an attribute name
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="elt" type="text.model" substitutionGroup="phrase.class">
<xs:annotation>
<xs:documentation>
Contains an element name
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="val" type="text.model" substitutionGroup="phrase.class">
<xs:annotation>
<xs:documentation>
Contains a value
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="var" type="text.model" substitutionGroup="phrase.class">
<xs:annotation>
<xs:documentation>
Contains a variable name
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="rfc2119" type="text.model" substitutionGroup="phrase.class">
<xs:annotation>
<xs:documentation>
Container for words like MUST, MAY, MUST NOT etc terms as per RFC 2119.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="verbatim" substitutionGroup="phrase.class">
<xs:annotation>
<xs:documentation>
Container for XML that is to be reproduced verbatim.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:any processContents="skip"/>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
</xs:element>
<xs:element name="comment" substitutionGroup="phrase.class" type="comment.model">
<xs:annotation>
<xs:documentation>
Editorial comment container
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="comment.model" mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="phrase.class"/>
</xs:choice>
<xs:attributeGroup ref="common.att"/>
<xs:attribute name="by" type="xs:IDREF" use="required"/>
</xs:complexType>
<xs:complexType name="text.model" mixed="true">
<xs:annotation>
<xs:documentation>
Used for inline text content models.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="phrase.class"/>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
<xs:element name="ref.class" substitutionGroup="phrase.class"/>
<xs:element name="sectionref" substitutionGroup="ref.class">
<xs:annotation>
<xs:documentation>
Used for references to sections within the current document. The ref attribute should contain the id of the section that is referenced. Generates the text "Section #" where # is the number of the section that is referenced.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="common.att"/>
<xs:attributeGroup ref="ref-req.att"/>
</xs:complexType>
</xs:element>
<xs:element name="includePhrase" substitutionGroup="ref.class">
<xs:annotation>
<xs:documentation>
Used for references to external XML resources that are to be included in the document in place of the element providing the reference.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="common.att"/>
<xs:attribute name="ref" type="xs:anyURI" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="tableref" substitutionGroup="ref.class">
<xs:annotation>
<xs:documentation>
Used for references to tables. Generates "Table #" in place of the tag with a hyperlink to the table itself.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="common.att"/>
<xs:attributeGroup ref="ref-req.att"/>
</xs:complexType>
</xs:element>
<xs:element name="figureref" substitutionGroup="ref.class">
<xs:annotation>
<xs:documentation>
Used for references to figures. Generates "Figure #" in place of the tag with a hyperlink to the figure itself.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="common.att"/>
<xs:attributeGroup ref="ref-req.att"/>
</xs:complexType>
</xs:element>
<xs:element name="exampleref" substitutionGroup="ref.class">
<xs:annotation>
<xs:documentation>
Used for references to examples. Generates "Example #" in place of the tag with a hyperlink to the example itself.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="common.att"/>
<xs:attributeGroup ref="ref-req.att"/>
</xs:complexType>
</xs:element>
<xs:element name="dateref" substitutionGroup="ref.class">
<xs:annotation>
<xs:documentation>
Used to reference the specification publication date.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="common.att"/>
<xs:attributeGroup ref="date.style.att"/>
</xs:complexType>
</xs:element>
<xs:element name="wgref" substitutionGroup="ref.class">
<xs:annotation>
<xs:documentation>
Used to reference the name of the working group that is responsible for the specification.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
</xs:element>
<xs:element name="personref" substitutionGroup="ref.class">
<xs:annotation>
<xs:documentation>
Used to reference the name of a person.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="common.att"/>
<xs:attributeGroup ref="ref-req.att"/>
</xs:complexType>
</xs:element>
<xs:element name="namespaceref" substitutionGroup="ref.class">
<xs:annotation>
<xs:documentation>
Used to reference the namespace of a normative schema supporting the specification.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="common.att"/>
<xs:attributeGroup ref="ref-req.att"/>
<xs:attribute name="use">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="namespace"/>
<xs:enumeration value="prefix"/>
<xs:enumeration value="url"/>
<xs:enumeration value="description"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="bibref" substitutionGroup="ref.class">
<xs:annotation>
<xs:documentation>
Used for links to bibliography references
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="common.att"/>
<xs:attributeGroup ref="ref-req.att"/>
</xs:complexType>
</xs:element>
<xs:element name="principleref" substitutionGroup="ref.class">
<xs:annotation>
<xs:documentation>
Used for links to principles references
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="common.att"/>
<xs:attributeGroup ref="ref-req.att"/>
</xs:complexType>
</xs:element>
<xs:element name="requirementref" substitutionGroup="ref.class">
<xs:annotation>
<xs:documentation>
Used for links to requirements references
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="common.att"/>
<xs:attributeGroup ref="ref-req.att"/>
</xs:complexType>
</xs:element>
<xs:element name="xref" substitutionGroup="ref.class">
<xs:annotation>
<xs:documentation>
Used for links to external resources
</xs:documentation>
</xs:annotation>
<xs:complexType mixed="true">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="phrase.class"/>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
<xs:attribute name="ref" type="xs:anyURI" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="termref" substitutionGroup="ref.class">
<xs:annotation>
<xs:documentation>
Used for links to definitions of terms
</xs:documentation>
</xs:annotation>
<xs:complexType mixed="true">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="phrase.class"/>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
<xs:attribute name="ref" type="xs:anyURI" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="errorref" substitutionGroup="ref.class">
<xs:annotation>
<xs:documentation>
Used for links to error definition
</xs:documentation>
</xs:annotation>
<xs:complexType mixed="true">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="phrase.class"/>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
<xs:attribute name="ref" type="xs:anyURI" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="xtermref" substitutionGroup="ref.class">
<xs:annotation>
<xs:documentation>
Used for links to external term definitions
</xs:documentation>
</xs:annotation>
<xs:complexType mixed="true">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="phrase.class"/>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
<xs:attribute name="bibref" type="xs:IDREF" use="required"/>
<xs:attribute name="idref" type="xs:token" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="xmlref" substitutionGroup="ref.class">
<xs:annotation>
<xs:documentation>
Used for links to snippets of XML
</xs:documentation>
</xs:annotation>
<xs:complexType mixed="true">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="phrase.class"/>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
<xs:attribute name="ref" type="xs:anyURI" use="required"/>
</xs:complexType>
</xs:element>
<!-- Structural elements -->
<xs:element id="schema-spec" name="spec" type="spec.model"/>
<xs:complexType name="spec.model">
<xs:sequence>
<xs:element ref="header"/>
<xs:element ref="body"/>
<xs:element ref="back"/>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
<!-- Header content model -->
<xs:element name="header" type="header.model"/>
<xs:complexType name="header.model">
<xs:sequence>
<xs:choice>
<xs:element ref="wg"/>
<xs:element ref="includeChunk"/>
</xs:choice>
<xs:element ref="title"/>
<xs:element ref="subtitle" minOccurs="0"/>
<xs:element ref="pubtype" minOccurs="0"/>
<!-- Defaults to Specification (if missing) -->
<xs:element ref="id"/>
<xs:element ref="parentid" minOccurs="0"/>
<!-- Defaults to value of id (if missing) -->
<xs:choice>
<xs:element ref="feedback"/>
<xs:element ref="includeChunk"/>
</xs:choice>
<xs:element ref="namespaces" minOccurs="0"/>
<xs:choice>
<xs:element ref="version"/>
<xs:element ref="includeChunk"/>
</xs:choice>
<xs:choice>
<xs:element ref="date"/>
<xs:element ref="includeChunk"/>
</xs:choice>
<xs:choice>
<xs:element ref="status"/>
<xs:element ref="includeChunk"/>
</xs:choice>
<xs:choice>
<xs:element ref="authors"/>
<xs:element ref="includeChunk"/>
</xs:choice>
<xs:choice>
<xs:element ref="contributors"/>
<xs:element ref="includeChunk"/>
</xs:choice>
<xs:choice>
<xs:element ref="abstract"/>
<xs:element ref="includeChunk"/>
</xs:choice>
<xs:choice minOccurs="0">
<xs:element ref="notice"/>
<xs:element ref="includeChunk"/>
</xs:choice>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
<xs:element name="wg" type="text.model">
<xs:annotation>
<xs:documentation>
Container for the name of the working group eg: "Formula Working Group"
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="title" type="text.model"/>
<xs:element name="subtitle" type="text.model"/>
<xs:element name="id">
<xs:annotation>
<xs:documentation>
Contains the string ID for the document to be used in constructing the document URL.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:NMTOKEN">
<xs:attributeGroup ref="common.att"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="parentid">
<xs:annotation>
<xs:documentation>
Contains the string ID for the document that this document supports to be used in constructing the document URL. If omitted id is used to construct the URL.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:NMTOKEN">
<xs:attributeGroup ref="common.att"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:simpleType name="publication.type">
<xs:restriction base="xs:token">
<xs:enumeration value="Specification"/>
<xs:enumeration value="WGN"/>
<xs:enumeration value="RFC"/>
<xs:enumeration value="PN"/>
<xs:enumeration value="REQ"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="pubtype" type="publication.type">
<xs:annotation>
<xs:documentation>
Identifies the type of document to be used in constructing the document URL for publication. Valid types are Specification WGN (Working Group Note) RFC (Request for Comments) PN (Practice Note) REQ (Requirements)
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="feedback" type="string.model">
<xs:annotation>
<xs:documentation>
Contains the email address to use to provide feedback to the WG.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="namespaces">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:element name="namespace">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:anyURI">
<xs:attribute name="prefix" type="xs:NCName" use="optional"/>
<xs:attribute name="url" type="xs:anyURI" use="optional"/>
<xs:attribute name="value" type="xs:anyURI"/>
<xs:attributeGroup ref="common-idreq.att"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
</xs:element>
<xs:element name="version" type="text.model"/>
<xs:simpleType name="status.type">
<xs:restriction base="xs:token">
<xs:enumeration value="REC"/>
<xs:enumeration value="RR"/>
<xs:enumeration value="DRR"/>
<xs:enumeration value="PER"/>
<xs:enumeration value="DPER"/>
<xs:enumeration value="PR"/>
<xs:enumeration value="DPR"/>
<xs:enumeration value="CR"/>
<xs:enumeration value="DCR"/>
<xs:enumeration value="FWGN"/>
<xs:enumeration value="DFWGN"/>
<xs:enumeration value="WGN"/>
<xs:enumeration value="DWGN"/>
<xs:enumeration value="PWD"/>
<xs:enumeration value="DPWD"/>
<xs:enumeration value="IWD"/>
<xs:enumeration value="WGWD"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="status">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="status.type">
<xs:attributeGroup ref="common.att"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="notice" substitutionGroup="chunk.class">
<xs:complexType>
<xs:sequence>
<xs:group maxOccurs="unbounded" ref="simple.section.group"/>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
</xs:element>
<xs:element name="date">
<xs:complexType>
<xs:attributeGroup ref="date.att"/>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
</xs:element>
<xs:element name="abstract">
<xs:complexType>
<xs:sequence>
<xs:group maxOccurs="unbounded" ref="simple.section.group"/>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
</xs:element>
<!-- Body content model -->
<xs:element name="body" type="sections.model"/>
<xs:complexType name="sections.model">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:choice>
<xs:element ref="section"/>
<xs:element ref="includeChunk"/>
</xs:choice>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
<!-- Back content model -->
<xs:element name="back" type="sections.model"/>
<!-- Elements used in a variety of places -->
<xs:element name="head" type="text.model">
<xs:annotation>
<xs:documentation>
General heading for sections.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="authors">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:choice>
<xs:element ref="person"/>
<xs:element ref="includeChunk"/>
</xs:choice>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
</xs:element>
<xs:element name="contributors">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:choice>
<xs:element ref="person"/>
<xs:element ref="includeChunk"/>
</xs:choice>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
</xs:element>
<xs:element name="person" type="person.model"/>
<xs:complexType name="string.model">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attributeGroup ref="common.att"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="person.model">
<xs:annotation>
<xs:documentation>
Used for documenting people
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="name" type="string.model"/>
<xs:element name="affiliation" type="string.model" minOccurs="0"/>
<xs:element name="email" type="string.model" minOccurs="0"/>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
<!-- Document sections -->
<xs:element name="chunk.class" abstract="true"/>
<xs:element name="section">
<xs:complexType>
<xs:sequence>
<xs:element ref="head"/>
<xs:choice maxOccurs="unbounded">
<xs:element ref="chunk.class"/>
<xs:element ref="section"/>
</xs:choice>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
</xs:element>
<!-- Document chunks -->
<xs:element name="includeChunk" substitutionGroup="chunk.class">
<xs:annotation>
<xs:documentation>
Used for references to external XML resources that are to be included in the document in place of the element providing the reference.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="common.att"/>
<xs:attribute name="ref" type="xs:anyURI" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="p" substitutionGroup="chunk.class" type="paragraph.model">
<xs:annotation>
<xs:documentation>
Paragraph container
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="paragraph.model" mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="phrase.class"/>
</xs:choice>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
<xs:element name="list.class" abstract="true" substitutionGroup="chunk.class"/>
<xs:element name="table.class" abstract="true" substitutionGroup="chunk.class"/>
<xs:element name="figure.class" abstract="true" substitutionGroup="chunk.class"/>
<xs:element name="example.class" abstract="true" substitutionGroup="chunk.class"/>
<xs:element name="note.class" abstract="true" substitutionGroup="chunk.class"/>
<xs:element name="img" substitutionGroup="chunk.class">
<xs:annotation>
<xs:documentation>
Used for incorporating external images.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attribute name="src" type="xs:anyURI" use="required"/>
<xs:attribute name="alt" type="xs:string"/>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
</xs:element>
<!-- List structures -->
<xs:element name="ulist" substitutionGroup="list.class">
<xs:annotation>
<xs:documentation>
Unordered list with bullets
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="item"/>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
</xs:element>
<xs:element name="olist" substitutionGroup="list.class">
<xs:annotation>
<xs:documentation>
Ordered list with numbering
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="item"/>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
</xs:element>
<xs:element name="slist" substitutionGroup="list.class">
<xs:annotation>
<xs:documentation>
Simple list with no bullets or numbering
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="item"/>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
</xs:element>
<xs:element name="bibliography" substitutionGroup="list.class">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:choice>
<xs:element ref="includeChunk"/>
<xs:element ref="reference"/>
</xs:choice>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
</xs:element>
<xs:element name="revisions" substitutionGroup="list.class">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="revision"/>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
</xs:element>
<xs:element name="errata" substitutionGroup="list.class">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="erratum"/>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
</xs:element>
<!-- List item structures -->
<xs:element name="item.class" abstract="true"/>
<xs:element name="item" substitutionGroup="item.class">
<xs:complexType mixed="true">
<xs:sequence>
<xs:element ref="phrase.class" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="list.class" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
</xs:element>
<xs:element name="reference" substitutionGroup="item.class">
<xs:complexType mixed="true">
<xs:sequence>
<xs:element ref="title"/>
<xs:element ref="publisher" minOccurs="0"/>
<xs:element ref="authors" minOccurs="0"/>
</xs:sequence>
<xs:attributeGroup ref="href.att"/>
<xs:attributeGroup ref="common-idreq.att"/>
<xs:attribute name="key"/>
<xs:attributeGroup ref="date.att"/>
</xs:complexType>
</xs:element>
<xs:element name="publisher" type="text.model"/>
<xs:element name="revision" substitutionGroup="item.class">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="chunk.class"/>
</xs:sequence>
<xs:attributeGroup ref="ref-req.att"/>
<xs:attributeGroup ref="common.att"/>
<xs:attributeGroup ref="date.att"/>
</xs:complexType>
</xs:element>
<xs:element name="erratum" substitutionGroup="item.class">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="chunk.class"/>
<xs:element name="sectionref" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
<xs:attributeGroup ref="date.att"/>
</xs:complexType>
</xs:element>
<!-- Figures -->
<xs:element name="figure" substitutionGroup="figure.class">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" ref="caption"/>
<xs:choice>
<xs:element ref="p"/>
<xs:element ref="table"/>
<xs:element ref="img"/>
<xs:element ref="verbatim"/>
</xs:choice>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
</xs:element>
<!-- Example structures -->
<xs:element name="example" substitutionGroup="example.class">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" ref="caption"/>
<xs:choice maxOccurs="unbounded">
<xs:element ref="p"/>
<xs:element ref="table"/>
<xs:element ref="img"/>
<xs:element ref="verbatim"/>
<xs:element ref="list.class"/>
</xs:choice>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
</xs:complexType>
</xs:element>
<!-- HTML style table structure -->
<xs:element name="table" substitutionGroup="chunk.class">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" ref="caption"/>
<xs:choice>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="col"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="colgroup"/>
</xs:choice>
<xs:element minOccurs="0" ref="thead"/>
<xs:element maxOccurs="unbounded" ref="tbody"/>
<xs:element minOccurs="0" ref="tfoot"/>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
<xs:attributeGroup ref="width.att"/>
<xs:attribute name="summary"/>
<xs:attribute name="border"/>
<xs:attribute name="frame">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="void"/>
<xs:enumeration value="above"/>
<xs:enumeration value="below"/>
<xs:enumeration value="hsides"/>
<xs:enumeration value="lhs"/>
<xs:enumeration value="rhs"/>
<xs:enumeration value="vsides"/>
<xs:enumeration value="box"/>
<xs:enumeration value="border"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="rules">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="none"/>
<xs:enumeration value="groups"/>
<xs:enumeration value="rows"/>
<xs:enumeration value="cols"/>
<xs:enumeration value="all"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="cellspacing"/>
<xs:attribute name="cellpadding"/>
</xs:complexType>
</xs:element>
<xs:element name="caption" type="text.model"/>
<xs:element name="col">
<xs:complexType>
<xs:attributeGroup ref="common.att"/>
<xs:attributeGroup ref="span.att"/>
<xs:attributeGroup ref="width.att"/>
<xs:attributeGroup ref="cellhalign.att"/>
<xs:attributeGroup ref="cellvalign.att"/>
</xs:complexType>
</xs:element>
<xs:element name="colgroup">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="col"/>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
<xs:attributeGroup ref="span.att"/>
<xs:attributeGroup ref="width.att"/>
<xs:attributeGroup ref="cellhalign.att"/>
<xs:attributeGroup ref="cellvalign.att"/>
</xs:complexType>
</xs:element>
<xs:element name="thead">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:choice>
<xs:element ref="tr"/>
<xs:element ref="includeChunk"/>
</xs:choice>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
<xs:attributeGroup ref="cellhalign.att"/>
<xs:attributeGroup ref="cellvalign.att"/>
</xs:complexType>
</xs:element>
<xs:element name="tfoot">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:choice>
<xs:element ref="tr"/>
<xs:element ref="includeChunk"/>
</xs:choice>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
<xs:attributeGroup ref="cellhalign.att"/>
<xs:attributeGroup ref="cellvalign.att"/>
</xs:complexType>
</xs:element>
<xs:element name="tbody">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:choice>
<xs:element ref="tr"/>
<xs:element ref="includeChunk"/>
</xs:choice>
</xs:sequence>
<xs:attributeGroup ref="common.att"/>
<xs:attributeGroup ref="cellhalign.att"/>
<xs:attributeGroup ref="cellvalign.att"/>
</xs:complexType>
</xs:element>
<xs:element name="tr">
<xs:complexType>
<xs:choice>
<xs:element ref="principle"/>
<xs:element ref="requirement"/>
<xs:element ref="th" maxOccurs="unbounded"/>
<xs:element ref="td" maxOccurs="unbounded"/>
</xs:choice>
<xs:attributeGroup ref="common.att"/>
<xs:attributeGroup ref="cellhalign.att"/>
<xs:attributeGroup ref="cellvalign.att"/>
</xs:complexType>
</xs:element>
<xs:element name="th">
<xs:complexType mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="chunk.class"/>
<xs:element ref="phrase.class"/>
</xs:choice>
<xs:attributeGroup ref="common.att"/>
<xs:attributeGroup ref="thtd.att"/>
<xs:attributeGroup ref="cellhalign.att"/>
<xs:attributeGroup ref="cellvalign.att"/>
</xs:complexType>
</xs:element>
<xs:element name="td">
<xs:complexType mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="chunk.class"/>
<xs:element ref="phrase.class"/>
</xs:choice>
<xs:attributeGroup ref="common.att"/>
<xs:attributeGroup ref="thtd.att"/>
<xs:attributeGroup ref="cellhalign.att"/>
<xs:attributeGroup ref="cellvalign.att"/>
</xs:complexType>
</xs:element>
<xs:attributeGroup name="cellhalign.att">
<xs:attribute name="align">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="left"/>
<xs:enumeration value="center"/>
<xs:enumeration value="right"/>
<xs:enumeration value="justify"/>
<xs:enumeration value="char"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="char"/>
<xs:attribute name="charoff"/>
</xs:attributeGroup>
<xs:attributeGroup name="cellvalign.att">
<xs:attribute name="valign">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="top"/>
<xs:enumeration value="middle"/>
<xs:enumeration value="bottom"/>
<xs:enumeration value="baseline"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:attributeGroup>
<xs:attributeGroup name="thtd.att">
<xs:attribute name="abbr"/>
<xs:attribute name="axis"/>
<xs:attribute name="headers" type="xs:IDREFS"/>
<xs:attribute name="scope">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="row"/>
<xs:enumeration value="col"/>
<xs:enumeration value="rowgroup"/>
<xs:enumeration value="colgroup"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="rowspan" default="1" type="xs:NMTOKEN"/>
<xs:attribute name="colspan" default="1" type="xs:NMTOKEN"/>
</xs:attributeGroup>
<xs:attributeGroup name="width.att">
<xs:attribute name="width"/>
</xs:attributeGroup>
<xs:attributeGroup name="span.att">
<xs:attribute name="span" default="1" type="xs:NMTOKEN"/>
</xs:attributeGroup>
</xs:schema>

Appendix B Transformation stylesheets

This stylesheet is used to create a temporary XML file containing the included text from <include.chunk> elements before the final transformation to HTML.

<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:s="http://xbrl.org/specification/2007" xmlns:diff="http://xbrl.org/specification/2007/diff" version="2.0">
<xsl:output method="xml" encoding="utf-8" indent="yes"/>
<!-- Mark changes added elements for all diff attributes -->
<xsl:param name="mark-changes" select="0"/>
<xsl:template match="*[@diff]">
<xsl:choose>
<xsl:when test="$mark-changes">
<xsl:element name="diff:{@diff}">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates select="comment() | text() | processing-instruction() | *"/>
</xsl:copy>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates select="comment() | text() | processing-instruction() | *"/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="/ | *">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates select="comment() | text() | processing-instruction() | *"/>
</xsl:copy>
</xsl:template>
<xsl:template match="@* | text() | comment() | processing-instruction()">
<xsl:copy/>
</xsl:template>
<xsl:template match="s:includeChunk | s:includePhrase">
<xsl:apply-templates select="document(@ref,/.)/*"/>
</xsl:template>
<xsl:template match="s:container">
<xsl:apply-templates/>
</xsl:template>
</xsl:transform>

This stylesheet is used to create the final HTML output from the input XML document.

<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:s="http://xbrl.org/specification/2007" xmlns:diff="http://xbrl.org/specification/2007/diff" version="2.0">
<xsl:output method="html" encoding="utf-8" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" indent="no"/>
<xsl:param name="locationTellTale"/>
<xsl:strip-space elements="s:p s:br s:definition s:principle s:requirement s:long s:short s:item s:termref s:xtermref s:xmlref s:sectionref s:bibref s:exampleref s:figureref s:tableref s:errorref"/>
<xsl:key name="ids" match="*[@id]" use="@id"/>
<xsl:key name="refs" match="s:sectionref | s:requirementref | s:principleref | s:tableref | s:figureref | s:exampleref | s:termref | s:bibref | s:errorref" use="@ref"/>
<xsl:param name="generate-css" select="1"/>
<xsl:param name="base.uri" select="'http://www.xbrl.org'"/>
<xsl:param name="toc.level" select="7"/>
<!-- Parameter to control whether conformance test references are included in produced documents. It defaults to excluding them. -->
<xsl:param name="include.conformance.tests" select="0"/>
<!-- Parameter to provide the URL of the document containing conformance suite information. -->
<xsl:param name="conformance.map" select="'../../infrastructure/conformanceMap.xml'"/>
<xsl:variable name="conformance.tests" select="document($conformance.map)/*/*"/>
<!-- Global variables -->
<xsl:variable name="namespace-uri" select="'http://xbrl.org/specification/2007'"/>
<xsl:variable name="specId" select="/s:spec/s:header/s:id"/>
<xsl:variable name="pubType">
<xsl:choose>
<xsl:when test="/s:spec/s:header/s:pubtype!=''">
<xsl:value-of select="/s:spec/s:header/s:pubtype"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>
Specification
</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="parentId" select="/s:spec/s:header/s:parentid"/>
<xsl:variable name="projectFolder">
<xsl:choose>
<xsl:when test="$parentId!=''">
<xsl:value-of select="$parentId"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$specId"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="status" select="/s:spec/s:header/s:status"/>
<xsl:variable name="date" select="/s:spec/s:header/s:date"/>
<xsl:variable name="rootdir">
<xsl:choose>
<xsl:when test="$status='PWD'">
<xsl:text>
pub
</xsl:text>
</xsl:when>
<xsl:when test="$status='CR'">
<xsl:text>
pub
</xsl:text>
</xsl:when>
<xsl:when test="$status='PR'">
<xsl:text>
pub
</xsl:text>
</xsl:when>
<xsl:when test="$status='REC'">
<xsl:text>
pub
</xsl:text>
</xsl:when>
<xsl:when test="$status='WGN'">
<xsl:text>
pub
</xsl:text>
</xsl:when>
<xsl:when test="$status='FWGN'">
<xsl:text>
pub
</xsl:text>
</xsl:when>
<xsl:when test="$status='PER'">
<xsl:text>
pub
</xsl:text>
</xsl:when>
<xsl:when test="$status='RR'">
<xsl:text>
pub
</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>
nopub
</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="outputFileName">
<xsl:choose>
<xsl:when test="$pubType='Specification'">
<!-- Specifications do not have "spec" in the file name -->
<xsl:value-of select="concat($specId,'-',$status,'-',$date/@year,'-',$date/@month,'-',$date/@day,'.html')"/>
</xsl:when>
<xsl:otherwise>
<!-- Everything else has the publication type code in the file name -->
<xsl:value-of select="concat($specId,'-',$pubType,'-',$status,'-',$date/@year,'-',$date/@month,'-',$date/@day,'.html')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="directory" select="concat($pubType,'/',$projectFolder,'/',$status,'-',$date/@year,'-',$date/@month,'-',$date/@day,'/')"/>
<!-- Create links to conformance suite tests -->
<xsl:template match="@id" mode="conformance">
<xsl:if test="$include.conformance.tests">
<xsl:variable name="id" select="."/>
<xsl:variable name="related.tests" select="$conformance.tests[@partId=$id and @specId=$specId]"/>
<xsl:for-each select="$related.tests">
<span xmlns="" class="conformancetest">
 
<a href="../../{@testURL}">
<xsl:value-of select="@number"/>
</a>
</span>
</xsl:for-each>
</xsl:if>
</xsl:template>
<!-- Default handler to show elements that are not being treated correctly -->
<xsl:template match="*">
<div xmlns="" class="error">
<xsl:text>
&lt;
</xsl:text>
<xsl:value-of select="name(.)"/>
<xsl:text>
&gt;
</xsl:text>
<xsl:text></xsl:text>
<xsl:apply-templates/>
<xsl:text>
&lt;/
</xsl:text>
<xsl:value-of select="name(.)"/>
<xsl:text>
&gt;
</xsl:text>
</div>
</xsl:template>
<!-- Calculate the name of the output file and location where to put it -->
<xsl:template match="/">
<xsl:variable name="localDirectory" select="concat('../',$rootdir,'/',$directory)"/>
<xsl:result-document href="{$localDirectory}{$outputFileName}">
<xsl:apply-templates/>
</xsl:result-document>
<xsl:if test="$locationTellTale">
<xsl:result-document href="location.txt" method="text">
<xsl:value-of select="concat($localDirectory,$outputFileName)"/>
</xsl:result-document>
</xsl:if>
<xsl:if test="$generate-css = 1">
<xsl:result-document href="{$localDirectory}styles.css" method="text">
<xsl:value-of select="document('styles.xml')/*"/>
</xsl:result-document>
</xsl:if>
</xsl:template>
<!-- ============================================================= -->
<!-- Document structure and metadata templates -->
<!-- ============================================================= -->
<xsl:template match="s:spec">
<html xmlns="">
<head>
<title>
<xsl:apply-templates select="s:header/s:title" mode="page-title"/>
<xsl:if test="s:header/s:version">
<xsl:call-template name="space"/>
<xsl:apply-templates select="s:header/s:version" mode="page-title"/>
</xsl:if>
</title>
<link rel="stylesheet" type="text/css" href="styles.css"/>
</head>
<body>
<xsl:apply-templates/>
<xsl:call-template name="endnotes"/>
</body>
</html>
</xsl:template>
<xsl:template match="s:header">
<div xmlns="" class="head">
<xsl:call-template name="banner"/>
<xsl:call-template name="newline"/>
<xsl:apply-templates select="s:title"/>
<xsl:apply-templates select="s:subtitle"/>
<xsl:call-template name="newline"/>
<h2>
<xsl:call-template name="status-text"/>
<xsl:call-template name="space"/>
<xsl:call-template name="full-date"/>
</h2>
<p>
<xsl:text>
Copyright ©
</xsl:text>
<xsl:value-of select="s:date/@year"/>
<xsl:text>
XBRL International Inc., All Rights Reserved.
</xsl:text>
</p>
<dl>
<xsl:call-template name="url"/>
<xsl:apply-templates select="s:authors"/>
<xsl:apply-templates select="s:contributors"/>
</dl>
<hr/>
<xsl:call-template name="status"/>
<xsl:apply-templates select="s:notice"/>
<xsl:apply-templates select="s:abstract"/>
</div>
</xsl:template>
<xsl:template match="s:title">
<h1 xmlns="">
<xsl:call-template name="anchor">
<xsl:with-param name="node" select="."/>
<xsl:with-param name="conditional" select="0"/>
<xsl:with-param name="default.id" select="'title'"/>
</xsl:call-template>
<xsl:apply-templates/>
<xsl:call-template name="space"/>
<xsl:value-of select="../s:version"/>
</h1>
</xsl:template>
<xsl:template match="s:title" mode="page-title">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="s:version" mode="page-title">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="s:subtitle">
<xsl:call-template name="newline"/>
<h2 xmlns="">
<xsl:call-template name="anchor">
<xsl:with-param name="node" select="."/>
<xsl:with-param name="conditional" select="0"/>
<xsl:with-param name="default.id" select="'subtitle'"/>
</xsl:call-template>
<xsl:apply-templates/>
</h2>
</xsl:template>
<xsl:template name="url">
<xsl:choose>
<xsl:when test="$rootdir='pub'">
<xsl:call-template name="publishURL"/>
</xsl:when>
<xsl:otherwise>
<dt xmlns="">
This version:
</dt>
<dd xmlns="">
<xsl:value-of select="$outputFileName"/>
</dd>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="publishURL">
<xsl:variable name="pubURL" select="concat($base.uri,'/',$directory,$outputFileName)"/>
<dt xmlns="">
This version:
</dt>
<dd xmlns="">
<a href="{$pubURL}">
<xsl:text>
&lt;
</xsl:text>
<xsl:value-of select="$pubURL"/>
<xsl:text>
&gt;
</xsl:text>
</a>
</dd>
</xsl:template>
<xsl:template match="s:authors">
<dt xmlns="">
<xsl:text>
Editor
</xsl:text>
<xsl:if test="count(s:person) &gt; 1">
<xsl:text>
s
</xsl:text>
</xsl:if>
<xsl:text>
:
</xsl:text>
</dt>
<xsl:apply-templates select="s:person" mode="this_document"/>
</xsl:template>
<xsl:template match="s:contributors">
<dt xmlns="">
<xsl:text>
Contributor
</xsl:text>
<xsl:if test="count(s:person) &gt; 1">
<xsl:text>
s
</xsl:text>
</xsl:if>
<xsl:text>
:
</xsl:text>
</dt>
<xsl:apply-templates select="s:person" mode="this_document"/>
</xsl:template>
<xsl:template match="s:person" mode="this_document">
<dd xmlns="">
<a name="{@id}" id="{@id}"/>
<xsl:apply-templates mode="this_document"/>
</dd>
</xsl:template>
<xsl:template match="s:name" mode="this_document">
<xsl:apply-templates/>
,
</xsl:template>
<xsl:template match="s:affiliation" mode="this_document">
<xsl:text></xsl:text>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="s:email" mode="this_document">
<xsl:text></xsl:text>
<a xmlns="" href="mailto:{text()}">
<xsl:text>
&lt;
</xsl:text>
<xsl:apply-templates/>
<xsl:text>
&gt;
</xsl:text>
</a>
</xsl:template>
<xsl:template match="s:person">
<dd xmlns="">
<a name="{@id}" id="{@id}"/>
<xsl:apply-templates/>
</dd>
</xsl:template>
<xsl:template match="s:name">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="s:affiliation">
<xsl:text></xsl:text>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="s:email">
<xsl:text></xsl:text>
<a xmlns="" href="mailto:{text()}">
<xsl:text>
&lt;
</xsl:text>
<xsl:apply-templates/>
<xsl:text>
&gt;
</xsl:text>
</a>
</xsl:template>
<xsl:template match="s:notice">
<div xmlns="" class="notice">
<p class="prefix">
<b>
NOTICE:
</b>
</p>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="s:abstract">
<div xmlns="">
<xsl:call-template name="newline"/>
<h2>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
<xsl:with-param name="default.id" select="'abstract'"/>
</xsl:call-template>
<xsl:text>
Abstract
</xsl:text>
</h2>
<xsl:apply-templates/>
</div>
<xsl:variable name="comments" select="//s:comment"/>
<xsl:if test="$comments">
<h3 xmlns="">
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
<xsl:with-param name="default.id" select="'comments'"/>
</xsl:call-template>
<xsl:text>
Comment
</xsl:text>
<xsl:if test="count($comments) &gt; 1">
<xsl:text>
s
</xsl:text>
</xsl:if>
</h3>
<p xmlns="" class="toc">
<xsl:apply-templates select="$comments" mode="toc"/>
</p>
</xsl:if>
</xsl:template>
<xsl:template match="s:body">
<xsl:call-template name="toc"/>
<div xmlns="" class="body">
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="s:section">
<xsl:variable name="depth" select="count(ancestor::s:section)+1"/>
<div xmlns="" class="{concat('div',$depth)}">
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="s:head">
<xsl:variable name="depth" select="count(ancestor::s:section)"/>
<xsl:choose>
<xsl:when test="$depth &lt; 6">
<xsl:element name="{concat('h',$depth)}">
<xsl:apply-templates select=".." mode="divnum"/>
<xsl:call-template name="space"/>
<xsl:apply-templates/>
<xsl:apply-templates select="../@id" mode="conformance"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="h6">
<xsl:apply-templates select=".." mode="divnum"/>
<xsl:call-template name="space"/>
<xsl:apply-templates/>
<xsl:apply-templates select="../@id" mode="conformance"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="s:back">
<div xmlns="" class="back">
<xsl:apply-templates/>
</div>
</xsl:template>
<!-- ============================================================= -->
<!-- Table of contents -->
<!-- ============================================================= -->
<xsl:template name="toc">
<xsl:if test="$toc.level &gt; 0">
<div xmlns="" class="toc">
<xsl:call-template name="newline"/>
<h2>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
<xsl:with-param name="default.id" select="'contents'"/>
</xsl:call-template>
<xsl:text>
Table of Contents
</xsl:text>
</h2>
<p class="toc">
<xsl:apply-templates select="s:section" mode="toc"/>
</p>
<xsl:if test="../s:back">
<xsl:call-template name="newline"/>
<h3>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
<xsl:with-param name="default.id" select="'appendices'"/>
</xsl:call-template>
<xsl:text>
Appendi
</xsl:text>
<xsl:choose>
<xsl:when test="count(../s:back/s:section) &gt; 1">
<xsl:text>
ces
</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>
x
</xsl:text>
</xsl:otherwise>
</xsl:choose>
</h3>
<p class="toc">
<xsl:apply-templates mode="toc" select="../s:back/s:section"/>
</p>
</xsl:if>
<xsl:variable name="endnotes" select="//s:footnote[not(ancestor::s:table)]"/>
<xsl:if test="$endnotes">
<p class="toc">
<a href="#endnotes">
<xsl:text>
End note
</xsl:text>
<xsl:if test="count($endnotes) &gt; 1">
<xsl:text>
s
</xsl:text>
</xsl:if>
</a>
</p>
</xsl:if>
<xsl:variable name="tables" select="//s:caption[parent::s:table]"/>
<xsl:if test="$tables">
<h3>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
<xsl:with-param name="default.id" select="'examples'"/>
</xsl:call-template>
<xsl:text>
Table
</xsl:text>
<xsl:if test="count($tables) &gt; 1">
<xsl:text>
s
</xsl:text>
</xsl:if>
</h3>
<p class="toc">
<xsl:apply-templates select="$tables" mode="toc"/>
</p>
</xsl:if>
<xsl:variable name="figures" select="//s:caption[parent::s:figure]"/>
<xsl:if test="$figures">
<h3>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
<xsl:with-param name="default.id" select="'figures'"/>
</xsl:call-template>
<xsl:text>
Figure
</xsl:text>
<xsl:if test="count($figures) &gt; 1">
<xsl:text>
s
</xsl:text>
</xsl:if>
</h3>
<p class="toc">
<xsl:apply-templates select="$figures" mode="toc"/>
</p>
</xsl:if>
<xsl:variable name="examples" select="//s:caption[parent::s:example]"/>
<xsl:if test="$examples">
<h3>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
<xsl:with-param name="default.id" select="'figures'"/>
</xsl:call-template>
<xsl:text>
Example
</xsl:text>
<xsl:if test="count($examples) &gt; 1">
<xsl:text>
s
</xsl:text>
</xsl:if>
</h3>
<p class="toc">
<xsl:apply-templates select="$examples" mode="toc"/>
</p>
</xsl:if>
<xsl:variable name="definitions" select="//s:definition[count(@noindex)=0 or @noindex=false()]"/>
<xsl:if test="$definitions">
<xsl:call-template name="newline"/>
<h3>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
<xsl:with-param name="default.id" select="'definitions'"/>
</xsl:call-template>
<xsl:text>
Definition
</xsl:text>
<xsl:if test="count($definitions) &gt; 1">
<xsl:text>
s
</xsl:text>
</xsl:if>
</h3>
<p class="toc">
<xsl:apply-templates mode="toc" select="$definitions">
<xsl:sort select="@term" data-type="text" order="ascending"/>
</xsl:apply-templates>
</p>
</xsl:if>
<xsl:variable name="principles" select="//s:principle[count(@noindex)=0 or @noindex=false()]"/>
<xsl:if test="$principles">
<xsl:call-template name="newline"/>
<h3>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
<xsl:with-param name="default.id" select="'principles'"/>
</xsl:call-template>
<xsl:text>
Principle
</xsl:text>
<xsl:if test="count($principles) &gt; 1">
<xsl:text>
s
</xsl:text>
</xsl:if>
</h3>
<p class="toc">
<xsl:apply-templates mode="toc" select="$principles">
<xsl:sort select="@name" data-type="text" order="ascending"/>
</xsl:apply-templates>
</p>
</xsl:if>
<xsl:variable name="requirements" select="//s:requirement[count(@noindex)=0 or @noindex=false()]"/>
<xsl:if test="$requirements">
<xsl:call-template name="newline"/>
<h3>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
<xsl:with-param name="default.id" select="'requirements'"/>
</xsl:call-template>
<xsl:text>
Requirement
</xsl:text>
<xsl:if test="count($requirements) &gt; 1">
<xsl:text>
s
</xsl:text>
</xsl:if>
</h3>
<p class="toc">
<xsl:apply-templates mode="toc" select="$requirements">
<xsl:sort select="@name" data-type="text" order="ascending"/>
</xsl:apply-templates>
</p>
</xsl:if>
<xsl:variable name="errors" select="//s:error"/>
<xsl:if test="$errors">
<xsl:call-template name="newline"/>
<h3>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
<xsl:with-param name="default.id" select="'error_codes'"/>
</xsl:call-template>
<xsl:text>
Error code
</xsl:text>
<xsl:if test="count($errors) &gt; 1">
<xsl:text>
s
</xsl:text>
</xsl:if>
</h3>
<p class="toc">
<xsl:apply-templates mode="toc" select="$errors">
<xsl:sort select="s:errorcode/@code" data-type="text" order="ascending"/>
</xsl:apply-templates>
</p>
</xsl:if>
</div>
<hr xmlns=""/>
</xsl:if>
</xsl:template>
<xsl:template mode="toc" match="s:section">
<xsl:call-template name="indent"/>
<xsl:apply-templates select="." mode="divnum-toc"/>
<xsl:call-template name="space"/>
<a xmlns="">
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="target" select="."/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="s:head" mode="text"/>
</a>
<br xmlns=""/>
<xsl:call-template name="newline"/>
<xsl:if test="count(ancestor::*) &lt;= $toc.level">
<xsl:apply-templates select="s:section" mode="toc"/>
</xsl:if>
</xsl:template>
<xsl:template name="indent">
<xsl:for-each select="ancestor::s:section">
<xsl:call-template name="space"/>
<xsl:call-template name="space"/>
<xsl:call-template name="space"/>
</xsl:for-each>
</xsl:template>
<xsl:template name="href.target">
<xsl:param name="target" select="."/>
<xsl:text>
#
</xsl:text>
<xsl:choose>
<xsl:when test="$target/@id">
<xsl:value-of select="$target/@id"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="generate-id($target)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template mode="divnum" match="s:section">
<xsl:param name="depth" select="count(ancestor::s:section)+1"/>
<xsl:choose>
<xsl:when test="ancestor::s:body">
<xsl:choose>
<xsl:when test="$depth = 1">
<xsl:number format="1"/>
</xsl:when>
<xsl:when test="$depth = 2">
<xsl:number level="multiple" format="1.1"/>
</xsl:when>
<xsl:when test="$depth = 3">
<xsl:number level="multiple" format="1.1.1"/>
</xsl:when>
<xsl:when test="$depth = 4">
<xsl:number level="multiple" format="1.1.1.1"/>
</xsl:when>
<xsl:when test="$depth = 5">
<xsl:number level="multiple" format="1.1.1.1.1"/>
</xsl:when>
<xsl:when test="$depth = 6">
<xsl:number level="multiple" format="1.1.1.1.1.1"/>
</xsl:when>
<xsl:when test="$depth = 7">
<xsl:number level="multiple" format="1.1.1.1.1.1.1"/>
</xsl:when>
<xsl:when test="$depth = 8">
<xsl:number level="multiple" format="1.1.1.1.1.1.1.1"/>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$depth = 1">
<xsl:text>
Appendix
</xsl:text>
<xsl:number format="A"/>
</xsl:when>
<xsl:when test="$depth = 2">
<xsl:number level="multiple" format="A.1"/>
</xsl:when>
<xsl:when test="$depth = 3">
<xsl:number level="multiple" format="A.1.1"/>
</xsl:when>
<xsl:when test="$depth = 4">
<xsl:number level="multiple" format="A.1.1.1"/>
</xsl:when>
<xsl:when test="$depth = 5">
<xsl:number level="multiple" format="A.1.1.1.1"/>
</xsl:when>
<xsl:when test="$depth = 6">
<xsl:number level="multiple" format="A.1.1.1.1.1"/>
</xsl:when>
<xsl:when test="$depth = 7">
<xsl:number level="multiple" format="A.1.1.1.1.1.1"/>
</xsl:when>
<xsl:when test="$depth = 8">
<xsl:number level="multiple" format="A.1.1.1.1.1.1.1"/>
</xsl:when>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template mode="divnum-toc" match="s:section">
<xsl:param name="depth" select="count(ancestor::s:section)+1"/>
<xsl:choose>
<xsl:when test="ancestor::s:body">
<xsl:choose>
<xsl:when test="$depth = 1">
<xsl:number format="1"/>
</xsl:when>
<xsl:when test="$depth = 2">
<xsl:number level="multiple" format="1.1"/>
</xsl:when>
<xsl:when test="$depth = 3">
<xsl:number level="multiple" format="1.1.1"/>
</xsl:when>
<xsl:when test="$depth = 4">
<xsl:number level="multiple" format="1.1.1.1"/>
</xsl:when>
<xsl:when test="$depth = 5">
<xsl:number level="multiple" format="1.1.1.1.1"/>
</xsl:when>
<xsl:when test="$depth = 6">
<xsl:number level="multiple" format="1.1.1.1.1.1"/>
</xsl:when>
<xsl:when test="$depth = 7">
<xsl:number level="multiple" format="1.1.1.1.1.1.1"/>
</xsl:when>
<xsl:when test="$depth = 8">
<xsl:number level="multiple" format="1.1.1.1.1.1.1.1"/>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$depth = 1">
<xsl:text/>
<xsl:number format="A"/>
</xsl:when>
<xsl:when test="$depth = 2">
<xsl:number level="multiple" format="A.1"/>
</xsl:when>
<xsl:when test="$depth = 3">
<xsl:number level="multiple" format="A.1.1"/>
</xsl:when>
<xsl:when test="$depth = 4">
<xsl:number level="multiple" format="A.1.1.1"/>
</xsl:when>
<xsl:when test="$depth = 5">
<xsl:number level="multiple" format="A.1.1.1.1"/>
</xsl:when>
<xsl:when test="$depth = 6">
<xsl:number level="multiple" format="A.1.1.1.1.1"/>
</xsl:when>
<xsl:when test="$depth = 7">
<xsl:number level="multiple" format="A.1.1.1.1.1.1"/>
</xsl:when>
<xsl:when test="$depth = 8">
<xsl:number level="multiple" format="A.1.1.1.1.1.1.1"/>
</xsl:when>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="s:head" mode="text">
<xsl:apply-templates/>
</xsl:template>
<xsl:template mode="toc" match="s:caption[parent::s:table]">
<xsl:value-of select="count(preceding::s:caption[parent::s:table])+1"/>
<xsl:call-template name="space"/>
<a xmlns="">
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="target" select=".."/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates/>
</a>
<br xmlns=""/>
</xsl:template>
<xsl:template mode="toc" match="s:caption[parent::s:example]">
<xsl:value-of select="count(preceding::s:caption[parent::s:example])+1"/>
<xsl:call-template name="space"/>
<a xmlns="">
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="target" select=".."/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates/>
</a>
<br xmlns=""/>
</xsl:template>
<xsl:template mode="toc" match="s:caption[parent::s:figure]">
<xsl:value-of select="count(preceding::s:caption[parent::s:figure])+1"/>
<xsl:call-template name="space"/>
<a xmlns="">
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="target" select=".."/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates/>
</a>
<br xmlns=""/>
</xsl:template>
<xsl:template mode="toc" match="s:error">
<a xmlns="">
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="target" select="."/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="s:errorcode"/>
</a>
<br xmlns=""/>
</xsl:template>
<xsl:template mode="toc" match="s:definition">
<a xmlns="">
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="target" select="."/>
</xsl:call-template>
</xsl:attribute>
<xsl:value-of select="@term"/>
</a>
<br xmlns=""/>
</xsl:template>
<xsl:template mode="toc" match="s:principle">
<a xmlns="">
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="target" select="."/>
</xsl:call-template>
</xsl:attribute>
<xsl:value-of select="@name"/>
:
<xsl:apply-templates select="s:short" mode="toc"/>
</a>
<br xmlns=""/>
</xsl:template>
<xsl:template mode="toc" match="s:requirement">
<a xmlns="">
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="target" select="."/>
</xsl:call-template>
</xsl:attribute>
<xsl:value-of select="@name"/>
:
<xsl:apply-templates select="s:short" mode="toc"/>
</a>
<br xmlns=""/>
</xsl:template>
<xsl:template mode="toc" match="s:comment">
<xsl:value-of select="count(preceding::s:comment)+1"/>
<xsl:call-template name="space"/>
<a xmlns="">
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="target" select="."/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="key('ids', @by)/s:name"/>
</a>
<xsl:text>
:
</xsl:text>
<xsl:apply-templates/>
<br xmlns=""/>
</xsl:template>
<!-- ============================================================= -->
<!-- Chunk templates -->
<!-- ============================================================= -->
<xsl:template match="s:p">
<p xmlns="">
<xsl:if test="@id">
<xsl:attribute name="id">
<xsl:value-of select="@id"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="@role">
<xsl:attribute name="class">
<xsl:value-of select="@role"/>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates/>
</p>
</xsl:template>
<xsl:template match="s:p[s:verbatim]">
<div xmlns="">
<xsl:if test="@id">
<xsl:attribute name="id">
<xsl:value-of select="@id"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="@role">
<xsl:attribute name="class">
<xsl:value-of select="@role"/>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="s:p[ancestor::s:revision]">
<p xmlns="" class="revision">
<xsl:if test="@id">
<xsl:attribute name="id">
<xsl:value-of select="@id"/>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates/>
</p>
</xsl:template>
<xsl:template match="s:p[ancestor::s:errata]">
<p xmlns="" class="errata">
<xsl:if test="@id">
<xsl:attribute name="id">
<xsl:value-of select="@id"/>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates/>
</p>
</xsl:template>
<xsl:template match="s:p[s:code and count(text())=0]">
<p xmlns="" class="code-paragraph">
<xsl:if test="@id">
<xsl:attribute name="id">
<xsl:value-of select="@id"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="@role">
<xsl:attribute name="class">
<xsl:value-of select="@role"/>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates/>
</p>
</xsl:template>
<xsl:template match="s:comment">
<span xmlns="" class="comment">
<xsl:if test="@id">
<xsl:attribute name="id">
<xsl:value-of select="@id"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="@role">
<xsl:attribute name="class">
<xsl:value-of select="@role"/>
</xsl:attribute>
</xsl:if>
<a>
<xsl:attribute name="name" select="generate-id()"/>
<xsl:attribute name="id" select="generate-id()"/>
<!-- xsl:attribute name="id"> <xsl:call-template name="href.target"> <xsl:with-param name="target" select="."/> </xsl:call-template> </xsl:attribute-->
</a>
<xsl:text>
[
</xsl:text>
<xsl:apply-templates select="key('ids', @by)/s:name"/>
<xsl:text>
:
</xsl:text>
<xsl:apply-templates/>
<xsl:text>
]
</xsl:text>
</span>
</xsl:template>
<xsl:template match="s:fileExample">
<xsl:apply-templates select="s:caption" mode="fileExample.heading"/>
<xsl:choose>
<xsl:when test="@role">
<div xmlns="" class="{@role}">
<xsl:apply-templates/>
</div>
</xsl:when>
<xsl:otherwise>
<div xmlns="" class="outerExample">
<xsl:apply-templates/>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="s:example">
<xsl:apply-templates select="s:caption" mode="example.heading"/>
<xsl:choose>
<xsl:when test="@role">
<div xmlns="" class="{@role}">
<xsl:apply-templates/>
</div>
</xsl:when>
<xsl:otherwise>
<div xmlns="" class="outerExample">
<xsl:apply-templates/>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="s:caption[parent::s:example]"/>
<xsl:template match="s:caption[parent::s:fileExample]"/>
<xsl:template match="s:caption" mode="fileExample.heading">
<div xmlns="" class="nonChunkHeading">
<a name="{../@id}" id="{../@id}"/>
<p>
<xsl:text>
Schema file
</xsl:text>
<xsl:value-of select="count(preceding::s:caption[parent::s:fileExample])+1"/>
<xsl:text>
:
</xsl:text>
<xsl:apply-templates/>
</p>
<xsl:apply-templates select="../@id" mode="conformance"/>
</div>
</xsl:template>
<xsl:template match="s:caption" mode="example.heading">
<div xmlns="" class="chunkHeading">
<a name="{../@id}" id="{../@id}"/>
<p>
<xsl:text>
Example
</xsl:text>
<xsl:value-of select="count(preceding::s:caption[parent::s:fileExample])+1"/>
<xsl:text>
:
</xsl:text>
<xsl:apply-templates/>
</p>
<xsl:apply-templates select="../@id" mode="conformance"/>
</div>
</xsl:template>
<xsl:template match="s:figure">
<xsl:apply-templates select="s:caption" mode="figure.heading"/>
<xsl:choose>
<xsl:when test="@role">
<div xmlns="" class="{@role}">
<xsl:apply-templates/>
</div>
</xsl:when>
<xsl:otherwise>
<div xmlns="" class="figure">
<xsl:apply-templates/>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="s:caption[parent::s:figure]"/>
<xsl:template match="s:caption" mode="figure.heading">
<div xmlns="" class="chunkHeading">
<a name="{../@id}" id="{../@id}"/>
<xsl:text>
Figure
</xsl:text>
<xsl:value-of select="count(preceding::s:caption[parent::s:figure])+1"/>
<xsl:text>
:
</xsl:text>
<xsl:apply-templates/>
<xsl:apply-templates select="../@id" mode="conformance"/>
</div>
</xsl:template>
<xsl:template match="s:img">
<img xmlns="" src="{@src}">
<xsl:if test="@alt">
<xsl:attribute name="alt">
<xsl:value-of select="@alt"/>
</xsl:attribute>
</xsl:if>
</img>
</xsl:template>
<xsl:template match="s:verbatim">
<xsl:apply-templates mode="verbatim"/>
</xsl:template>
<!-- ============================================================= -->
<!-- Phrase templates -->
<!-- ============================================================= -->
<xsl:template match="s:code">
<code xmlns="">
<xsl:apply-templates/>
</code>
</xsl:template>
<xsl:template match="s:elt">
<code xmlns="" class="element">
&lt;
<xsl:apply-templates/>
&gt;
</code>
</xsl:template>
<xsl:template match="s:att">
<code xmlns="" class="attribute">
@
<xsl:apply-templates/>
</code>
</xsl:template>
<xsl:template match="s:val">
<code xmlns="" class="value">
<xsl:apply-templates/>
</code>
</xsl:template>
<xsl:template match="s:var">
<code xmlns="" class="variable">
<xsl:apply-templates/>
</code>
</xsl:template>
<xsl:template match="s:rfc2119">
<strong xmlns="">
<xsl:apply-templates/>
</strong>
</xsl:template>
<xsl:template match="s:em">
<em xmlns="">
<xsl:apply-templates/>
</em>
</xsl:template>
<xsl:template match="s:strong">
<strong xmlns="">
<xsl:apply-templates/>
</strong>
</xsl:template>
<xsl:template match="s:center">
<center xmlns="">
<xsl:apply-templates/>
</center>
</xsl:template>
<xsl:template match="s:superscript">
<sup xmlns="">
<xsl:apply-templates/>
</sup>
</xsl:template>
<xsl:template match="s:subscript">
<sub xmlns="">
<xsl:apply-templates/>
</sub>
</xsl:template>
<xsl:template match="s:phrase">
<span xmlns="">
<xsl:call-template name="add-id"/>
<xsl:apply-templates/>
</span>
</xsl:template>
<xsl:template match="s:nbsp">
<xsl:call-template name="nbsp"/>
</xsl:template>
<xsl:template match="s:br">
<br xmlns=""/>
</xsl:template>
<xsl:template match="s:amp">
<xsl:text>
&amp;
</xsl:text>
</xsl:template>
<xsl:template match="s:definition">
<span xmlns="" class="definition">
<a name="{@id}" id="{@id}" title="{@term}"/>
<xsl:apply-templates/>
<xsl:apply-templates select="@id" mode="conformance"/>
</span>
</xsl:template>
<xsl:template match="s:term">
<span xmlns="" class="term">
<xsl:apply-templates/>
</span>
</xsl:template>
<xsl:template match="s:tr/s:principle | s:tr/s:requirement">
<td xmlns="">
<a name="{@id}" id="{@id}" title="{@name}">
<xsl:value-of select="@name"/>
</a>
</td>
<td xmlns="">
<xsl:apply-templates select="s:short"/>
</td>
<td xmlns="">
<xsl:apply-templates select="s:long"/>
</td>
</xsl:template>
<xsl:template match="s:principle">
<span xmlns="" class="principle">
<a name="{@id}" id="{@id}" title="{@name}"/>
<span class="principleName">
[Principle
<xsl:value-of select="@name"/>
]
</span>
<xsl:apply-templates select="s:short"/>
-
<xsl:apply-templates select="s:long"/>
</span>
</xsl:template>
<xsl:template match="s:requirement">
<span xmlns="" class="requirement">
<a name="{@id}" id="{@id}" title="{@name}"/>
<span class="requirementName">
[Requirement
<xsl:value-of select="@name"/>
]
</span>
<xsl:apply-templates select="s:short"/>
-
<xsl:apply-templates select="s:long"/>
</span>
</xsl:template>
<xsl:template match="s:short">
<span xmlns="" class="short">
<xsl:apply-templates/>
</span>
</xsl:template>
<xsl:template match="s:short" mode="toc">
<span xmlns="">
<xsl:apply-templates/>
</span>
</xsl:template>
<xsl:template match="s:long">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="s:error">
<span xmlns="" class="errordefinition">
<a name="{@id}" id="{@id}"/>
<xsl:apply-templates/>
<xsl:apply-templates select="@id" mode="conformance"/>
</span>
<xsl:if test="count(s:errorcode)!=1">
<span xmlns="" class="error">
<xsl:text>
This error does not define an error code.
</xsl:text>
</span>
</xsl:if>
</xsl:template>
<xsl:template match="s:errorcode">
<xsl:apply-templates select="key('ids', 'ns-errors')[1]">
<xsl:with-param name="use" select="'prefix'"/>
</xsl:apply-templates>
<xsl:call-template name="colon"/>
<xsl:value-of select="@code"/>
</xsl:template>
<xsl:template match="s:quote">
<xsl:call-template name="quote"/>
<xsl:apply-templates/>
<xsl:call-template name="quote"/>
</xsl:template>
<!-- ============================================================= -->
<!-- List templates -->
<!-- ============================================================= -->
<xsl:template match="s:olist">
<ol xmlns="">
<xsl:apply-templates/>
</ol>
</xsl:template>
<xsl:template match="s:ulist">
<ul xmlns="">
<xsl:apply-templates/>
</ul>
</xsl:template>
<xsl:template match="s:slist">
<ul xmlns="" class="no-bullets">
<xsl:apply-templates/>
</ul>
</xsl:template>
<xsl:template match="s:item">
<li xmlns="">
<xsl:apply-templates/>
</li>
</xsl:template>
<!-- ============================================================= -->
<!-- Table templates -->
<!-- ============================================================= -->
<xsl:template match="s:table">
<xsl:apply-templates select="s:caption" mode="table.heading"/>
<table xmlns="">
<xsl:for-each select="@*">
<!-- Wait: some of these aren't HTML attributes after all... -->
<xsl:choose>
<xsl:when test="local-name(.) = 'role'">
<xsl:attribute name="class">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:when>
<xsl:when test="local-name(.) = 'diff' or local-name(.) = 'id'">
<!-- nop -->
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:apply-templates/>
</table>
<xsl:if test=".//s:footnote">
<p xmlns="">
<xsl:apply-templates select=".//s:footnote" mode="table.notes"/>
</p>
</xsl:if>
</xsl:template>
<xsl:template match="s:caption[parent::s:table]"/>
<xsl:template match="s:caption" mode="table.heading">
<div xmlns="" class="chunkHeading">
<a name="{../@id}" id="{../@id}"/>
<xsl:text>
Table
</xsl:text>
<xsl:value-of select="count(preceding::s:caption[parent::s:table])+1"/>
<xsl:text>
:
</xsl:text>
<xsl:apply-templates/>
<xsl:apply-templates select="../@id" mode="conformance"/>
</div>
</xsl:template>
<xsl:template match="s:col|s:colgroup|s:tfoot|s:thead|s:tr|s:tbody">
<xsl:element name="{local-name(.)}">
<xsl:for-each select="@*">
<!-- Wait: some of these aren't HTML attributes after all... -->
<xsl:choose>
<xsl:when test="local-name(.) = 'role'">
<xsl:attribute name="class">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:when>
<xsl:when test="local-name(.) = 'diff'">
<!-- nop -->
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="."/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="s:td|s:th">
<xsl:element name="{local-name(.)}">
<xsl:for-each select="@*">
<xsl:choose>
<xsl:when test="local-name(.) = 'role'">
<xsl:attribute name="class">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:when>
<xsl:when test="local-name(.) = 'diff'"/>
<xsl:when test="local-name(.) = 'colspan' and number(.) = 1"/>
<xsl:when test="local-name(.) = 'rowspan' and number(.) = 1"/>
<xsl:otherwise>
<xsl:copy-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="s:footnote[ancestor::s:table]">
<xsl:variable name="this-note-id">
<xsl:choose>
<xsl:when test="../@id">
<xsl:value-of select="../@id"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="generate-id(parent::*)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<span xmlns="" class="table.footnote">
<sup>
<a name="{$this-note-id}" id="{$this-note-id}" href="#FN-ANCH-{$this-note-id}">
<xsl:apply-templates select="." mode="table-note-number-simple"/>
</a>
</sup>
</span>
</xsl:template>
<xsl:template match="s:footnote">
<xsl:variable name="this-note-id">
<xsl:choose>
<xsl:when test="@id">
<xsl:value-of select="@id"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="generate-id(.)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<span xmlns="" class="footnote">
<sup>
[
<a name="{$this-note-id}" id="{$this-note-id}" href="#FN-ANCH-{$this-note-id}">
<xsl:apply-templates select="." mode="number-simple"/>
</a>
]
</sup>
</span>
</xsl:template>
<xsl:template match="s:footnote" mode="table.notes">
<xsl:variable name="this-note-id">
<xsl:choose>
<xsl:when test="../@id">
<xsl:value-of select="../@id"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="generate-id(parent::*)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<span xmlns="" class="table.footnote">
<a name="FN-ANCH-{$this-note-id}" id="FN-ANCH-{$this-note-id}" href="#{$this-note-id}">
<xsl:apply-templates select="." mode="table-note-number-simple"/>
<xsl:text>
.
</xsl:text>
</a>
<xsl:text></xsl:text>
<xsl:apply-templates/>
</span>
</xsl:template>
<xsl:template match="s:footnote" mode="table-note-number-simple">
<xsl:variable name="table" select="ancestor::s:table"/>
<xsl:variable name="number" select="count(preceding::s:footnote[ancestor::s:table = $table])+1"/>
<xsl:value-of select="$number"/>
</xsl:template>
<xsl:template match="s:footnote" mode="number-simple">
<!-- xsl:number level="any" format="1"/-->
<xsl:variable name="number" select="count(preceding::s:footnote[count(ancestor::s:table) = 0])+1"/>
<xsl:value-of select="$number"/>
</xsl:template>
<!-- ============================================================= -->
<!-- Boilerplate templates -->
<!-- ============================================================= -->
<xsl:template name="banner"></xsl:template>
<xsl:template name="status">
<div xmlns="">
<h2>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
<xsl:with-param name="default.id" select="'status'"/>
</xsl:call-template>
<xsl:text>
Status
</xsl:text>
</h2>
<p>
<xsl:variable name="wg" select="/s:spec/s:header/s:wg"/>
<xsl:variable name="pretext">
<xsl:choose>
<xsl:when test="$parentId!=''">
<xsl:text>
supporting document for a
</xsl:text>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$status='WGWD'">
<xsl:value-of select="concat('Circulation of this ',$pretext,' Working Group Working Draft is ', 'restricted to members and observers of the ',$wg,' of XBRL International and is ', 'not appropriate to cite from other sources. ')"/>
</xsl:when>
<xsl:when test="$status='IWD'">
<xsl:value-of select="concat('Circulation of this ',$pretext, ' Internal Working Draft is restricted to participants in XBRL International ', 'and is not appropriate to cite from other sources. ')"/>
</xsl:when>
<xsl:when test="$status='DPWD'">
<xsl:value-of select="concat('Circulation of this ',$pretext, ' Draft Public Working Draft is restricted to participants in XBRL International ', 'and is not appropriate to cite from other sources. ')"/>
</xsl:when>
<xsl:when test="$status='PWD'">
<xsl:value-of select="concat('Circulation of this ',$pretext, ' Public Working Draft is unrestricted. ')"/>
</xsl:when>
<xsl:when test="$status='DWGN'">
<xsl:value-of select="concat('Circulation of this ',$pretext, ' Draft Working Group Note is restricted to participants in XBRL International ', 'and is not appropriate to cite from other sources. ')"/>
</xsl:when>
<xsl:when test="$status='WGN'">
<xsl:text>
Circulation of this Working Group Note is unrestricted.
</xsl:text>
</xsl:when>
<xsl:when test="$status='DFWGN'">
<xsl:value-of select="concat('Circulation of this ',$pretext, ' Draft Final Working Group Note is restricted to participants in XBRL International ', 'and is not appropriate to cite from other sources. ')"/>
</xsl:when>
<xsl:when test="$status='FWGN'">
<xsl:text>
Circulation of this Final Working Group Note is unrestricted.
</xsl:text>
</xsl:when>
<xsl:when test="$status='DCR'">
<xsl:value-of select="concat('Circulation of this ',$pretext, ' Draft Candidate Recommendation is restricted to participants in XBRL International ', 'and is not appropriate to cite from other sources. ')"/>
</xsl:when>
<xsl:when test="$status='CR'">
<xsl:value-of select="concat('Circulation of this ',$pretext, ' Candidate Recommendation is unrestricted. ')"/>
</xsl:when>
<xsl:when test="$status='DPR'">
<xsl:value-of select="concat('Circulation of this ',$pretext, ' Draft Proposed Recommendation is restricted to participants in XBRL International ', 'and is not appropriate to cite from other sources. ')"/>
</xsl:when>
<xsl:when test="$status='PR'">
<xsl:value-of select="concat('Circulation of this ',$pretext, ' Proposed Recommendation is unrestricted. ')"/>
</xsl:when>
<xsl:when test="$status='REC'">
<xsl:value-of select="concat('Circulation of this ',$pretext, ' Recommendation is unrestricted. ')"/>
</xsl:when>
<xsl:when test="$status='DPER'">
<xsl:value-of select="concat('Circulation of this ',$pretext, ' Draft Proposed Edited Recommendation is restricted to participants in XBRL International ', 'and is not appropriate to cite from other sources. ')"/>
</xsl:when>
<xsl:when test="$status='PER'">
<xsl:value-of select="concat('Circulation of this ',$pretext, ' Proposed Edited Recommendation is unrestricted. ')"/>
</xsl:when>
<xsl:when test="$status='DRR'">
<xsl:value-of select="concat('Circulation of this ',$pretext, ' Draft Rescinded Recommendation is restricted to participants in XBRL International ', 'and is not appropriate to cite from other sources. ')"/>
</xsl:when>
<xsl:when test="$status='PER'">
<xsl:value-of select="concat('Circulation of this ',$pretext, ' Rescinded Recommendation is unrestricted. ')"/>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="$pubType!='Specification'">
<xsl:text/>
</xsl:when>
<xsl:when test="$parentId!=''">
<xsl:text/>
</xsl:when>
<xsl:otherwise>
<xsl:text>
This document is normative.
</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="$status!='REC'">
<xsl:text>
Other documents may supersede this document.
</xsl:text>
</xsl:if>
<xsl:text>
Recipients are invited to submit comments to
</xsl:text>
<xsl:apply-templates select="/s:spec/s:header/s:feedback"/>
,
<xsl:text>
and to submit notification of any relevant patent rights of which they are aware and provide supporting documentation.
</xsl:text>
</p>
</div>
</xsl:template>
<xsl:template match="s:feedback">
<a xmlns="" href="mailto:{.}">
<xsl:value-of select="."/>
</a>
</xsl:template>
<xsl:template name="endnotes">
<xsl:if test="//s:footnote[not(ancestor::s:table)]">
<hr xmlns=""/>
<div xmlns="" class="endnotes">
<xsl:call-template name="newline"/>
<h3>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
<xsl:with-param name="default.id" select="'endnotes'"/>
</xsl:call-template>
<xsl:text>
End Notes
</xsl:text>
</h3>
<dl>
<xsl:apply-templates select="//s:footnote[not(ancestor::s:table)]" mode="endnotes"/>
</dl>
</div>
</xsl:if>
</xsl:template>
<xsl:template mode="endnotes" match="s:footnote">
<xsl:variable name="this-note-id">
<xsl:choose>
<xsl:when test="@id">
<xsl:value-of select="@id"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="generate-id(.)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<dt xmlns="">
<xsl:text>
[
</xsl:text>
<a name="FN-ANCH-{$this-note-id}" id="FN-ANCH-{$this-note-id}" href="#{$this-note-id}">
<xsl:apply-templates select="." mode="number-simple"/>
</a>
<xsl:text>
]
</xsl:text>
</dt>
<dd xmlns="">
<xsl:apply-templates/>
</dd>
</xsl:template>
<!-- ============================================================= -->
<!-- Bibliography -->
<!-- ============================================================= -->
<xsl:template match="s:bibliography">
<dl xmlns="">
<xsl:apply-templates>
<xsl:sort select="@key"/>
</xsl:apply-templates>
</dl>
</xsl:template>
<xsl:template match="s:reference">
<dt xmlns="" class="label">
<xsl:if test="@id">
<a name="{@id}" id="{@id}"/>
</xsl:if>
<xsl:choose>
<xsl:when test="@key">
<xsl:value-of select="@key"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@id"/>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="id" select="@id"/>
<xsl:if test="count(//s:bibref[@ref=$id])+ count(//s:xtermref[@bibref=$id])=0">
<span class="error">
This reference is not cited.
</span>
</xsl:if>
</dt>
<dd xmlns="">
<xsl:apply-templates select="s:publisher" mode="reference"/>
<xsl:apply-templates select="s:title" mode="reference"/>
<xsl:apply-templates select="s:authors/s:person" mode="reference"/>
<xsl:if test="@href">
<br/>
<xsl:text>
(See
</xsl:text>
<a href="{@href}">
<xsl:value-of select="@href"/>
</a>
<xsl:text>
)
</xsl:text>
</xsl:if>
</dd>
</xsl:template>
<xsl:template match="s:title" mode="reference">
<xsl:text></xsl:text>
<xsl:call-template name="quote"/>
<xsl:apply-templates/>
<xsl:call-template name="quote"/>
</xsl:template>
<xsl:template match="s:publisher" mode="reference">
<xsl:apply-templates/>
<xsl:text>
.
</xsl:text>
</xsl:template>
<xsl:template match="s:person" mode="reference">
<xsl:if test="count(preceding-sibling::s:person)=0">
<br xmlns=""/>
</xsl:if>
<xsl:if test="preceding-sibling::s:person">
<xsl:text>
,
</xsl:text>
</xsl:if>
<xsl:if test="count(../s:person)&gt;1 and count(following-sibling::s:person)=0">
<xsl:text>
and
</xsl:text>
</xsl:if>
<xsl:apply-templates select="s:name"/>
<xsl:if test="count(following-sibling::s:person)=0">
<xsl:text>
.
</xsl:text>
</xsl:if>
</xsl:template>
<!-- ============================================================= -->
<!-- Revisions -->
<!-- ============================================================= -->
<xsl:template match="s:revisions">
<table xmlns="" class="revisions">
<tr>
<th>
Date
</th>
<th>
Author
</th>
<th>
Details
</th>
</tr>
<xsl:apply-templates/>
</table>
</xsl:template>
<xsl:template match="s:revision">
<tr xmlns="">
<td>
<xsl:value-of select="@day"/>
<xsl:call-template name="space"/>
<xsl:call-template name="month">
<xsl:with-param name="month" select="@month"/>
</xsl:call-template>
<xsl:call-template name="space"/>
<xsl:value-of select="@year"/>
</td>
<td>
<xsl:apply-templates select="key('ids', @ref)/s:name"/>
</td>
<td>
<xsl:apply-templates/>
</td>
</tr>
</xsl:template>
<!-- ============================================================= -->
<!-- Errata -->
<!-- ============================================================= -->
<xsl:template match="s:errata">
<p xmlns="">
No errata have been incorporated into this document.
</p>
</xsl:template>
<xsl:template match="s:errata[s:erratum]">
<table xmlns="" class="errata">
<tr>
<th>
Number
</th>
<th>
Date
</th>
<th>
Sections
</th>
<th>
Details
</th>
</tr>
<xsl:apply-templates/>
</table>
</xsl:template>
<xsl:template match="s:erratum">
<tr xmlns="">
<td>
<xsl:value-of select="count(preceding-sibling::s:erratum)+1"/>
<xsl:text>
.
</xsl:text>
</td>
<td>
<xsl:value-of select="@day"/>
<xsl:call-template name="space"/>
<xsl:call-template name="month">
<xsl:with-param name="month" select="@month"/>
</xsl:call-template>
<xsl:call-template name="space"/>
<xsl:value-of select="@year"/>
</td>
<td>
<xsl:for-each select="s:sectionref">
<xsl:if test="count(preceding-sibling::s:sectionref)">
<br/>
</xsl:if>
<xsl:apply-templates select="."/>
</xsl:for-each>
</td>
<td>
<xsl:apply-templates select="*[local-name()!='sectionref']"/>
</td>
</tr>
</xsl:template>
<!-- ============================================================= -->
<!-- References/ hyperlinks -->
<!-- ============================================================= -->
<xsl:template match="s:xref">
<a xmlns="" href="{@ref}">
<xsl:choose>
<xsl:when test="count(child::node())=0">
<xsl:value-of select="@ref"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</a>
</xsl:template>
<xsl:template match="s:xtermref">
<xsl:variable name="reference" select="key('ids', @bibref)"/>
<a xmlns="">
<xsl:attribute name="href">
<xsl:value-of select="$reference/@href"/>
<xsl:if test="count(@idref)">
<xsl:text>
#
</xsl:text>
<xsl:value-of select="@idref"/>
</xsl:if>
</xsl:attribute>
<xsl:choose>
<xsl:when test="count($reference)=0">
<span class="error">
No bibliographic citation has ID
<xsl:value-of select="@bibref"/>
.
</span>
</xsl:when>
<xsl:when test="count(child::node())=0">
<span class="error">
No term is linked to the specified external term reference.
</span>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</a>
</xsl:template>
<xsl:template match="s:termref">
<xsl:param name="target" select="key('ids', @ref)[1]"/>
<xsl:choose>
<xsl:when test="$target">
<xsl:apply-templates select="$target" mode="termref">
<xsl:with-param name="usage" select="node()"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<span xmlns="" class="error">
[Cannot resolve Definition ID
<xsl:value-of select="@ref"/>
]
</span>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="s:definition" mode="termref">
<xsl:param name="usage" select="/.."/>
<a xmlns="">
<xsl:attribute name="href">
<xsl:call-template name="href.target"/>
</xsl:attribute>
<xsl:apply-templates select="$usage"/>
</a>
</xsl:template>
<xsl:template match="s:principleref">
<xsl:param name="target" select="key('ids', @ref)[1]"/>
<xsl:choose>
<xsl:when test="$target">
<xsl:apply-templates select="$target" mode="principleref"/>
</xsl:when>
<xsl:otherwise>
<span xmlns="" class="error">
[Cannot resolve Principle ID
<xsl:value-of select="@ref"/>
]
</span>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="s:principle" mode="principleref">
<a xmlns="">
<xsl:attribute name="href">
<xsl:call-template name="href.target"/>
</xsl:attribute>
Principle
<xsl:value-of select="@name"/>
</a>
</xsl:template>
<xsl:template match="s:requirementref">
<xsl:param name="target" select="key('ids', @ref)[1]"/>
<xsl:choose>
<xsl:when test="$target">
<xsl:apply-templates select="$target" mode="requirementref"/>
</xsl:when>
<xsl:otherwise>
<span xmlns="" class="error">
[Cannot resolve Requirement ID
<xsl:value-of select="@ref"/>
]
</span>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="s:requirement" mode="requirementref">
<a xmlns="">
<xsl:attribute name="href">
<xsl:call-template name="href.target"/>
</xsl:attribute>
Requirement
<xsl:value-of select="@name"/>
</a>
</xsl:template>
<xsl:template match="s:sectionref">
<xsl:param name="target" select="key('ids', @ref)[1]"/>
<xsl:choose>
<xsl:when test="$target">
<xsl:apply-templates select="$target" mode="sectionref"/>
</xsl:when>
<xsl:otherwise>
<span xmlns="" class="error">
[Cannot resolve Section ID
<xsl:value-of select="@ref"/>
]
</span>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="s:section" mode="sectionref">
<a xmlns="">
<xsl:attribute name="href">
<xsl:call-template name="href.target"/>
</xsl:attribute>
<b>
<xsl:choose>
<xsl:when test="ancestor::s:body">
Section
<xsl:apply-templates select="." mode="divnum"/>
</xsl:when>
<xsl:when test="ancestor::s:back">
<xsl:apply-templates select="." mode="divnum"/>
</xsl:when>
</xsl:choose>
</b>
</a>
</xsl:template>
<xsl:template match="s:bibref">
<a xmlns="">
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="target" select="key('ids', @ref)"/>
</xsl:call-template>
</xsl:attribute>
<xsl:text>
[
</xsl:text>
<xsl:value-of select="key('ids', @ref)/@key"/>
<xsl:text>
]
</xsl:text>
</a>
</xsl:template>
<xsl:template match="s:figureref">
<xsl:param name="target" select="key('ids', @ref)[1]"/>
<xsl:choose>
<xsl:when test="$target">
<xsl:apply-templates select="$target" mode="figureref"/>
</xsl:when>
<xsl:otherwise>
<span xmlns="" class="error">
[Cannot resolve Figure ID
<xsl:value-of select="@ref"/>
]
</span>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="s:figure" mode="figureref">
<a xmlns="">
<xsl:attribute name="href">
<xsl:call-template name="href.target"/>
</xsl:attribute>
<b>
Figure
<xsl:value-of select="count(preceding::s:caption[parent::s:figure])+1"/>
</b>
</a>
</xsl:template>
<xsl:template match="s:exampleref">
<xsl:param name="target" select="key('ids', @ref)[1]"/>
<xsl:choose>
<xsl:when test="$target">
<xsl:apply-templates select="$target" mode="exampleref"/>
</xsl:when>
<xsl:otherwise>
<span xmlns="" class="error">
[Cannot resolve Example ID
<xsl:value-of select="@ref"/>
]
</span>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="s:example" mode="exampleref">
<a xmlns="">
<xsl:attribute name="href">
<xsl:call-template name="href.target"/>
</xsl:attribute>
<b>
Example
<xsl:value-of select="count(preceding::s:caption[parent::s:example])+1"/>
</b>
</a>
</xsl:template>
<xsl:template match="s:tableref">
<xsl:param name="target" select="key('ids', @ref)[1]"/>
<xsl:choose>
<xsl:when test="$target">
<xsl:apply-templates select="$target" mode="tableref"/>
</xsl:when>
<xsl:otherwise>
<span xmlns="" class="error">
[Cannot resolve Table ID
<xsl:value-of select="@ref"/>
]
</span>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="s:table" mode="tableref">
<a xmlns="">
<xsl:attribute name="href">
<xsl:call-template name="href.target"/>
</xsl:attribute>
<b>
Table
<xsl:value-of select="count(preceding::s:caption[parent::s:table])+1"/>
</b>
</a>
</xsl:template>
<xsl:template match="s:personref">
<xsl:param name="target" select="key('ids', @ref)[1]"/>
<xsl:choose>
<xsl:when test="$target">
<xsl:apply-templates select="$target" mode="personref"/>
</xsl:when>
<xsl:otherwise>
<span xmlns="" class="error">
[Cannot resolve Person ID
<xsl:value-of select="@ref"/>
]
</span>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="s:person" mode="personref">
<a xmlns="">
<xsl:attribute name="href">
<xsl:call-template name="href.target"/>
</xsl:attribute>
<b>
<xsl:apply-templates select="s:name"/>
</b>
</a>
</xsl:template>
<xsl:template match="s:namespaceref">
<xsl:param name="target" select="key('ids', @ref)[1]"/>
<xsl:choose>
<xsl:when test="$target">
<xsl:apply-templates select="$target">
<xsl:with-param name="use" select="@use"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<span xmlns="" class="error">
[Cannot resolve Person ID
<xsl:value-of select="@ref"/>
]
</span>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="s:namespace">
<xsl:param name="use" select="'prefix'"/>
<xsl:choose>
<xsl:when test="$use='namespace'">
<xsl:value-of select="@value"/>
</xsl:when>
<xsl:when test="$use='url' and @url">
<a xmlns="" href="{@url}">
<xsl:value-of select="@url"/>
</a>
</xsl:when>
<xsl:when test="$use='url'">
<span xmlns="" class="error">
[Namespace
<xsl:value-of select="@value"/>
has no normative schema URL.]
</span>
</xsl:when>
<xsl:when test="$use='prefix'">
<xsl:value-of select="@prefix"/>
</xsl:when>
<xsl:when test="$use='description'">
<xsl:value-of select="text()"/>
</xsl:when>
<xsl:otherwise>
<span xmlns="" class="error">
[
<xsl:value-of select="$use"/>
is an invalid use of namespace
<xsl:value-of select="@value"/>
]
</span>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="s:xmlref">
<xsl:param name="target" select="key('ids', @ref)[1]"/>
<xsl:choose>
<xsl:when test="$target">
<xsl:apply-templates select="$target" mode="xmlref">
<xsl:with-param name="usage" select="node()"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<span xmlns="" class="error">
[Cannot resolve XML ID
<xsl:value-of select="@ref"/>
]
</span>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="s:errorref">
<xsl:param name="target" select="key('ids', @ref)[1]"/>
<xsl:choose>
<xsl:when test="$target">
<xsl:apply-templates select="$target" mode="errorref">
<xsl:with-param name="usage" select="node()"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<span xmlns="" class="error">
[Cannot resolve error ID
<xsl:value-of select="@ref"/>
]
</span>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="s:error" mode="errorref">
<xsl:param name="usage" select="/.."/>
<a xmlns="">
<xsl:attribute name="href">
<xsl:call-template name="href.target"/>
</xsl:attribute>
<xsl:apply-templates select="$usage"/>
(
<xsl:apply-templates select="s:errorcode"/>
)
</a>
</xsl:template>
<xsl:template match="*" mode="xmlref">
<xsl:param name="usage" select="/.."/>
<a xmlns="">
<xsl:attribute name="href">
<xsl:call-template name="href.target"/>
</xsl:attribute>
<xsl:apply-templates select="$usage"/>
</a>
</xsl:template>
<!-- ============================================================= -->
<!-- Templates used as functions -->
<!-- ============================================================= -->
<xsl:template name="anchor">
<xsl:param name="node" select="."/>
<xsl:param name="conditional" select="1"/>
<xsl:param name="default.id" select="''"/>
<xsl:variable name="id">
<xsl:call-template name="element.id">
<xsl:with-param name="node" select="$node"/>
<xsl:with-param name="default.id" select="$default.id"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="$conditional=0 or $node/@id">
<a xmlns="" name="{$id}" id="{$id}"/>
</xsl:if>
</xsl:template>
<xsl:template name="element.id">
<xsl:param name="node" select="."/>
<xsl:param name="default.id" select="''"/>
<xsl:choose>
<xsl:when test="$default.id != '' and not(key('ids', $default.id))">
<xsl:value-of select="$default.id"/>
</xsl:when>
<xsl:when test="$node/@id">
<xsl:value-of select="$node/@id"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="generate-id($node)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="add-id">
<xsl:param name="node" select="."/>
<xsl:param name="default.id" select="''"/>
<xsl:variable name="id">
<xsl:call-template name="element.id">
<xsl:with-param name="node" select="$node"/>
<xsl:with-param name="default.id" select="$default.id"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="@id">
<xsl:attribute name="id">
<xsl:value-of select="$id"/>
</xsl:attribute>
</xsl:if>
</xsl:template>
<xsl:template name="status-text">
<xsl:choose>
<xsl:when test="$parentId!=''">
<xsl:text>
Supporting document for a
</xsl:text>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="$status='WGN'">
<xsl:text>
Working Group Note
</xsl:text>
</xsl:when>
<xsl:when test="$status='IWD'">
<xsl:text>
Internal Working Draft
</xsl:text>
</xsl:when>
<xsl:when test="$status='PWD'">
<xsl:text>
Public Working Draft
</xsl:text>
</xsl:when>
<xsl:when test="$status='CR'">
<xsl:text>
Candidate Recommendation
</xsl:text>
</xsl:when>
<xsl:when test="$status='REC'">
<xsl:text>
Recommendation
</xsl:text>
</xsl:when>
<xsl:when test="$status='RR'">
<xsl:text>
Rescinded Recommendation
</xsl:text>
</xsl:when>
<xsl:when test="$status='DRR'">
<xsl:text>
Draft Rescinded Recommendation
</xsl:text>
</xsl:when>
<xsl:when test="$status='PER'">
<xsl:text>
Proposed Edited Recommendation
</xsl:text>
</xsl:when>
<xsl:when test="$status='DPER'">
<xsl:text>
Draft Proposed Edited Recommendation
</xsl:text>
</xsl:when>
<xsl:when test="$status='PR'">
<xsl:text>
Proposed Recommendation
</xsl:text>
</xsl:when>
<xsl:when test="$status='DPR'">
<xsl:text>
Draft Proposed Recommendation
</xsl:text>
</xsl:when>
<xsl:when test="$status='DCR'">
<xsl:text>
Draft Candidate Recommendation
</xsl:text>
</xsl:when>
<xsl:when test="$status='FWGN'">
<xsl:text>
Final Working Group Note
</xsl:text>
</xsl:when>
<xsl:when test="$status='DFWGN'">
<xsl:text>
Draft Final Working Group Note
</xsl:text>
</xsl:when>
<xsl:when test="$status='DWGN'">
<xsl:text>
Draft Working Group Note
</xsl:text>
</xsl:when>
<xsl:when test="$status='DPWD'">
<xsl:text>
Draft Public Working Draft
</xsl:text>
</xsl:when>
<xsl:when test="$status='WGWD'">
<xsl:text>
Working Group Working Draft
</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="a-status">
<xsl:choose>
<xsl:when test="$status='IWD'">
<xsl:text>
an
</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>
a
</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="status-text"/>
</xsl:template>
<xsl:template match="s:dateref">
<xsl:choose>
<xsl:when test="@style='DD-MM-YYYY'">
<xsl:value-of select="concat($date/@day,'/',$date/@month,'/',$date/@year)"/>
</xsl:when>
<xsl:when test="@style='YYYYMMDD'">
<xsl:value-of select="concat($date/@year,$date/@month,$date/@day)"/>
</xsl:when>
<xsl:when test="@style='DD Month YYYY'">
<xsl:call-template name="full-date"/>
</xsl:when>
<xsl:otherwise>
<span xmlns="" class="error">
[Invalid date style='
<xsl:value-of select="@style"/>
']
</span>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="full-date">
<xsl:if test="$date/@day">
<xsl:apply-templates select="$date/@day"/>
<xsl:call-template name="space"/>
</xsl:if>
<xsl:call-template name="month"/>
<xsl:call-template name="space"/>
<xsl:apply-templates select="$date/@year"/>
</xsl:template>
<xsl:template name="month">
<xsl:param name="month" select="$date/@month"/>
<xsl:choose>
<xsl:when test="$month='01'">
<xsl:text>
January
</xsl:text>
</xsl:when>
<xsl:when test="$month='02'">
<xsl:text>
February
</xsl:text>
</xsl:when>
<xsl:when test="$month='03'">
<xsl:text>
March
</xsl:text>
</xsl:when>
<xsl:when test="$month='04'">
<xsl:text>
April
</xsl:text>
</xsl:when>
<xsl:when test="$month='05'">
<xsl:text>
May
</xsl:text>
</xsl:when>
<xsl:when test="$month='06'">
<xsl:text>
June
</xsl:text>
</xsl:when>
<xsl:when test="$month='07'">
<xsl:text>
July
</xsl:text>
</xsl:when>
<xsl:when test="$month='08'">
<xsl:text>
August
</xsl:text>
</xsl:when>
<xsl:when test="$month='09'">
<xsl:text>
September
</xsl:text>
</xsl:when>
<xsl:when test="$month='10'">
<xsl:text>
October
</xsl:text>
</xsl:when>
<xsl:when test="$month='11'">
<xsl:text>
November
</xsl:text>
</xsl:when>
<xsl:when test="$month='12'">
<xsl:text>
December
</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="s:wgref">
<xsl:value-of select="/s:spec/s:header/s:wg"/>
</xsl:template>
<xsl:template name="newline">
<xsl:text></xsl:text>
</xsl:template>
<xsl:template name="space">
<xsl:text></xsl:text>
<!-- xsl:text>&#160;</xsl:text-->
</xsl:template>
<xsl:template name="nbsp">
<xsl:text>
 
</xsl:text>
</xsl:template>
<xsl:template name="quote">
<xsl:text>
"
</xsl:text>
</xsl:template>
<xsl:template name="lt">
<xsl:text>
&lt;
</xsl:text>
</xsl:template>
<xsl:template name="gt">
<xsl:text>
&gt;
</xsl:text>
</xsl:template>
<xsl:template name="colon">
<xsl:text>
:
</xsl:text>
</xsl:template>
<xsl:template name="equals">
<xsl:text>
=
</xsl:text>
</xsl:template>
<xsl:template name="slash">
<xsl:text>
/
</xsl:text>
</xsl:template>
<xsl:template name="open-pi">
<xsl:text>
&lt;?
</xsl:text>
</xsl:template>
<xsl:template name="close-pi">
<xsl:text>
?&gt;
</xsl:text>
</xsl:template>
<xsl:template name="open-comment">
<xsl:text>
&lt;!--
</xsl:text>
</xsl:template>
<xsl:template name="close-comment">
<xsl:text>
--&gt;
</xsl:text>
</xsl:template>
<!-- ============================================================= -->
<!-- Templates used for verbatim XML rendering -->
<!-- ============================================================= -->
<xsl:template match="*" mode="verbatim">
<div xmlns="" class="verbatim">
<xsl:if test="local-name(../..)='xml' and namespace-uri(../..)=$namespace-uri">
<div class="verbatim">
<xsl:call-template name="nbsp"/>
</div>
</xsl:if>
<!-- Left angle bracket -->
<xsl:call-template name="lt"/>
<!-- Element namespace prefix -->
<xsl:variable name="ns-prefix" select="substring-before(name(),':')"/>
<xsl:if test="$ns-prefix != ''">
<span class="verbatim-element-nsprefix">
<xsl:value-of select="$ns-prefix"/>
</span>
<xsl:call-template name="colon"/>
</xsl:if>
<!-- Element local name -->
<span class="verbatim-element-name">
<xsl:value-of select="local-name()"/>
</span>
<!-- Namespace prefix declarations -->
<xsl:variable name="pns" select="../namespace::*"/>
<!-- Get namespace nodes on parent element -->
<xsl:if test="$pns[name()=''] and not(namespace::*[name()=''])">
<!-- Undefine the default namespace if needed -->
<xsl:call-template name="space"/>
<span class="verbatim">
<span class="verbatim-namespace-name">
<xsl:text>
xmlns
</xsl:text>
</span>
<xsl:call-template name="equals"/>
<xsl:call-template name="quote"/>
<xsl:call-template name="quote"/>
</span>
</xsl:if>
<xsl:for-each select="namespace::*">
<!-- For each namespace on the element -->
<xsl:choose>
<xsl:when test="../@xsi:*">
<!-- Generate xsi namespace declarations as needed -->
<xsl:call-template name="verbatim-namespace"/>
</xsl:when>
<xsl:when test="../@s:*">
<xsl:call-template name="verbatim-namespace"/>
</xsl:when>
<xsl:when test="not($pns[name()=name(current()) and .=current()])">
<xsl:call-template name="verbatim-namespace"/>
</xsl:when>
</xsl:choose>
</xsl:for-each>
<xsl:apply-templates select="@*" mode="verbatim"/>
<xsl:choose>
<xsl:when test="node()">
<span class="verbatim">
<xsl:call-template name="gt"/>
</span>
<xsl:apply-templates mode="verbatim"/>
<span class="verbatim">
<xsl:if test="local-name(..)='xml' and namespace-uri(..)=$namespace-uri">
<br/>
</xsl:if>
<xsl:call-template name="lt"/>
<xsl:call-template name="slash"/>
<xsl:if test="$ns-prefix != ''">
<span class="verbatim-element-nsprefix">
<xsl:value-of select="$ns-prefix"/>
</span>
<xsl:call-template name="colon"/>
</xsl:if>
<span class="verbatim-element-name">
<xsl:value-of select="local-name()"/>
</span>
<xsl:call-template name="gt"/>
</span>
</xsl:when>
<xsl:otherwise>
<span class="verbatim">
<xsl:call-template name="slash"/>
<xsl:call-template name="gt"/>
</span>
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:template>
<xsl:template name="verbatim-namespace">
<xsl:call-template name="space"/>
<span xmlns="" class="verbatim">
<xsl:if test="name()!='xml'">
<span class="verbatim-namespace-name">
<xsl:text>
xmlns
</xsl:text>
<xsl:if test="name()!=''">
<xsl:call-template name="colon"/>
</xsl:if>
<xsl:value-of select="name()"/>
</span>
<xsl:call-template name="equals"/>
<xsl:call-template name="quote"/>
<span class="verbatim-namespace-uri">
<xsl:value-of select="."/>
</span>
<xsl:call-template name="quote"/>
</xsl:if>
</span>
</xsl:template>
<xsl:template match="@*" mode="verbatim">
<xsl:call-template name="space"/>
<span xmlns="" class="verbatim">
<span class="verbatim-attribute-name">
<xsl:if test="local-name()='id'">
<a name="{.}" id="{.}"/>
<xsl:apply-templates select="." mode="conformance"/>
</xsl:if>
<xsl:value-of select="name()"/>
</span>
<xsl:call-template name="equals"/>
<xsl:call-template name="quote"/>
<span class="verbatim-attribute-content">
<xsl:call-template name="html-replace-entities">
<xsl:with-param name="text" select="normalize-space(.)"/>
<xsl:with-param name="attrs" select="true()"/>
</xsl:call-template>
</span>
<xsl:call-template name="quote"/>
</span>
</xsl:template>
<xsl:template match="text()" mode="verbatim">
<xsl:if test="not(normalize-space(.)=' ' or normalize-space(.)='')">
<div xmlns="" class="verbatim">
<span class="verbatim-text">
<xsl:call-template name="preformatted-output">
<xsl:with-param name="text">
<xsl:call-template name="html-replace-entities">
<xsl:with-param name="text" select="."/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</span>
</div>
</xsl:if>
</xsl:template>
<!-- comments -->
<xsl:template match="comment()" mode="verbatim">
<div xmlns="" class="verbatim">
<xsl:call-template name="open-comment"/>
<span class="verbatim-comment">
<xsl:call-template name="preformatted-output">
<xsl:with-param name="text" select="."/>
</xsl:call-template>
</span>
<xsl:call-template name="close-comment"/>
</div>
</xsl:template>
<!-- processing instructions -->
<xsl:template match="processing-instruction()" mode="verbatim">
<div xmlns="" class="verbatim">
<xsl:call-template name="open-pi"/>
<span class="verbatim-pi-name">
<xsl:value-of select="name()"/>
</span>
<xsl:if test=".!=''">
<xsl:text></xsl:text>
<span class="verbatim-pi-content">
<xsl:value-of select="."/>
</span>
</xsl:if>
<xsl:call-template name="close-pi"/>
</div>
</xsl:template>
<xsl:template name="html-replace-entities">
<xsl:param name="text"/>
<xsl:param name="attrs"/>
<xsl:variable name="tmp">
<xsl:call-template name="replace-substring">
<xsl:with-param name="from" select="'&gt;'"/>
<xsl:with-param name="to" select="'&amp;gt;'"/>
<xsl:with-param name="value">
<xsl:call-template name="replace-substring">
<xsl:with-param name="from" select="'&lt;'"/>
<xsl:with-param name="to" select="'&amp;lt;'"/>
<xsl:with-param name="value">
<xsl:call-template name="replace-substring">
<xsl:with-param name="from" select="'&amp;'"/>
<xsl:with-param name="to" select="'&amp;amp;'"/>
<xsl:with-param name="value" select="$text"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<!-- $text is an attribute value -->
<xsl:when test="$attrs">
<xsl:call-template name="replace-substring">
<xsl:with-param name="from" select="' '"/>
<xsl:with-param name="to" select="'&amp;#xA;'"/>
<xsl:with-param name="value">
<xsl:call-template name="replace-substring">
<xsl:with-param name="from" select="'&quot;'"/>
<xsl:with-param name="to" select="'&amp;quot;'"/>
<xsl:with-param name="value" select="$tmp"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$tmp"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- replace in $value substring $from with $to -->
<xsl:template name="replace-substring">
<xsl:param name="value"/>
<xsl:param name="from"/>
<xsl:param name="to"/>
<xsl:choose>
<xsl:when test="contains($value,$from)">
<xsl:value-of select="substring-before($value,$from)"/>
<xsl:value-of select="$to"/>
<xsl:call-template name="replace-substring">
<xsl:with-param name="value" select="substring-after($value,$from)"/>
<xsl:with-param name="from" select="$from"/>
<xsl:with-param name="to" select="$to"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$value"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- preformatted output: space as &nbsp;, tab as 8 &nbsp; nl as <br> -->
<xsl:template name="preformatted-output">
<xsl:param name="text"/>
<xsl:value-of select="$text"/>
<!-- <xsl:call-template name="output-nl"> <xsl:with-param name="text"> <xsl:call-template name="replace-substring"> <xsl:with-param name="value" select="translate($text,' ','&#xA0;')" /> <xsl:with-param name="from" select="'&#9;'" /> <xsl:with-param name="to" select="'&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;'" /> </xsl:call-template> </xsl:with-param> </xsl:call-template> -->
</xsl:template>
<!-- output nl as <br> -->
<xsl:template name="output-nl">
<xsl:param name="text"/>
<xsl:choose>
<xsl:when test="contains($text,' ')">
<xsl:value-of select="substring-before($text,' ')"/>
<br xmlns=""/>
<xsl:text></xsl:text>
<xsl:call-template name="output-nl">
<xsl:with-param name="text" select="substring-after($text,' ')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ============================================================= -->
<!-- Templates used for marking up difference information -->
<!-- ============================================================= -->
<xsl:template match="diff:*">
<span xmlns="" class="{local-name()}">
<xsl:apply-templates select="*"/>
</span>
</xsl:template>
</xsl:transform>

Appendix C References

IETF RFC 2119
IETF (Internet Engineering Task Force) . " RFC 2119: Key words for use in RFCs to Indicate Requirement Levels "
Scott Bradner.
(See http://www.ietf.org/rfc/rfc2119.txt)
XML
W3C (World Wide Web Consortium) . " Extensible Markup Language (XML) 1.0 (Fourth Edition) "
Tim Bray, Jean Paoli, C. M. Sperberg-McQueen, Eve Maler, and François Yergeau.
(See http://www.w3.org/TR/REC-xml/)
XML Schema Structures 1.0
W3C (World Wide Web Consortium) . " XML Schema Part 1: Structures Second Edition "
Henry S. Thompson, David Beech, Murray Maloney, and Noah Mendelsohn.
(See http://www.w3.org/TR/xmlschema-1/)
XMLSPEC
W3C (World Wide Web Consortium) . " Guide to the W3C XML Specification ("XMLspec") DTD, Version 2.1 "
Eve Maler.
(See http://www.w3.org/XML/1998/06/xmlspec-report-v21.htm)

Appendix D Intellectual property status (non-normative)

This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to XBRL International or XBRL organizations, except as required to translate it into languages other than English. Members of XBRL International agree to grant certain licenses under the XBRL International Intellectual Property Policy (www.xbrl.org/legal).

This document and the information contained herein is provided on an "AS IS" basis and XBRL INTERNATIONAL DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

The attention of users of this document is directed to the possibility that compliance with or adoption of XBRL International specifications may require use of an invention covered by patent rights. XBRL International shall not be responsible for identifying patents for which a license may be required by any XBRL International specification, or for conducting legal inquiries into the legal validity or scope of those patents that are brought to its attention. XBRL International specifications are prospective and advisory only. Prospective users are responsible for protecting themselves against liability for infringement of patents. XBRL International takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Members of XBRL International agree to grant certain licenses under the XBRL International Intellectual Property Policy ( www.xbrl.org/legal ).

Appendix E Acknowledgements (non-normative)

This document draws heavily on the ideas and structures developed in the [XMLSPEC] materials produced by the W3C. It also draws on the structures that have proved their value in previous XBRL specifications.

E.1 Sub-section of an appendix.

This is an example of a sub section of an appendix.

Appendix F Document history (non-normative)

DateAuthorDetails
07 October 2007Geoff Shuetrim

Initial draft created.

Much copying and pasting was done.

08 October 2007Geoff Shuetrim

Refinement based on stylesheet creation.

12 October 2007Geoff Shuetrim

Added <termref> , <tableref> , <exampleref> and <figureref> elements. at the suggestion of John Turner .

15 October 2007Geoff Shuetrim

Added <wg> , <personref> , <wgref> , and <xmlref> elements to simplify references to authors, contributors, chunks of XML, and the working group itself.

Fixed an error in the rendering of section references to appendices.

11 July 2008Hugh Wallis

Added <parentid> , <pubtype> to better control publication locations following suggestions from Philip Allen and Walter Hamscher

Added <br> , <strong> to permit more formatting options

Refactored stylesheet considerably

Added many different document stati with appropriate boilerplate text

14 July 2008Hugh Wallis

Corrected sections about <subscript> and <superscript> to match what is actually in the schema and stylesheet

15 December 2008Geoff Shuetrim

Removed the redundant bibliographic entries and corrected a small number of formatting problems.

Appendix G Errata corrections in this document

This appendix contains a list of the errata corrections that have been incorporated into this document. This represents all those errata corrections that have been approved by the XBRL International Specification Working Group up to and including 11 July 2008. Hyperlinks to relevant e-mail threads may only be followed by those who have access to the relevant mailing lists. Access to internal XBRL mailing lists is restricted to members of XBRL International Inc.

NumberDateSectionsDetails
1.09 October 2007 Section 1
Section 2.2.1.5

Example erratum correction.


End Notes

[1]
No. Really. It does!