Public bug reported:

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;

** Affects: zorba
     Importance: High
     Assignee: Nicolae Brinza (nbrinza)
         Status: New

-- 
You received this bug notification because you are a member of Zorba
Coders, which is the registrant for Zorba.
https://bugs.launchpad.net/bugs/1016606

Title:
  xml:parse unable to parse content containing a DOCTYPE

Status in Zorba - The XQuery Processor:
  New

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;

To manage notifications about this bug go to:
https://bugs.launchpad.net/zorba/+bug/1016606/+subscriptions

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to