Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] Problem with "Missing scheme in absolute URI reference"

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Peter Murray-Rust <pm286 AT cam.ac.uk>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: [XOM-interest] Problem with "Missing scheme in absolute URI reference"
  • Date: Wed, 31 Dec 2008 16:32:32 +0000

I am trying to parse some SVG generated by pstoedit and so out of my control. This uses a DOCTYPE + remote DTD which appear to be valid but which throw the above exception. (I don't understand it as there are no explicit namespaceURIs). The SYSTEM identifiers appear to be valid from the W3C site (I have copied them to make sure). I attach (simplified) code snippets which demonstrate the problem using XOM-1.1. The second one is valid against the W3C validation service (except for missing required SVG attributes)

At present the workaround is to edit the XML to remove the DOCTYPE as I cannot control its output. I prefer not to do this - is there a way of setting XOM to ignore the DOCTYPE or some otehr setting?

Thanks

P.

public class TestXOM {

public static void main(String[] args) {
String[] strings = {
"<?xml version='1.0' encoding='UTF-8'?>"+
"<!DOCTYPE svg SYSTEM \"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\";>"+
"<svg/>",

"<?xml version='1.0' encoding='UTF-8'?>"+
"<!DOCTYPE svg SYSTEM \"http://www.w3.org/TR/2000/03/WD-SVG-20000303/DTD/svg-20000303-stylable.dtd\";>"+
"<svg/>",

"<?xml version='1.0' encoding='UTF-8'?>"+
"<!DOCTYPE svg SYSTEM \"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/nonexistent.dtd\";>"+
"<svg/>"
};
for (String s : strings) {
try {
new Builder().build(new StringReader(s));
System.out.println("parsed OK");
} catch (Exception e) {
System.out.println(e);
}
}
}
}

which gives:

parsed OK

nu.xom.ParsingException: Missing scheme in absolute URI reference

java.io.FileNotFoundException: http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/nonexistent.dtd




Archive powered by MHonArc 2.6.24.

Top of Page