xml:parse unable to parse content containing a DOCTYPE
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://
import module namespace parse-xml = "http://
import schema namespace opt = "http://
for $i at $y in parse-xml:parse(
file:
<opt:options>
<
return
$i
with tmp.xml containing
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://
<a><b/></a>
raises
[err:FODC0006]: invalid content passed to parse-xml:parse(): loader parsing error: internal error;
Related branches
- Chris Hillery: Approve
- Nicolae Brinza: Approve
-
Diff: 459 lines (+362/-6)6 files modifiedChangeLog (+8/-0)
src/store/naive/loader.h (+2/-1)
src/store/naive/loader_dtd.cpp (+22/-5)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-57.xml.res (+159/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/bad.xml (+158/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-57.xq (+13/-0)
Changed in zorba: | |
status: | New → Fix Committed |
Changed in zorba: | |
status: | Fix Committed → Fix Released |
For the example above, an exception is raised in loader_dtd.cpp
295 if ( ! theXQueryDiagno stics-> errors( ).empty( ))
296 throw 0; // the argument to throw is not used by the catch clause