Peet, parser.setFeature("http://xml.org/sax/features/validation";, true);
always worked for me.  You might try it with only that feature turned on...
sometimes I found the different features interact with each other, to a
negative effect.

-scott




                                                                                
                                   
                    "Peet                                                       
                                   
                    Sneekes"             To:     "Xalan Mailgroup" 
<[email protected]>, "Xerces Mailgroup"  
                    <[EMAIL PROTECTED]        <[EMAIL PROTECTED]>               
                                
                    tic.nl>              cc:     (bcc: Scott Boag/CAM/Lotus)    
                                   
                                         Subject:     again just 2B sure (XML 
Validation)                          
                    05/03/2000                                                  
                                   
                    09:28 AM                                                    
                                   
                    Please                                                      
                                   
                    respond to                                                  
                                   
                    xerces-dev                                                  
                                   
                                                                                
                                   
                                                                                
                                   



Hi, how do I get the DOMParser to validate my XML's realy strict.
There seems no validation going on at all.

Thanks in advance . . .

Peet Sneekes,
Mediamatic IP,
Amsterdam, NL

This is my Java:
.....
    parser.setFeature("http://xml.org/sax/features/validation";, true);
    parser.setValidating(true);

parser.setFeature("
http://apache.org/xml/features/validation/warn-on-duplica
te-attdef", true);

parser.setFeature("
http://apache.org/xml/features/validation/warn-on-undecla
red-elemdef", true);
    parser.setFeature("http://xml.org/sax/features/namespaces";, true);
     }

parser.setFeature("http://xml.org/sax/features/external-general-entities";,
true);

parser.setFeature("http://xml.org/sax/features/external-parameter-entities
",
true);

parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion
",
false);

parser.setProperty("
http://apache.org/xml/properties/dom/document-class-name
","org.apache.xerces.dom.DocumentImpl");

parser.setFeature("
http://apache.org/xml/features/dom/create-entity-ref-node
s", false);
......

and this is the XML:
<?xml version="1.0"?>
<!DOCTYPE screen [
<!ENTITY % screen-dtd SYSTEM "/resources/dtd/screen.dtd">
%screen-dtd;
]>
<screen site-component="jij" index="true" bgcolor="#ff9900"
background="back-o.jpg">
 <title>About you</title>
 <settings>
  <preload>


Peet Sneekes,
Mediamatic IP,
Amsterdam, NL





Reply via email to