<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet type="text/xsl" href="../../../2002/xmlspec/xhtml/1.13/xmlspec.xsl"?>
<!DOCTYPE spec SYSTEM "../../../2002/xmlspec/dtd/2.10/xmlspec.dtd" [
<!ENTITY doc.type "rec">
<!ENTITY iso.doc.date "20101028">
<!ENTITY draft.day "28">
<!ENTITY draft.month "October">
<!ENTITY draft.year "2010">
<!ENTITY XMLspec "http://www.w3.org/TR/xml/">
<!ATTLIST spec xml:lang CDATA #IMPLIED>
<!ENTITY % local.label.pcd.mix " | termref"> <!-- Spaces are necessary
                                                  to make IE happy??? -->
]>
<spec w3c-doctype="&doc.type;" xml:lang="en" status="final">
   <header>
      <title>Associating Style Sheets with XML documents</title>
    <version>1.0 (Second Edition)</version>
  <w3c-designation>&doc.type;-&iso.doc.date;</w3c-designation>
  <w3c-doctype>W3C Recommendation</w3c-doctype>
  <pubdate>
   <day>&draft.day;</day>
   <month>&draft.month;</month>
   <year>&draft.year;</year>
  </pubdate>
  <publoc>
     <loc href="http://www.w3.org/TR/2010/REC-xml-stylesheet-20101028"/>
  </publoc>
  <altlocs>
<loc href="xml-stylesheet.xml">XML</loc>
</altlocs>
    <latestloc>
     <loc href="http://www.w3.org/TR/xml-stylesheet"/>
    </latestloc>
    <prevlocs>
     <loc href="http://www.w3.org/TR/2010/PER-xml-stylesheet-20100909"/>
    </prevlocs>
      <authlist>
       <author>
        <name>James Clark (First Edition)</name>
        <email href="mailto:jjc@jclark.com">jjc@jclark.com</email>
       </author>
       <author>
        <name>Simon Pieters (Second Edition)</name>
        <affiliation>Opera Software</affiliation>
        <email href="mailto:simonp@opera.com">simonp@opera.com</email>
       </author>
       <author>
        <name>Henry S. Thompson (Second Edition)</name>
        <affiliation>University of Edinburgh</affiliation>
        <email href="mailto:ht@inf.ed.ac.uk">ht@inf.ed.ac.uk</email>
       </author>
      </authlist>
    <errataloc href="http://www.w3.org/1999/06/REC-xml-stylesheet-19990629/errata"/>
<translationloc href=" http://www.w3.org/2003/03/Translations/byTechnology?technology=xml-stylesheet"/>
      <abstract><p>This document allows style sheets to be associated with an XML document by including one or more processing instructions with a target of <code>xml-stylesheet</code> in the document's prolog.</p></abstract>
      <status>
<p><emph>
This section describes the status of this document at the time 
of its publication. Other documents may supersede this document. 
A list of current W3C publications and the latest revision of 
this technical report can be found in the 
<loc href="http://www.w3.org/TR/">W3C technical reports index</loc>
at http://www.w3.org/TR/.
</emph></p>
<p>
This document is a product of the
<loc href="http://www.w3.org/XML/Core/">XML Core Working Group</loc>
as part of the
<loc href="http://www.w3.org/XML/Activity.html">W3C XML Activity</loc>.
The English version of this specification is the only normative version. 
However, for translations of this document, see 
<loc href="http://www.w3.org/2003/03/Translations/byTechnology?technology=xml-stylesheet">
http://www.w3.org/2003/03/Translations/byTechnology?technology=xml-stylesheet</loc>.
</p>
<p>
This second edition incorporates all known errata as of the publication date,
clarifies several areas left unspecified in the earlier edition, and has been
restructured to allow other specifications to reuse the 
rules for parsing pseudo-attributes from a string.  A more detailed description
of the changes from the first edition is in <specref ref="changes"/>.
This edition supersedes the previous
<loc href="http://www.w3.org/1999/06/REC-xml-stylesheet-19990629/">edition of 29
June 1999</loc>.
</p>
       <p>Comments on this document may be sent to
<loc href="mailto:www-xml-stylesheet-comments@w3.org">www-xml-stylesheet-comments@w3.org</loc>;
public
<loc href="http://lists.w3.org/Archives/Public/www-xml-stylesheet-comments/">archives</loc>
are available.  The errata list for this document is available at <loc href="http://www.w3.org/1999/06/REC-xml-stylesheet-19990629/errata">http://www.w3.org/1999/06/REC-xml-stylesheet-19990629/errata</loc></p>
<p>
This document has been reviewed by W3C Members, by software developers, and by other W3C groups and interested parties, and is endorsed by the Director as a W3C Recommendation. It is a stable document and may be used as reference material or cited from another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its widespread deployment. This enhances the functionality and interoperability of the Web.</p>
<p>
W3C maintains a
<loc href="http://www.w3.org/2002/08/xmlcore-IPR-statements" role="disclosure">public
list of any patent disclosures</loc>
made in connection with the deliverables of
the group; that page also includes instructions for disclosing a patent.
An individual who has actual knowledge of a patent which the individual
believes contains
<loc href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
Claim(s)</loc>
must disclose the information in accordance with
<loc href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
6 of the W3C Patent Policy</loc>.
</p>
</status>
      <langusage>
         <language id="en">English</language>
       <language id="ebnf">Extended Backus-Naur Form (formal grammar)</language>
      </langusage>
      <revisiondesc>
       <slist>
        <sitem>Original, SP, in HTML 5</sitem>
        <sitem>Converted to XML specprod, HST, 2009-09-09</sitem>
        <sitem>Markup cleaned up from pblms introduced by automatic conversion, HST, 2009-09-11</sitem>
        <sitem>Fixed termdef/ref mess, linked in XML spec productions,
restructured conformance a bit, HST, 2009-09-11</sitem>
        <sitem>Added stub bib entries, fixed all remaining validity errors,
folded in some text from email wrt applications etc., tidied conformance and
parsing a bit more, HST, 2009-09-16</sitem>
        <sitem>Major editing by Simon, 2009-09-16 through 2009-12-02</sitem>
        <sitem>Minor cleanup, SotD, and moving to XML date space, PBG, 2009-12-02</sitem>
        <sitem>Copied 2009-12-04 changes back to editor space, HST, 2010-02-17</sitem>
        <sitem>Implemented WG resolutions wrt issues, 2010-02-24, HST
(diff-marked, with ednotes pointing to issues)</sitem>
        <sitem>Further agreed/requested edits, 2010-03-10, HST</sitem>
        <sitem>Prepare for PER publication, SotD from Paul's PER transition request</sitem>
       </slist>
      </revisiondesc>
   </header>
   <body>
      <div1 id="introduction">
         <head> Introduction</head>
       <p><emph>(This section is non-normative.)</emph></p>
       <p>Authors might have particular intentions as to how
user agents are to present the information contained in their XML documents. 
This specification provides a non-intrusive mechanism, using a processing
instruction, to provide links to one or more style sheets, i.e. resources
specifying the desired rendering in a designated language. User
agents will use these resources to control presentation of XML.</p>
       <example>
        <p>Consider an XHTML document with style sheet associations using the <code>link</code> element:</p>
        <eg><![CDATA[<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title>Example with link elements</title>
  <link rel="stylesheet" href="common.css"/>
  <link rel="stylesheet" href="default.css" title="Default style"/>
  <link rel="alternate stylesheet" href="alt.css" title="Alternative style"/>
  <link rel="stylesheet" href="single-col.css" media="all and (max-width: 30em)"/>
 </head>
 <body>
  ...
 </body>
</html>]]></eg>
        <p>This document could be written as follows, using <termref def="dt-xml-stylesheet">xml-stylesheet processing instructions</termref>:</p>
        <eg><![CDATA[<?xml-stylesheet href="common.css"?>
<?xml-stylesheet href="default.css" title="Default style"?>
<?xml-stylesheet alternate="yes" href="alt.css" title="Alternative style"?>
<?xml-stylesheet href="single-col.css" media="all and (max-width: 30em)"?>
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title>Example with xml-stylesheet processing instructions</title>
 </head>
 <body>
  ...
 </body>
</html>]]></eg>
       </example>
      </div1>
      <div1 id="conformance-requirements">
         <head>
Conformance requirements</head>
         <p>All diagrams, examples, and notes in this specification are
non-normative, as are all sections explicitly marked non-normative.
Everything else in this specification is normative.</p>
         <p>The key words <rfc2119>must</rfc2119>, <rfc2119>must
not</rfc2119>, <rfc2119>should</rfc2119>, <rfc2119>should not</rfc2119> and <rfc2119>may</rfc2119> in the normative parts
of this document are to be interpreted as described in RFC 2119. These words do not appear in all uppercase letters in
this specification. <bibref ref="rfc2119"/></p>
         <p>The following conformance classes are defined by this specification:</p>
         <glist>
          <gitem>
           <label>Documents</label>
           <def>
            <p>A document is considered to be a conforming document if it satisfies all <rfc2119>must</rfc2119>-level criteria in this specification that apply to documents.</p>
            <p><termref def="dt-xml-stylesheet">xml-stylesheet
processing instructions</termref> and their pseudo-attributes are intended for
use by document authors to provide links to and information about one
 or more stylesheets, as described in
 <specref ref="the-xml-stylesheet-processing-instruction"/>, which are
available to be applied to the containing document.</p>
           </def>
          </gitem>
          <gitem>
           <label>xml-stylesheet processors</label>
           <def>
            <p>XML defines an <xtermref href="&XMLspec;#dt-app">application</xtermref> as a software module which receives
   the information content of an XML document from an <xtermref href="&XMLspec;#dt-xml-proc">XML processor</xtermref>.
   <termdef term="xml-stylesheet processor" id="dt-xml-stylesheet-processor">An <term>xml-stylesheet processor</term> is such an
   application which processes XML <xtermref href="&XMLspec;#sec-pi">processing instructions</xtermref> in accordance
   with this specification.</termdef> <bibref ref="xml"/></p>
           <p>An <termref def="dt-xml-stylesheet-processor">xml-stylesheet processor</termref> is considered to be a conforming <termref def="dt-xml-stylesheet-processor">xml-stylesheet processor</termref> if it satisfies all <rfc2119>must</rfc2119>-level criteria in this specification that apply to <termref def="dt-xml-stylesheet-processor">xml-stylesheet processors</termref>. <termref def="dt-xml-stylesheet-processor">xml-stylesheet processors</termref> do not have to check or enforce any of the constraints on documents.</p>
           </def>
          </gitem>
          <gitem>
           <label>Applications</label>
           <def>
   <p>An <termref def="dt-xml-stylesheet-processor">xml-stylesheet processor</termref> <rfc2119>may</rfc2119> be part of a larger XML
   application, or <rfc2119>may</rfc2119> function independently.  In either case,
   <termdef term="application" id="dt-application">an <term>application</term> is the consumer of the
   pseudo-attribute analysis defined in this specification.</termdef></p>
            <p>A detailed specification of how <termref def="dt-application">applications</termref> exploit the
       information contained in <termref def="dt-xml-stylesheet">xml-stylesheet
processing instructions</termref>
       is out of scope for this document, as this may reasonably vary
       from application to application.  Accordingly this
       specification places no conformance requirements on
       applications.</p>
            <p>It is however expected that specifications governing the use of
       stylesheet languages will reference this specification in
       describing how applications may identify stylesheets for
       use. Such specifications are expected to specify
       interpretations for the values (or absense of value) of those
       <termref def="dt-pseudo-attribute">pseudo-attributes</termref> which they make use of, doing so in a way
       that is as consistent as possible with those <termref def="dt-pseudo-attribute">pseudo-attributes'</termref>
       descriptions in <specref ref="the-xml-stylesheet-processing-instruction"/>,
       insofar as this makes sense for the application and stylesheet language(s) in question.</p>
           </def>
          </gitem>
         </glist>
         <p>This specification is defined with reference to the vocabulary for
         XML provided by the XML Information
         Set. <bibref ref="infoset"/></p>
         <p>The productions in this specification use the same
         notation as used in the XML specification. Tokens in the
         grammar that are not defined in this specification are defined in
         the XML specification. <bibref ref="xml"/></p>
      </div1>
      <div1 id="pseudo-attributes">
         <head>Pseudo-attributes</head>
         <p><termdef term="rules for parsing pseudo-attributes from a string" id="dt-parsing">The <term>rules for parsing pseudo-attributes from a string</term> are given in this section.</termdef></p>
         <p><termdef term="parsing result" id="dt-parsing-result">The <term>parsing result</term> is either a set of <termref def="dt-pseudo-attribute">pseudo-attributes</termref> or an error.</termdef></p>
         <p>If the given string is not matched by the <nt def="NT-PseudoAtts">PseudoAtts</nt> production, the <termref def="dt-parsing-result">parsing result</termref> is an error.</p>
         <scrap lang="ebnf">
            <head>Productions for strings with pseudo-attributes</head>
            <prodgroup>

               <prod id="NT-PseudoAtts" num="1a">
                  <lhs>PseudoAtts</lhs>
                  <rhs>
                     <nt def="NT-PseudoAtt">PseudoAtt</nt>? (<xnt href="&XMLspec;#NT-S">S</xnt> <nt def="NT-PseudoAtt">PseudoAtt</nt>)* <xnt href="&XMLspec;#NT-S">S</xnt>?</rhs>
               </prod>

               <prod id="NT-PseudoAtt" num="2">
                  <lhs>PseudoAtt</lhs>
                  <rhs><xnt href="&XMLspec;#NT-Name">Name</xnt> <xnt href="&XMLspec;#NT-S">S</xnt>? "=" <xnt href="&XMLspec;#NT-S">S</xnt>? <nt def="NT-PseudoAttValue">PseudoAttValue</nt>
                  </rhs>
               </prod>

               <prod id="NT-PseudoAttValue" num="3">
                  <lhs>PseudoAttValue</lhs>
                  <rhs>('"' ([^"&lt;&amp;] | <xnt href="&XMLspec;#NT-CharRef">CharRef</xnt> | <nt def="NT-PredefEntityRef">PredefEntityRef</nt>)* '"' | "'"
([^'&lt;&amp;] | <xnt href="&XMLspec;#NT-CharRef">CharRef</xnt> | <nt def="NT-PredefEntityRef">PredefEntityRef</nt>)* "'")</rhs>
               </prod>

               <prod id="NT-PredefEntityRef" num="4">
                  <lhs>PredefEntityRef</lhs>
                  <rhs>"&amp;amp;" | "&amp;lt;" | "&amp;gt;" | "&amp;quot;" |
"&amp;apos;"</rhs>
               </prod>

            </prodgroup>
         </scrap>
         <p>
            <termdef term="pseudo-attribute" id="dt-pseudo-attribute">Each
string matched by <nt def="NT-PseudoAtt">PseudoAtt</nt> in the <nt def="NT-PseudoAtts">PseudoAtts</nt> production
represents a <term>pseudo-attribute</term>.</termdef> A
<termref def="dt-pseudo-attribute">pseudo-attribute</termref> has a
<termref def="dt-name">name</termref> and a <termref def="dt-value">value</termref>.
         </p>
         <p>
<termdef id="dt-name" term="name">The
string matched by
<xnt href="&XMLspec;#NT-Name">Name</xnt> in the <nt def="NT-PseudoAtt">PseudoAtt</nt>
production constitutes the <term>name</term> of the corresponding <termref def="dt-pseudo-attribute">pseudo-attribute</termref>.</termdef>
         </p>
         <p>
<termdef id="dt-value" term="value">The string matched by
<nt def="NT-PseudoAttValue">PseudoAttValue</nt> in the <nt def="NT-PseudoAtt">PseudoAtt</nt>
production &#x2014; 
with the
three modifications specified below &#x2014; constitutes the <term>value</term>
of the corresponding <termref def="dt-pseudo-attribute">pseudo-attribute</termref>.</termdef></p>
       <olist>
           <item><p>Each <xnt href="&XMLspec;#NT-CharRef">CharRef</xnt> is replaced with the character it represents according to
XML <bibref ref="xml"/>.</p></item>
           <item>
            <p>Each <nt def="NT-PredefEntityRef">PredefEntityRef</nt> in <nt def="NT-PseudoAttValue">PseudoAttValue</nt> is replaced with U+0026 (&amp;) if it is
"<code>&amp;amp;</code>", U+003C (&lt;) if it is
"<code>&amp;lt;</code>", U+003E (&gt;) if it is
"<code>&amp;gt;</code>", U+0022 (") if it is
"<code>&amp;quot;</code>" and U+0027 (') if it is
"<code>&amp;apos;</code>".</p>
           </item>
           <item><p>The
 first and last character (the start and end quotes) are removed.</p></item>
          </olist>
         <p>The <termref def="dt-parsing-result">parsing result</termref> is an error if the XML <xtermref href="&XMLspec;#wf-Legalchar">Legal Character well-formedness contraint</xtermref> is violated for any <xnt href="&XMLspec;#NT-CharRef">CharRef</xnt>. <bibref ref="xml"/></p>
         <p>The <termref def="dt-parsing-result">parsing result</termref> is an error if there are more than one <termref def="dt-pseudo-attribute">pseudo-attribute</termref> with the same <termref def="dt-name">name</termref>.</p>
       <p>If 
the <termref def="dt-parsing-result">parsing result</termref> is not an error, then it is the set of 
<termref def="dt-pseudo-attribute">pseudo-attributes</termref> represented when the given string is matched by the 
<nt def="NT-PseudoAtts">PseudoAtts</nt> production.</p>
      </div1>
      <div1 id="the-xml-stylesheet-processing-instruction">
         <head>The xml-stylesheet processing instruction</head>
         <p><termdef term="potential xml-stylesheet processing instruction" id="dt-potential-xml-stylesheet">A processing instruction information item is said to be a <term>potential xml-stylesheet processing instruction</term> if it has the [target] property <code>xml-stylesheet</code> and it either is in the [children] property of a document information item and appears before the element information item of the document information item's [children] property, or it appears in the [children] property of a document type declaration information item.</termdef></p>
         <p>For <termref def="dt-potential-xml-stylesheet">potential xml-stylesheet processing instructions</termref> that are in the [children] property of a document information item, <termref def="dt-xml-stylesheet-processor">xml-stylesheet processors</termref> <rfc2119>must</rfc2119> report to the <termref def="dt-application">application</termref> the <termref def="dt-parsing-result">parsing result</termref> of invoking the <termref def="dt-parsing">rules for parsing pseudo-attributes from a string</termref>, using the processing instruction information item's [content] property as the string.</p>
         <p>For <termref def="dt-potential-xml-stylesheet">potential
xml-stylesheet processing instructions</termref> that are in the [children] property of a document type declaration information item, <termref def="dt-xml-stylesheet-processor">xml-stylesheet processors</termref> <rfc2119>may</rfc2119> report to the <termref def="dt-application">application</termref> the <termref def="dt-parsing-result">parsing result</termref> of invoking the <termref def="dt-parsing">rules for parsing pseudo-attributes from a string</termref>, using the processing instruction information item's [content] property as the string. <termdef term="ignored" id="dt-ignored">If it is not reported to the <termref def="dt-application">application</termref>, the processing instruction information item is said to be <term>ignored</term>.</termdef></p>
         <note>
          <p>Since non-validating XML processors are not required to read parameter entities or the external subset, it is possible that processing instructions that appear in parameter entities or the external subset will not be present in the document type declaration information item's [children] property. <bibref ref="xml"/></p>
         </note>
         <p><termdef term="xml-stylesheet processing instruction" id="dt-xml-stylesheet">A <termref def="dt-potential-xml-stylesheet">potential xml-stylesheet processing instruction</termref> is said to be an <term>xml-stylesheet processing instruction</term> if the <termref def="dt-parsing-result">parsing result</termref> is not an error when invoking the <termref def="dt-parsing">rules for parsing pseudo-attributes from a string</termref>, using the processing instruction information item's [content] property as the string.</termdef></p>
            <p>Documents <rfc2119>must not</rfc2119> use processing instruction information items with the [target] property
<code>xml-stylesheet</code> if they are not <termref def="dt-xml-stylesheet">xml-stylesheet processing instructions</termref>.</p>
            <p>Documents <rfc2119>should not</rfc2119> use <termref def="dt-xml-stylesheet">xml-stylesheet processing instructions</termref> that are in the [children] property of a document type declaration information item.</p>
         <p>An <termref def="dt-xml-stylesheet">xml-stylesheet processing instruction</termref> will match the following production:</p>
         <scrap lang="ebnf">
            <head>Production for xml-stylesheet processing instruction</head>
            <prodgroup>

               <prod id="NT-StyleSheetPI" num="1">
                  <lhs>StyleSheetPI</lhs>
                  <rhs>"&lt;?xml-stylesheet" ( (<xnt href="&XMLspec;#NT-S">S</xnt> <nt def="NT-PseudoAtts">PseudoAtts</nt>)? - (<xnt href="&XMLspec;#NT-Char">Char</xnt>* "?&gt;"
<xnt href="&XMLspec;#NT-Char">Char</xnt>*) ) "?&gt;"</rhs>
               </prod>

            </prodgroup>
         </scrap>
         <p>Documents <rfc2119>may</rfc2119> specify the following <termref def="dt-pseudo-attribute">pseudo-attributes</termref> on
<termref def="dt-xml-stylesheet">xml-stylesheet processing instructions</termref>, unless otherwise stated:</p>
         <glist>
            <gitem id="PA-href">
               <label>
                  <code>href</code>
               </label>
               <def>

                  <p>Gives the address of the referenced style sheet. Documents <rfc2119>must</rfc2119> specify this <termref def="dt-pseudo-attribute">pseudo-attribute</termref>. Documents <rfc2119>must</rfc2119> set the <termref def="dt-value">value</termref> to a string that matches the grammar for
&lt;IRI-reference&gt; given in RFC 3987. <bibref ref="rfc3987"/></p>

                  <note>
                   
                   <p>It is possible to associate a style sheet that is in the
same document as the <termref def="dt-xml-stylesheet">xml-stylesheet processing
instruction</termref> by using just a fragment identifier in the <termref def="PA-href"><phrase><code>href</code></phrase></termref> <termref def="dt-pseudo-attribute">pseudo-attribute</termref>.</p>
                   <p>For details on how this is managed in XSLT,
see <xspecref href="http://www.w3.org/TR/xslt20/#embedded">3.11 Embedded
Stylesheet Modules</xspecref> in <bibref ref="xslt"/>.</p>
                  </note>
               </def>
            </gitem>

            <gitem id="PA-type">
               <label>
                  <code>type</code>
               </label>
               <def>

                  <p>Gives an advisory media type for the referenced style sheet. If
specified, documents <rfc2119>must</rfc2119> set the <termref def="dt-value">value</termref> to a string that matches the
<code>media-type</code> production defined in section 3.7 "Media Types"
of RFC 2616. <bibref ref="http"/></p>
                <note>
                 <p><emph>Syntactic</emph> conformance to the
production in RFC 2616 is all that is required by the above.  This
specification imposes no requirements with respect to the status of the types
used.  Some unregistered (as of the publication of this specification) media
types, such as <code>text/xsl</code>, are well-supported by existing
implementations, whereas some registered media types, such as
<code>application/xslt+xml</code>, are not.</p>
                </note>
                <p>
                 The <termref def="dt-value">value</termref> is advisory in
that it is intended to be used by an application only when no other source of
media type
information becomes available during retrieval of the stylesheet itself.</p>
               </def>
            </gitem>

            <gitem id="PA-title">
               <label>
                  <code>title</code>
               </label>
               <def>
                  <p>Gives the title of the referenced style sheet in a style sheet
set. No constraints beyond those of the  <nt def="NT-PseudoAttValue">PseudoAttValue</nt> production
are placed on the <termref def="dt-value">value</termref>.</p>

               </def>
            </gitem>

            <gitem id="PA-media">
               <label>
                  <code>media</code>
               </label>
               <def>

                  <p>Gives the media for which the referenced style sheet applies. If
specified, documents <rfc2119>must</rfc2119> set the <termref def="dt-value">value</termref> to a string that matches the <code>media_query_list</code> production of the Media Queries specification. <bibref ref="mq"/></p>

               </def>
            </gitem>

            <gitem id="PA-charset">
               <label>
                  <code>charset</code>
               </label>
               <def>

                  <p>Gives an advisory character encoding for the referenced style
sheet. If specified, documents <rfc2119>must</rfc2119> set the <termref def="dt-value">value</termref> to a valid
character encoding name, which <rfc2119>must</rfc2119> be the name or alias labeled as "preferred MIME name" in the IANA Character Sets registry, if there is one, or the encoding's name, if none of the aliases are so labeled. <bibref ref="ianacharset"/></p>
                
                <p>
                 The <termref def="dt-value">value</termref> is advisory in
that it is intended to be used by an application only when no other source of encoding
information becomes available during retrieval of the stylesheet itself, either explicitly via an HTTP header,
or implicitly via its media type, as in the case of XML documents.</p>
               </def>
            </gitem>

            <gitem id="PA-alternate">
               <label>
                  <code>alternate</code>
               </label>
               <def>

                  <p>If the <termref def="dt-value">value</termref> is "<code>yes</code>", it
indicates that the referenced style sheet is an alternative style
sheet, and documents <rfc2119>must</rfc2119> also specify the <termref def="PA-title"><phrase><code>title</code></phrase></termref> 
                     <termref def="dt-pseudo-attribute">pseudo-attribute</termref> with a non-empty <termref def="dt-value">value</termref>. If specified, documents <rfc2119>must</rfc2119> set the <termref def="dt-value">value</termref> to either "<code>yes</code>" or
"<code>no</code>".</p>

               </def>
            </gitem>

         </glist>
         <p>Documents <rfc2119>must not</rfc2119> specify other <termref def="dt-pseudo-attribute">pseudo-attributes</termref> on
<termref def="dt-xml-stylesheet">xml-stylesheet processing instructions</termref>.</p>
         <p>Any links to style sheets that are specified externally to the
document (e.g. <code>Link</code> headers in some versions of HTTP <bibref ref="rfc2068"/>) are considered to create associations that occur before the associations specified by the <termref def="dt-xml-stylesheet">xml-stylesheet processing instructions</termref>.  The <termref def="dt-application">application</termref> is responsible for taking all associations and determining how, if at all, their order affects its processing.</p>
      </div1>
   </body>
   <back>
      <div1 id="references">
       <head>References</head>
       <p>References are normative unless marked "non-normative".</p>
       <blist>
        <bibl id="ianacharset" key="IANACHARSET" href="http://www.iana.org/assignments/character-sets"><titleref>Character Sets</titleref>. IANA, May 2007.</bibl>
        <bibl id="infoset" key="INFOSET" href="http://www.w3.org/TR/xml-infoset/"><titleref>XML Information Set</titleref>, J. Cowan, R. Tobin. W3C, February 2004.</bibl>
        <bibl id="mq" key="MQ" href="http://www.w3.org/TR/css3-mediaqueries/"><titleref>Media
   Queries</titleref>, H. Lie, T.  &#199;elik, D. Glazman, A. van
   Kesteren. W3C, April 2009.</bibl>
        <bibl id="rfc2068" key="RFC2068" href="http://www.ietf.org/rfc/rfc2068.txt">(non-normative) <titleref>Hypertext
   Transfer Protocol &#8212; HTTP/1.1</titleref>, R. Fielding, J. Gettys,
   J. Mogul, H.  Frystyk, T. Berners-Lee. IETF,
   June 1997.</bibl><bibl id="rfc2119" key="RFC2119" href="http://www.ietf.org/rfc/rfc2119.txt"><titleref>Key words for use in
   RFCs to Indicate Requirement Levels</titleref>, S. Bradner. IETF, March
   1997.</bibl>
        <bibl id="http" key="RFC2616" href="http://www.ietf.org/rfc/rfc2616.txt"><titleref>Hypertext
   Transfer Protocol &#8212; HTTP/1.1</titleref>, R. Fielding, J. Gettys,
   J. Mogul, H.  Frystyk, L. Masinter, P. Leach, T. Berners-Lee. IETF,
   June 1999.</bibl>
        <bibl id="rfc3987" key="RFC3987" href="http://www.ietf.org/rfc/rfc3987.txt"><titleref>Internationalized
   Resource Identifiers (IRIs)</titleref>, M. D&#252;rst, M. Suignard. IETF, January
   2005.</bibl>
        <bibl id="xml" key="XML" href="http://www.w3.org/TR/xml/"><titleref>Extensible Markup
   Language</titleref>, T. Bray, J. Paoli, C. Sperberg-McQueen,
   E. Maler, F. Yergeau. W3C, November 2008.</bibl>  
        <bibl key="XSLT" id="xslt" href="http://www.w3.org/TR/xslt20/">(non-normative) <titleref>XSL Transformations (XSLT) Version 2.0</titleref>, M. Kay. W3C, January 2007.</bibl>      
       </blist>
      </div1>
    <div1 id="changes">
     <head>Changes since the first edition</head>
     <p>This appendix is non-normative</p>
     <p>The first edition of this specification was admirably brief, but at the
same time left many details unstated.  This second edition aims to fill the
gaps left in the first edition, while restructuring the presentation to provide
for independent citation and re-use of the pseudo-attribute construct.</p>
     <p>Neither the syntax nor the semantics of the <code>xml-stylesheet</code>
processing instructions have been changed, beyond the restructuring just
mentioned.  Conformance constraints on processors have been eased slightly, in
that <code>xml-stylesheet</code>
processing instructions occurring within the internal or external subset may be ignored.</p>
     <p>The following list identifies the major changes which have been made:</p>
     <ulist>
      <item><p>Provided definitions for a number of terms used but not defined in the
first edition;</p></item>
      <item><p>Added a conformance section, distinguishing between processor
and document conformance, all of which was implicit in the first edition;</p></item>
      <item><p>Identified a number of error cases, which were implicit in the first
edition's appeal to the parallel with element start tag processing, and
specified expected processor behaviour;</p></item>
      <item><p>In recognition of deployed processor behaviour, allowed
<code>xml-stylesheet</code> processing instructions to be ignored unless they
are among the [children] of the document information item;</p></item>
      <item><p>Added a number of references, but removed the explicit
dependence on the HTML 4.0 specification by adding descriptions of the meanings
of each of the pseudo-attributes consistent with their HTML 4.0 use but brought up-to-date;</p></item>
      <item><p>Removed the (non-normative) Rationale section, as it contained a
number of out-of-date assumptions;</p></item>
      <item><p>Made the <code>type</code> pseudo-attribute optional, as agreed
by <loc href="http://www.w3.org/1999/06/REC-xml-stylesheet-19990629/errata">existing erratum</loc>.</p></item>
     </ulist>
    </div1>
   </back>
</spec>
