Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4353811

com.sun.xml.tree.XmlDocumentBuilder.ignoringLexicalInfo problem

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • 1.1
    • 1.3.0
    • xml
    • 1.1ea2
    • generic
    • generic
    • Verified



      Name: skT45625 Date: 07/17/2000


      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Server VM (build 2.0fcs-E, mixed mode)


      The method com.sun.xml.tree.XmlDocumentBuilder.getIgnoringLexicalInfo
        states that the default is true -- that comments, CDATA, and ignorable
      whitespace are not included in the DOM Document that will be created by
      the parser.

      However, looking through the code, the default value is actually false:

      XmlDocumentBuilder.java, line 117:

          private boolean ignoringLexicalInfo = false;

      Can this be fixed in the next release?

      In addition, with the current javax.xml.parsers.DocumentBuilderFactory
      interface, there is no way to set what is arguably a very important flag. Even
      if the above mentioned bug is fixed, I still believe a couple of API methods
      should be added to the class javax.xml.parsers.DocumentBuilderFactory:

      DocumentBuilderFactory.setIncludeIgnorableWhiteSpace( boolean include );
      DocumentBuilderFactory.setIncludeComments( boolean include );
      DocumentBuilderFactory.setIncludeCDATASections( boolean include );

      with default values of "false". This would help greatly with the
      interoperability of other parsers using the JAXP interface classes. As
      an example, the current version of the Xerces parser makes the same error above
      (including ignorable whitespace be default). The only was to change the
      behavior of the Xerces parser (which is also true with the Sun parser) is to
      access the parser class directly rather than through the JAXP interfaces. This
      seems to go against the obvious purpose of the JAXP classes, which is to
      insulate the application developer from these concerns.

      Sincerely,
      Kevin Regan
      ###@###.###
      (Review ID: 107242)
      ======================================================================

            egoei Edwin Goei (Inactive)
            skondamasunw Suresh Kondamareddy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: