W3C home > Mailing lists > Public > public-qt-comments@w3.org > May 2015

[Bug 28662] New: Editorial: Example for fn:json-to-xml

From: <bugzilla@jessica.w3.org>
Date: Wed, 20 May 2015 14:47:38 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-28662-523@http.www.w3.org/Bugs/Public/>

            Bug ID: 28662
           Summary: Editorial: Example for fn:json-to-xml
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Functions and Operators 3.1
          Assignee: mike@saxonica.com
          Reporter: christian.gruen@gmail.com
        QA Contact: public-qt-comments@w3.org

In the "Examples" section of fn:json-to-xml, it's a bit surprising to have code
in the XSLT syntax. Maybe it could be replaced with the following equivalent

  let $jsonstr := unparsed-text('http://example.com/endpoint')
  let $options := map {
    'liberal': true(),
    'fallback': function($char as xs:string) as xs:string {
      let $c0chars := map {
      let $replacement := $c0chars($char)
      return if (exists($replacement))
        then $replacement
        else error(xs:QName('err:invalid-char'), 
          'Error: ' || $char || ' is not a terminal control char.')
  return json-to-xml($jsonstr, $options)

You are receiving this mail because:
You are the QA Contact for the bug.
Received on Wednesday, 20 May 2015 14:47:39 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:54 UTC