parse-xml-fragment error message

Bug #1154100 reported by William Candillon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
New
Medium
Nicolae Brinza

Bug Description

parse-xml-fragment error message could be improved:

declare namespace err = "http://www.w3.org/2005/xqt-errors";
declare namespace zerr = "http://www.zorba-xquery.com/errors";

let $src := '<Book ISBN="ISBN-0-13-713526-2" Price="85" Edition="3rd">
  <Title>A First Course in Database Systems</Title>
  <Authors>
    <Author>
      <First_Name>Jeffrey</First_Name>
      <Last_Name>Ullman</Last_Name>'
return
    try {
        parse-xml-fragment($src)
    } catch * {
        {
          "error": true,
          "code": $err:code,
          "description": $err:description,
          "module": $err:module,
          "line-number": $err:line-number,
          "column-number": $err:column-number,
          "line-number-end": $zerr:line-number-end,
          "column-number-end": $zerr:column-number-end
        }
    }

Returns
{ "error" : true, "code" : "err:FODC0006", "description" : "invalid content passed to fn:parse-xml-fragment(): \"malformed XML document at \"zorba://internalDocumentURI-2\"\":zorba://internalDocumentURI-2,: loader parsing error", "module" : "/Users/wcandillon/28msec/zorba/build/test3.xq", "line-number" : 12, "column-number" : 9, "line-number-end" : 12, "column-number-end" : 33 }

The error message is not very explicit. For the same input, parse-xml() returns the appropriate/expected error message.

Changed in zorba:
assignee: nobody → Paul J. Lucas (paul-lucas)
Changed in zorba:
assignee: Paul J. Lucas (paul-lucas) → Nicolae Brinza (nbrinza)
importance: Undecided → Medium
tags: added: xml-parser
tags: added: error-reporting
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.