[jdom-interest] Specify a XML schema in a Jdom document

Laurent Bihanic laurent.bihanic at atosorigin.com
Mon Nov 24 02:30:15 PST 2003


Cédric Pélissier wrote:
> Is it possible to specify a xml schema when building a Jdom document ... as
> following
>       Code:
>       <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:noNamespaceSchemaLocation="schema.xsd">
>       .....
> 
> There is a way to specify dtd but schema ??

Rather than modifying the document, you should specify which schema(s) to 
apply when configuring the parser.

You can do this by using either some parser-specific SAX properties and 
features (see http://xml.apache.org/xerces2-j/properties.html) or the new JAXP 
1.2 standard schema validation properties (JDOM beta 9 and Xerces 2.4.0 or 
higher).

Laurent




More information about the jdom-interest mailing list