[jboss-dev-forums] [Design of JBossXB] - JBXB-101, disabling validation

scott.stark@jboss.org do-not-reply at jboss.com
Wed Apr 4 16:16:57 EDT 2007


I cannot disable validation against a document dtd currently for use with the ObjectModelFactory/Unmarshaller apis. The Unmarshaller.setValidation(boolean) call has no affect.

The problem would seem to be this static initialization of the parser factory and setting the validating flag to true:


  | public class SaxJBossXBParser
  |    implements JBossXBParser
  | {
  |    private static final Logger log = Logger.getLogger(SaxJBossXBParser.class);
  | 
  |    private static final SAXParserFactory saxFactory = SAXParserFactory.newInstance();
  |    static
  |    {
  |       saxFactory.setValidating(true);
  |       saxFactory.setNamespaceAware(true);
  |       enableXInclude();
  |    }
  | 

The Unmarshaller.setValidation(boolean) call maps to setting a feature of the parser. I'm not sure why this is not getting picked up on the resulting parser.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034771#4034771

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4034771



More information about the jboss-dev-forums mailing list