[Bug 29187] New: [editorial] Errors in string constructor examples

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29187

            Bug ID: 29187
           Summary: [editorial] Errors in string constructor examples
           Product: XPath / XQuery / XSLT
           Version: Proposed Edited Recommendation
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XQuery 3.1
          Assignee: jonathan.robie@gmail.com
          Reporter: josh.spiegel@oracle.com
        QA Contact: public-qt-comments@w3.org
  Target Milestone: ---

See:
https://lists.w3.org/Archives/Public/public-xsl-query/2015Oct/0034.html

(1)

    This is missing a back tick in the close of the string constructor:

      ``[`{ $i, ``[literal text]``, $j, ``[more literal text]`` }`]`

(2)

This example is a mix of XQuery and JSON:

    {
      "name": "Chris",
      "value": 10000,
      "taxed_value": 10000 - (10000 * 0.4),
      "in_ca": true
   }

Should it be?

   map {
      "name": "Chris",
      "value": 10000,
      "taxed_value": 10000 - (10000 * 0.4),
      "in_ca": true()
   }

(3) 

This example:

declare function local:prize-message($a) as xs:string
{
``[Hello `{$a.name}`
You have just won `{$a.value}` dollars!
…

Has the wrong lookup operator syntax.  It should be:

declare function local:prize-message($a) as xs:string
{
``[Hello `{$a?name}`
You have just won `{$a?value}` dollars!
…

(the same applies to the following 2 prize-message functions)

(4) 

For the <div> example, there are two spaces before the closing </div>.  I would
remove the two spaces and then correct the output whitespace to this:

<div>
    <h1>Hello Chris</h1>
    <p>You have just won 10000 dollars!</p>
    <p>Well, 6000 dollars, after taxes.</p> 
</div>

(5) There is no indenting in the final prize-message function. 

(6) The final prize-message function is missing an interpolation: $a.value
should be `{$a?value}`

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Thursday, 8 October 2015 14:55:01 UTC