<?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>1566</bug_id>
          
          <creation_ts>2005-07-13 08:27:07 +0000</creation_ts>
          <short_desc>[FS] technical: 4.1.1 Literals</short_desc>
          <delta_ts>2005-09-06 12:58:34 +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>Formal Semantics 1.0</component>
          <version>Last Call drafts</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</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 Dyck">jmdyck</reporter>
          <assigned_to name="Jerome Simeon">simeon</assigned_to>
          
          
          <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>4536</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2005-07-13 08:27:07 +0000</bug_when>
    <thetext>4.1.1 Literals

Normalization
&quot;Predefined entity references and character references in strings are
resolved to characters as part of parsing&quot;
    Oh? I don&apos;t think that&apos;s specified anywhere. And I don&apos;t think it
    should be. It&apos;s part of the semantics of string literals, and you
    shouldn&apos;t just foist it onto the parser.

DEv / rule 1 / conclusion 1
DEv 2 / rule 1 / conclusion 1
DEv 3 / rule 1 / conclusion 1
DEv 4 / rule 1 / conclusion 1
&quot;dynEnv |- FooLiteral =&gt; xs:foo(FooLiteral)&quot;
    The xs:foo constructor function expects an argument value of type
    xdt:anyAtomicType. The &apos;FooLiteral&apos; pattern is bound to (say) a node
    in the syntax tree of the subject query, which is not a value of
    xdt:anyAtomicType. So it shouldn&apos;t appear as the argument to xs:foo().

    You need a mechanism (say, fs:literal-to-string()) to go from a node
    in the syntax tree to a value of xs:string (I think) that contains
    the sequence of query characters covered by that node. (Also, for
    string literals, you&apos;ll need a function to strip the delimiters and
    &quot;un-double&quot; any occurrences of the delimiter-character.)


&quot;Note that literal overflows are raised during parsing.&quot;
    Again, this is not something that should be foisted onto the parser.
    Note that the constructor function will raise an error if its arg is
    illegal for the target datatype; is that sufficient to handle &quot;literal
    overflows&quot;?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5050</commentid>
    <comment_count>1</comment_count>
    <who name="Jerome Simeon">simeon</who>
    <bug_when>2005-07-20 23:31:15 +0000</bug_when>
    <thetext>Michael,

Thanks for the comment. It seems that a somewhat cleaner way to write the
semantics would be to introduce an auxiliary judgment to go from
literalexpressions to literalvalues. This would be a bit less heavy-handed than
a function.

This could look as follows. Would that be better?

- Jerome

We could introduce an auxiliary judgement to go from the syntax tree
literal to the value literal. As follows.

Instead of writing:

  -------------------------------------------------------
  dynEnv |- IntegerLiteral =&gt; xs:integer (IntegerLiteral)


write:

  IntegerLiteral has literal value IntegerValue
  -------------------------------------------------------------
  dynEnv |- IntegerLiteral =&gt; IntegerLiteral of type xs:integer


Instead of writing:

  ---------------------------------------------------
  dynEnv |- DoubleLiteral =&gt; xs:double(DoubleLiteral)

write:

  DoubleLiteral has literal value DoubleValue
  --------------------------------------------------------
  dynEnv |- DoubleLiteral =&gt; DoubleValue of type xs:double

where the has literal value raises a static error if the literal
overflows.

Instead of writing:

  ---------------------------------------------------
  dynEnv |- StringLiteral =&gt; xs:string(StringLiteral)

write:

  StringLiteral has literal value StringValue
  --------------------------------------------------------
  dynEnv |- StringLiteral =&gt; StringValue of type xs:string

Where the judgment &apos;has literal value&apos; deals with character
references, and predefined entity references.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5065</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2005-07-21 00:57:15 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt;
&gt; It seems that a somewhat cleaner way to write the semantics would be
&gt; to introduce an auxiliary judgment to go from literalexpressions to
&gt; literalvalues. This would be a bit less heavy-handed than a function.

Fine with me. Am I right in thinking it would only have a prose definition?

&gt;   IntegerLiteral has literal value IntegerValue
&gt;   -------------------------------------------------------------
&gt;   dynEnv |- IntegerLiteral =&gt; IntegerLiteral of type xs:integer

In the conclusion, the second &quot;IntegerLiteral&quot; should presumably be &quot;IntegerValue&quot;.

You have to be a little careful with terminology and symbology.
In &quot;X of type Y&quot;, X is (in these cases) AtomicValueContent, so
the suggested &apos;FooValue&apos; symbols don&apos;t fit. Instead, you&apos;d want
to use the alternatives under AtomicValueContent, specifically
Decimal, Double, and String. That is:
    IntegerLiteral has literal value Decimal
    DecimalLiteral has literal value Decimal
    DoubleLiteral  has literal value Double
    StringLiteral  has literal value String

You might consider changing &quot;has literal value&quot; to the more terminologically
correct &quot;has literal value content&quot;, although it&apos;s kind of clunky.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5077</commentid>
    <comment_count>3</comment_count>
    <who name="Jerome Simeon">simeon</who>
    <bug_when>2005-07-21 17:23:59 +0000</bug_when>
    <thetext>yes to all counts.
  we would only provide a prose definition for that judgment.
  IntegerValue was intended in that rule.
  We have to make sure the right hand side of the judgment is a formal value
(grammar production AtomicValueContent)

- Jerome</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5181</commentid>
    <comment_count>4</comment_count>
    <who name="Jerome Simeon">simeon</who>
    <bug_when>2005-07-22 22:45:13 +0000</bug_when>
    <thetext>The proposed resolution in additional comment #1, along with your amendments has
been adopted.

- Jerome Simeon
On behalf of the XML Query and XSL WGs</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>