[jdom-interest] Configuring source of schema file when validating

Craig Dickson craig.dickson at kirus.com
Fri Oct 4 15:28:05 PDT 2002

My apologies if this has been asked on this list before. I had a look
through the archives but could not see anything on this exact topic. Please
direct me to the post if it has however and I just missed.
We have a set of EJB Session beans that process incoming request from
clients that are XML messages (it is not yet a full blown web service, but
hopefully someday it will be). The XML documents currently specify a schema
in their root node and validation seems to be operating quite nicely.
The issue we have is that the paths specified to the schemas are in the form
"schemas/inboundCustomerOrder.xsd". We use a SAXBuilder to create the
document in memory and pass 'true' to the SAXBuilder constructor. We then
call SAXBuilder.build(...) passing a Reader in. Now it would appear that the
internal workings look for the schema by doing something like 'new
File(schemaPath)' and then obviously create an InputStream of some
description and read the schema file. This forces (in our case) the
'schemas' directory to be in our Weblogic root, since this is where the
relative path is verified from. This is very unfriendly to our customers and
not exactly J2EE compliant.
What would like to be able to do is somehow package the schemas into our
.ear file so that it is all together and deployed all nicely. We can
probably figure out how to mount the schemas in the .ear file, but that is
pointless since there is no way (that we can see) to instruct the parser
where to load the schema from, or pass the schema as an InputStream or
anything like that. We have thought of maybe trying to use a HTTP URL as the
schema location, but we think this is a "fragile" solution as it means our
whole application is at the mercy of a lowly web server - if it goes down we
are in big trouble.
Anyone grasp what we are getting at? :)
Are missing something, or have we really hit a brick wall here?
Thanks in advance,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20021004/970f7435/attachment.htm

More information about the jdom-interest mailing list