xml:parse unable to parse content containing a DOCTYPE

Bug #1016606 reported by Matthias Brantner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
Fix Released
High
Nicolae Brinza

Bug Description

The xml:parse function is unable to parse an XML document/fragment if it starts with a doctype definition.

For example,

import module namespace file = "http://expath.org/ns/file";
import module namespace parse-xml = "http://www.zorba-xquery.com/modules/xml";
import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";

for $i at $y in parse-xml:parse(
      file:read-text("tmp.xml"),
      <opt:options>
        <opt:parse-external-parsed-entity opt:skip-root-nodes="1" />
      </opt:options>)
return
  $i

with tmp.xml containing

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<a><b/></a>

raises

[err:FODC0006]: invalid content passed to parse-xml:parse(): loader parsing error: internal error;

Related branches

Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

For the example above, an exception is raised in loader_dtd.cpp

295 if ( ! theXQueryDiagnostics->errors().empty())
296 throw 0; // the argument to throw is not used by the catch clause

Revision history for this message
Chris Hillery (ceejatec) wrote :

Nicolae - please consider this a higher priority than the higher-order function work; if you could work on it in the next couple of weeks that would be great. We really want this in 2.7, whereas the higher-order function features are on the bubble.

Changed in zorba:
milestone: none → 2.7
Chris Hillery (ceejatec)
Changed in zorba:
status: New → Fix Committed
Changed in zorba:
status: Fix Committed → Fix Released
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.