[jdom-interest] Mechanics of JDOM

Per Norrman per.norrman at austers.se
Mon Dec 20 14:16:15 PST 2004


Anand, Rajesh wrote:
>         Folks,
> 
>         Not clear from jdom.org website as to how does the JDOM 
> validation works.
> 
>         On the website, it talks about how to set parameters when 
> validating an instance of XML against a schema.
> 
>         I am curious to learn the internal mechanism of how validation 
> works.
>
As this FAQ, http://jdom.org/docs/faq.html#a0360, states, JDOM does not
perform the validation itself, but delegates that task to the underlying
XML parser.


>         These are some of the questions that puzzles me.
> 
>         1.      When you specify namespace location, does JDOM actually 
> obtains the schema from this location and if yes then where does it 
> saves a copy when
> 
>                 validating the actual schema?
> 

Not JDOM, but the XML parser certainly obtains the schema from the URL 
specified. It is possible that e.g. Xerces caches the schema, but I
don't think so.

>         2.      What if your system has no access to the website 
> specified, does JDOM returns errors relating to this?

Yes, you'll get some kind of IOException relating to the unaccessability
of the reource.

However, one point of being able to set schema location parameters
decoupled from the document being validated, is to remove the
dependency of external resources (websites etc).

/pmn


More information about the jdom-interest mailing list