Uploaded image for project: 'Xerces-C++'
  1. Xerces-C++
  2. XERCESC-1355

DOMBuilder parse wrong node type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • 2.6.0
    • None
    • DOM
    • None
    • Linux gcc 3.2 Redhat Linux 8.0 3.2-7

    Description

      Basically I wrote a simple code (similar to DOMCount) to printout the DOM tree content. I found out that all of the node type (node.getNodeType()) always return 3(which is ELEMENT_NODE) while it should sometimes return TEXT_NODE so I can obtain the value via node.getNodeValue(). As the result, I always get NULL.

      Not sure if related to this thing, before setFeature(...whitespace = true), the DOMTree has a lot of bogus TEXT_NODEs.

      ==================== OUTPUT LOG =========================
      Building CLI tree from data model ...
      Element: command-groups
      Attributes
      ----------
      id=_1
      name=bulk-input
      Rootnode has child: 1
      Element: help = (null) with type 1
      Element: command = (null) with type 1
      Attributes
      ----------
      id=_1
      name=show
      Element: command = (null) with type 1
      Attributes
      ----------
      id=_2
      name=start
      Node type == 1
      Element: help and value (null) at 0
      Node type == 3
      we done
      =============================================================
      Note that: help is a text node and expected to return some value.

      Here the sample of xml and dtd.

      Attachments

        1. testcase.zip
          6 kB
          Alberto Massari

        Activity

          People

            Unassigned Unassigned
            vnguyen Vu Nguyen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: