You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by dm...@apache.org on 2004/01/19 23:17:02 UTC

cvs commit: jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/xml JDOMParser.java XMLParser2.java

dmitri      2004/01/19 14:17:02

  Modified:    jxpath/src/java/org/apache/commons/jxpath/xml
                        JDOMParser.java XMLParser2.java
  Log:
  Changed the default from namespaceAware = false to namespaceAware = true
  
  Revision  Changes    Path
  1.7       +9 -19     jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/xml/JDOMParser.java
  
  Index: JDOMParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/xml/JDOMParser.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JDOMParser.java	19 Jan 2004 20:44:52 -0000	1.6
  +++ JDOMParser.java	19 Jan 2004 22:17:02 -0000	1.7
  @@ -74,31 +74,21 @@
    */
   public class JDOMParser extends XMLParser2 {
       
  -    /**
  -     * Temporary fix for JDOM problem - JDOM B9 does not properly handle
  -     * isNamespaceAware = false
  -     */
  -    public boolean isNamespaceAware() {
  -        return true;
  -    }
  -    
       public Object parseXML(InputStream stream) {
  +        if (!isNamespaceAware()) {
  +            throw new JXPathException("JDOM parser configuration error. JDOM "
  +                    + "does not support the namespaceAware=false setting.");
  +        }
  +        
           try {
               SAXBuilder builder = new SAXBuilder();
               builder.setExpandEntities(isExpandEntityReferences());
               builder.setIgnoringElementContentWhitespace(
                       isIgnoringElementContentWhitespace());
               builder.setValidation(isValidating());
  -            builder.setFeature(
  -                    "http://xml.org/sax/features/namespaces",
  -                    isNamespaceAware());
  -            builder.setFeature(
  -                    "http://xml.org/sax/features/namespace-prefixes",
  -                    false);
               return builder.build(stream);
           }
           catch (Exception ex) {
  -            ex.printStackTrace();
               throw new JXPathException("JDOM parser error", ex);
           }
       }
  
  
  
  1.2       +5 -5      jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/xml/XMLParser2.java
  
  Index: XMLParser2.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/xml/XMLParser2.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XMLParser2.java	18 Jan 2004 01:42:58 -0000	1.1
  +++ XMLParser2.java	19 Jan 2004 22:17:02 -0000	1.2
  @@ -73,7 +73,7 @@
   public abstract class XMLParser2 implements XMLParser 
   {
       private boolean validating = false;
  -    private boolean namespaceAware = false;
  +    private boolean namespaceAware = true;
       private boolean whitespace = false;
       private boolean expandEntityRef = true;
       private boolean ignoreComments = false;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org