xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
[XOM-interest] Consider adding Builder.getXMLReader()
- From: Wolfgang Hoschek <whoschek AT lbl.gov>
- To: xom-interest AT lists.ibiblio.org
- Subject: [XOM-interest] Consider adding Builder.getXMLReader()
- Date: Fri, 03 Oct 2003 10:27:16 -0700
Hi,
For my XML Schema validation taks, I need to use a nu.xom.Builder with custom features and properties set, such as:
parser.setFeature(
"http://apache.org/xml/features/validation/schema", true);
parser.setFeature(
"http://apache.org/xml/features/validation/dynamic", true);
parser.setFeature(
"http://apache.org/xml/features/validation/schema-full-checking", true);
parser.setProperty(
"http://apache.org/xml/properties/schema/external-schemaLocation",
"http://dsd.lbl.gov/p2pio-1.0 file:///home/g5/users/hoschek/devel/firebundle/firefish/src/schemas/p2pio.xsd");
Builder already supports this by taking a custom XMLReader in the constructor, but it is still cumbersome:
I still need to find a parser myself and hence duplicate the good and solid code within Builder (findParsers(), setupParser()), that normally takes care of this fragile step. This would be quite a bit easier if Builder had a method
public XMLReader getXMLReader() {
return this.parser;
}
(or perhaps better named getParser()) so that I could get hold of the reader and then customize it afterwards, ala:
builder = new Builder(true);
builder.getXMLReader().setFeature(...);
builder.build(...)
Would you consider adding such a method?
As an aside, new Builder(true) does not seem to be able to validate XML schemas (xerces-2.3.0 here), as opposed to DTDs. A feature such as
parser.setFeature(
"http://apache.org/xml/features/validation/schema", true);
apparently must be set to make it do that.
Perhaps long term (and here I am not sure) it might make sense to provide another constructor to Builder that works "out-of-the-box" for XML Schema validation, whether a schema location is present in the XML doc or not, and optionally on external schema locations. In any case, just adding method getXMLReader() would help quite a bit.
Thanks,
Wolfgang.
-
[XOM-interest] Consider adding Builder.getXMLReader(),
Wolfgang Hoschek, 10/03/2003
-
Re: [XOM-interest] Consider adding Builder.getXMLReader(),
Elliotte Rusty Harold, 10/03/2003
-
Re: [XOM-interest] Consider adding Builder.getXMLReader(),
Wolfgang Hoschek, 10/10/2003
-
Re: [XOM-interest] Consider adding Builder.getXMLReader(),
Elliotte Rusty Harold, 10/10/2003
-
Re: [XOM-interest] Consider adding Builder.getXMLReader(),
Wolfgang Hoschek, 10/10/2003
- Re: [XOM-interest] Consider adding Builder.getXMLReader(), Elliotte Rusty Harold, 10/10/2003
-
Re: [XOM-interest] Consider adding Builder.getXMLReader(),
John Cowan, 10/10/2003
-
Re: [XOM-interest] Consider adding Builder.getXMLReader(),
Elliotte Rusty Harold, 10/10/2003
- Re: [XOM-interest] Consider adding Builder.getXMLReader(), John Cowan, 10/10/2003
- Re: [XOM-interest] Consider adding Builder.getXMLReader(), Elliotte Rusty Harold, 10/10/2003
-
Re: [XOM-interest] Consider adding Builder.getXMLReader(),
Elliotte Rusty Harold, 10/10/2003
-
Re: [XOM-interest] Consider adding Builder.getXMLReader(),
Wolfgang Hoschek, 10/10/2003
-
Re: [XOM-interest] Consider adding Builder.getXMLReader(),
Elliotte Rusty Harold, 10/10/2003
-
Re: [XOM-interest] Consider adding Builder.getXMLReader(),
Wolfgang Hoschek, 10/10/2003
-
Re: [XOM-interest] Consider adding Builder.getXMLReader(),
Elliotte Rusty Harold, 10/03/2003
Archive powered by MHonArc 2.6.24.