Top-level elements

The Top Level entity defines the elements that can occur within the Stylesheet (or Transform) element. It forces all Import elements to appear first (if any occur at all), and then allows any mixture of other allowed elements:

<!ENTITY % top-level "
      (xsl:import*,
        (xsl:include | xsl:strip-space |
         xsl:preserve-space | xsl:output |
         xsl:key | xsl:decimal-format |
         xsl:attribute-set | xsl:variable |
         xsl:param | xsl:template |
         xsl:namespace-alias
         %non-xsl-top-level;)*) ">

Note that the Template and Variable elements shown in this list are described in the next section. The other elements are described below.

A mechanism for adding non-XSLT elements to this group is provided by the entity reference at the end. But the Non-XSL Top Level entity is initially empty:

<!ENTITY % non-xsl-top-level " " >

The Top Level entity is referenced from two places, namely from the Stylesheet element definition and from the Transform element definition:

<!ELEMENT xsl:stylesheet %top-level;>

<!ELEMENT xsl:transform %top-level;>

For example:

<xsl:stylesheet ...>
  <xsl:import .../>
  <xsl:import .../>
  <xsl:template ...>...</xsl:template>
  <xsl:template ...>...</xsl:template>
</xsl:stylesheet>

There are also a number of attributes that these two elements can take, and these are grouped within the Top Level Attributes entity:

<!ENTITY % top-level-atts "
      extension-element-prefixes CDATA      #IMPLIED
      exclude-result-prefixes    CDATA      #IMPLIED
      id                         ID         #IMPLIED
      version                    NMTOKEN    #REQUIRED
      xmlns:xsl                  CDATA
            #FIXED "http://www.w3.org/1999/XSL/Transform"
      %space-att;

<!ATTLIST xsl:stylesheet %top-level-atts;>

<!ATTLIST xsl:transform %top-level-atts;>

Import element

The Import element is defined as follows:

<!ELEMENT xsl:import EMPTY >

The attributes are as follows:

<!ATTLIST xsl:import href  %URI;   #REQUIRED >

With the entity replaced, the true model is as follows:

<!ATTLIST xsl:import href  CDATA   #REQUIRED >

For example:

<xsl:import href="./library/styleTables.xsl" />

Include element

The Include element is defined as follows:

<!ELEMENT xsl:include EMPTY >

The attributes are as follows:

<!ATTLIST xsl:include href  %URI;   #REQUIRED >

With the entity replaced, the true model is as follows:

<!ATTLIST xsl:include href  CDATA   #REQUIRED >

For example:

<xsl:include href="commonStyles.xsl" />

Strip Space element

The Strip Space element is defined as follows:

<!ELEMENT xsl:strip-space EMPTY >

The attributes are as follows:

<!ATTLIST xsl:strip-space  elements  CDATA   #REQUIRED >

For example:

<xsl:strip-space elements="book title para" />

Preserve Space element

The Preserve Space element is defined as follows:

<!ELEMENT xsl:preserve-space EMPTY >

The attributes are as follows:

<!ATTLIST xsl:preserve-space
                   elements  CDATA   #REQUIRED >

For example:

<xsl:preserve-space elements="example preformatted" />

Output element

The Output element is defined as follows:

<!ELEMENT xsl:output EMPTY >

The attributes are as follows:

<!ATTLIST xsl:output
          method                 %qname;     #IMPLIED
          version                NMTOKEN     #IMPLIED
          encoding               CDATA       #IMPLIED
          omit-xml-declaration    (yes|no)    #IMPLIED
          standalone             (yes|no)    #IMPLIED
          doctype-public         CDATA       #IMPLIED
          doctype-system         CDATA       #IMPLIED
          cdata-section-elements  %qnames;    #IMPLIED
          indent                 (yes|no)    #IMPLIED
          media-type             CDATA       #IMPLIED >

With all the embedded entity references replaced, the true model is as follows:

<!ATTLIST xsl:output
          method                 NMTOKEN   #IMPLIED
          version                NMTOKEN   #IMPLIED
          encoding               CDATA     #IMPLIED
          omit-xml-declaration    (yes|no)  #IMPLIED
          standalone             (yes|no)  #IMPLIED
          doctype-public         CDATA     #IMPLIED
          doctype-system         CDATA     #IMPLIED
          cdata-section-elements  NMTOKENS  #IMPLIED
          indent                 (yes|no)  #IMPLIED
          media-type             CDATA     #IMPLIED >

For example:

<xsl:output method="HTML" version="4.0" />

Key element

The Key element is defined as follows:

<!ELEMENT xsl:key EMPTY >

The attributes are as follows:

<!ATTLIST xsl:key
          name           %qname;           #IMPLIED
          match          %pattern;         #IMPLIED
          use            %expr;            #IMPLIED >

With all the embedded entity references replaced, the true model is as follows:

<!ATTLIST xsl:key
          name           NMTOKEN           #IMPLIED
          match          CDATA             #IMPLIED
          use            CDATA             #IMPLIED >

For example:

<xsl:key name="nameKey" match="name" use="name/first"/>

Decimal Format element

The Decimal Format element is defined as follows:

<!ELEMENT xsl:decimal-format EMPTY >

The attributes are as follows:

<!ATTLIST xsl:decimal-format
          name               %qname;       #IMPLIED
          decimal-separator  %char;        "."
          grouping-separator %char;        ","
          infinity           CDATA         "infinity"
          minus-sign         %char;        "-"
          NaN                CDATA         "NaN"
          percent            %char;        "%"
          per-mille          %char;        "&#x2030;"
          zero-digit         %char;        "0"
          digit              %char;        "#"
          pattern-separator  %char;        ";" >

With all the embedded entity references replaced, the true model is as follows:

<!ATTLIST xsl:decimal-format
          name               NMTOKEN       #IMPLIED
          decimal-separator  CDATA         "."
          grouping-separator CDATA         ","
          infinity           CDATA         "infinity"
          minus-sign         CDATA         "-"
          NaN                CDATA         "NaN"
          percent            CDATA         "%"
          per-mille          CDATA         "&#x2030;"
          zero-digit         CDATA         "0"
          digit              CDATA         "#"
          pattern-separator  CDATA         ";" >

Attribute Set element

The Attribute Set element is defined as follows:

<!ELEMENT xsl:attribute-set (xsl:attribute)* >

The attributes are as follows:

<!ATTLIST xsl:attribute-set
          name                 %qname;       #REQUIRED
          use-attribute-sets   %qnames;      #IMPLIED >

With all the embedded entity references replaced, the true model is as follows:

<!ATTLIST xsl:attribute-set
          name                 NMTOKEN       #REQUIRED
          use-attribute-sets   NMTOKENS      #IMPLIED >

For example:

<xsl:attribute-set name="standardSet" >
  <xsl:attribute...></xsl:attribute>
  <xsl:attribute...></xsl:attribute>
  <xsl:attribute...></xsl:attribute>
</xsl:attribute-set>

Parameter element

The Parameter element is defined as follows:

<!ELEMENT xsl:param       %template; >

This expands to the following:

<!ELEMENT xsl:param ( #PCDATA |
          xsl:apply-templates | xsl:call-template |
          xsl:apply-imports | xsl:for-each |
          xsl:value-of | xsl:copy-of |
          xsl:number | xsl:choose | xslif |
          xsl:text | xsl:copy | xsl:variable |
          xsl:message | xsl:fallback |
          xsl:processing-instruction | xsl:comment |
          xsl:element | xsl:attribute )* >

The attributes are as follows:

<!ATTLIST xsl:attribute-set
          name               %qname;       #REQUIRED
          select             %expr;        #IMPLIED >

With the embedded entity references replaced, the true model is as follows:

<!ATTLIST xsl:attribute-set
          name               NMTOKEN       #REQUIRED
          select             CDATA         #IMPLIED >

Namespace Alias element

The Namespace Alias element is defined as follows:

<!ELEMENT xsl:namespace-alias EMPTY >

The attributes are as follows:

<!ATTLIST xsl:namespace-alias
          stylesheet-prefix    CDATA       #REQUIRED
          result-prefix         CDATA       #REQUIRED >

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset