[jdom-interest] Re: Validation using schema

Jamil Modak jmodak at digiterrabroadband.com
Wed Mar 5 09:42:47 PST 2003


After digging furhter into the archives I found the solution. Thanks. I
could eihter use a predefined file path or a url and both worked.
 
Sorry to clutter the mailing list. 
 
Document doc = new Document();
 
        Element rootElem = new Element("message");
        Namespace xsiNS = Namespace.getNamespace("xsi",
"http://www.w3.org/2001/XMLSchema-instance");
        rootElem.addNamespaceDeclaration(xsiNS);
 
                rootElem.setAttribute(new
org.jdom.Attribute("noNamespaceSchemaLocation",
"http://localhost:8080/xml/provider/Msg111/Msg111.xsd", xsiNS));
        //rootElem.setAttribute(new
org.jdom.Attribute("noNamespaceSchemaLocation",
"c:/projects/compass/apache/xml/provider/Msg111/Msg111.xsd", xsiNS));
 
     
        doc.setRootElement(rootElem);
        rootElem.addContent(new Element("header"));
        rootElem.addContent(new Element("content"));
......
 
Jamil I Modak
Sr. Software Engineer
 <http://www.digiterrabroadband.com/> DigiTerra Broadband
jmodak at digiterrabroadband.com <mailto:jmodak at digiterrabroadband.com> 
Off: 720.529.1143 x175
Fax: 720.529.5430

CONFIDENTIALITY NOTICE: The materials in this electronic mail transmission
(including all attachments) are private and confidential and are the
property of the sender. The information contained in the material is
privileged and is intended only for the use of the named addressee(s). If
you are not the intended addressee, be advised that any unauthorized
disclosure, copying, distribution or the taking of any action in reliance on
the contents of this material is strictly prohibited. If you have received
this electronic mail transmission in error, please immediately notify the
sender by telephone at 720.529.1143 x175 or send an electronic message to
jmodak at digiterrabroadband.com <mailto:jmodak at digiterrabroadband.com> , and
thereafter, destroy it immediately. Thank you. 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20030305/dcc6ddc2/attachment.htm


More information about the jdom-interest mailing list