commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: jakarta-commons-sandbox/xo/src/java/org/apache/commons/xo Mapper.java
Date Sat, 04 May 2002 16:00:37 GMT
dion        02/05/04 09:00:37

  Modified:    xo/src/java/org/apache/commons/xo Mapper.java
  Log:
  Allowed for DOM4J returning multitple child elements for a single logical text element
  
  Revision  Changes    Path
  1.2       +12 -2     jakarta-commons-sandbox/xo/src/java/org/apache/commons/xo/Mapper.java
  
  Index: Mapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/xo/src/java/org/apache/commons/xo/Mapper.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Mapper.java	16 Apr 2002 19:07:56 -0000	1.1
  +++ Mapper.java	4 May 2002 16:00:36 -0000	1.2
  @@ -142,7 +142,7 @@
    *
    * @author <a href="mailto:jvanzyl@zenplex.com">Jason van Zyl</a>
    * @author <a href="mailto:dlr@collab.net">Daniel Rall</a>
  - * @version $Id: Mapper.java,v 1.1 2002/04/16 19:07:56 jvanzyl Exp $
  + * @version $Id: Mapper.java,v 1.2 2002/05/04 16:00:36 dion Exp $
    */
   
   // How to use the resources package to pull in the
  @@ -438,7 +438,7 @@
                       // (3):   <city>Guelph</city>                +- (A)
                       // (4):   <country>Canada</country>          |
                       // (5): </address>                        ---+
  -                    if (hasChildren(node) && !containsCDATA(node))
  +                    if (!isTextOnly(node))
                       {
                           debug("Node " + node.getName() + " has children");
   
  @@ -654,6 +654,16 @@
       private boolean hasChildren(Node node)
       {
           return (((Element) node).nodeCount() > 1);
  +    }
  +
  +    /**
  +     * Does the node in question have only text?
  +     *
  +     * @param node The element to check for children.
  +     */
  +    private boolean isTextOnly(Node node)
  +    {
  +        return ((Element) node).isTextOnly();
       }
   
       /**
  
  
  

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


Mime
View raw message