You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2005/06/20 00:02:49 UTC

cvs commit: xml-xerces/java/docs features.xml

mrglavas    2005/06/19 15:02:49

  Modified:    java/docs features.xml
  Log:
  JAXP 1.3 added a setFeature method to DocumentBuilderFactory.
  Document this method as the preferred way for setting features
  on a DocumentBuilderFactory.
  
  Revision  Changes    Path
  1.48      +5 -7      xml-xerces/java/docs/features.xml
  
  Index: features.xml
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/docs/features.xml,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- features.xml	18 Apr 2005 03:57:44 -0000	1.47
  +++ features.xml	19 Jun 2005 22:02:49 -0000	1.48
  @@ -25,10 +25,8 @@
     </p>
     <p>
      The DocumentBuilderFactory interface contains a 
  -   <code>setAttribute(String,Object)</code> method which <em>may</em>
  -   provide a means to set features on the underlying parser. When using
  -   Xerces, to set a feature you specify an instance of
  -   <code>java.lang.Boolean</code> as the value of the attribute.
  +   <code>setFeature(String,boolean)</code> method which 
  +   can be used to set features on the underlying parser.
      For example:
     </p>
     <source>import javax.xml.parsers.DocumentBuilderFactory;
  @@ -36,10 +34,10 @@
     
   DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
   try {
  -    dbf.setAttribute("http://apache.org/xml/features/allow-java-encodings", 
  -                     Boolean.TRUE);
  +    dbf.setFeature("http://apache.org/xml/features/allow-java-encodings", 
  +                   true);
   } 
  -catch (IllegalArgumentException e) {
  +catch (ParserConfigurationException e) {
       System.err.println("could not set parser feature");
   }</source>
     <p>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org