[jdom-interest] Urgent Request to Add a method in SAXBuilder class

Tony Zhang tjzhang at us.ibm.com
Mon Jul 30 15:50:51 PDT 2001


There is a need to add a method in SAXBuilder class so that a parser
property can be set explicitly.
When I use xerces parser directly, I have the following line in my code:

parser.setProperty
("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",
                          "file:///C:/schema-I-want.xsd" );

This is a MUST if you ever want to validate an incoming xml document,
because you don't want the client to specify where is the schema document
for you in its xml document via "schemaLocation" attribute.  You want to
control which schema you want to use for your application.
However, when I am using jdom's SAXBuilder class to parse and build in one
single pass, I did find a way to set this parser property, even I am using
the default xerses parser.
Can anyone please give me a response on this?
I realize that this is kind of a general issue since there may be other
properties or features that one cannot set via jdom.SAXBuilder.  But at
minimum, can we add this set function since it's absolutely critical.  Or
there is already a work-around, that will be great!
One solution is that to let SAXBuilder take an parser object in it's
constructor, rather than to have it build internally from some factory.  I
know this will be more work, so for now all I need is a method to
setProperty which takes a file name (or URI) as an argument.






More information about the jdom-interest mailing list