<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>8477</bug_id>
          
          <creation_ts>2009-12-11 13:33:04 +0000</creation_ts>
          <short_desc>[XSLT 2.0] lang attribute of xsl:sort and xsl:number</short_desc>
          <delta_ts>2012-09-04 10:18:01 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XSLT 2.0</component>
          <version>Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          <cc>sca.w3c</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>30081</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2009-12-11 13:33:04 +0000</bug_when>
    <thetext>For both xsl:sort and xsl:number we make two statements about the lang attribute:

(a) we give the format in the syntax template as 

lang? = { nmtoken }

(b) we say that the range of permitted values is the same as for xml:lang, with a reference to the XML specification

These are inconsistent: the xml:lang attribute allows a zero-length string, whereas nmtoken does not. 

Also, the reference to xml:lang could be taken as implying that the language must be present in the various lists of registered languages, rather than merely conforming to the correct syntax.

I would suggest that 

(i) we change the syntax template to 

lang? = { xs:language? }

(ii) rather than referring to xml:lang, we say that the value must either be a zero-length string or a string in the value space of xs:language. This makes it clear that the constraint is purely syntactic.

(iii) we specify that the zero length string has the same effect as omitting the lang attribute.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35215</commentid>
    <comment_count>1</comment_count>
    <who name="Sharon Adler">sca.w3c</who>
    <bug_when>2010-04-22 11:06:37 +0000</bug_when>
    <thetext>was marked resolved by mistake when I was closing another bug and system moved to this one without me noticing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35828</commentid>
    <comment_count>2</comment_count>
    <who name="Sharon Adler">sca.w3c</who>
    <bug_when>2010-05-25 21:06:50 +0000</bug_when>
    <thetext>At the regular XSLT WG telcon on 20 May 2010 the group agreed to accept the proposal from Mike Kay as suggested in the Description of the bug.  The bug will be closed when the errata is drafted and approved as part of the normal errata review process.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36417</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-06-24 22:40:17 +0000</bug_when>
    <thetext>I am reopening this to include an issue raised by bug #788 raised a long while ago against the test suite, and never resolved.

What should xsl:sort do if lang is present and specifies a language that is not supported by the implementation? Should it raise an error, or should it fall back (e.g. to English language, or to codepoint collation)?

Note that for xsl:number we say &quot;If a language is requested that is not supported, the processor uses the language that it would use if the lang attribute were omitted.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36911</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-07-15 11:02:47 +0000</bug_when>
    <thetext>&gt;What should xsl:sort do if lang is present and specifies a language that is not
supported by the implementation?

Recommend: (a) strip off trailing parts of the lang until you find something that&apos;s supported, (b) if that still doesn&apos;t work, give an error. But note that implementations are free to recognize any languages they choose to.

Both halves of this issue will be resolved in erratum E54.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73176</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2012-09-04 10:18:01 +0000</bug_when>
    <thetext>Note that the solution actually adopted in erratum E54 (not published, but incorporated into XSLT 3.0) was that an invalid value for @lang should be handled as if no value for @lang was requested, that is, use a default language rather than raise an error.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>