db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattba...@apache.org
Subject cvs commit: jakarta-ojb/src/java/org/apache/ojb/broker/metadata RepositoryPersistor.java
Date Sat, 04 Jan 2003 00:52:34 GMT
mattbaird    2003/01/03 16:52:34

  Modified:    src/java/org/apache/ojb/broker/metadata
                        RepositoryPersistor.java
  Log:
  be careful when setting sax features.
  
  Revision  Changes    Path
  1.13      +13 -5     jakarta-ojb/src/java/org/apache/ojb/broker/metadata/RepositoryPersistor.java
  
  Index: RepositoryPersistor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/broker/metadata/RepositoryPersistor.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- RepositoryPersistor.java	3 Jan 2003 21:49:00 -0000	1.12
  +++ RepositoryPersistor.java	4 Jan 2003 00:52:34 -0000	1.13
  @@ -62,10 +62,7 @@
   import org.apache.ojb.broker.util.configuration.impl.OjbConfigurator;
   import org.apache.ojb.broker.util.logging.Logger;
   import org.apache.ojb.broker.util.logging.LoggerFactory;
  -import org.xml.sax.ContentHandler;
  -import org.xml.sax.SAXException;
  -import org.xml.sax.XMLReader;
  -import org.xml.sax.InputSource;
  +import org.xml.sax.*;
   
   import javax.xml.parsers.ParserConfigurationException;
   import javax.xml.parsers.SAXParser;
  @@ -258,7 +255,18 @@
           // get a xml reader instance:
           SAXParser p = SAXParserFactory.newInstance().newSAXParser();
           XMLReader reader = p.getXMLReader();
  -        reader.setFeature("http://xml.org/sax/features/validation", true);
  +        /**
  +         * MBAIRD: It's possible that the SAX implementation doesn't support this feature
  +         * so we try and catch the SAXNotSupportedException and just ignore it.
  +         */
  +		try
  +		{
  +	        reader.setFeature("http://xml.org/sax/features/validation", true);
  +		}
  +		catch (SAXNotSupportedException snse)
  +		{
  +			// ignore
  +		}
           Object result = null;
   
           if(DescriptorRepository.class.equals(targetRepository))
  
  
  

Mime
View raw message