fi
  1. fi
  2. FI-15

Parsing of escaped characters is not normalized.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: current
    • Fix Version/s: current
    • Component/s: core
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      15

      Description

      When an element's content consists of escaped characters the resulting DOM
      contains multiple text nodes. Based on the DOM specifications, the first
      available DOM should only contain one text node. The attached sample code
      outputs a single character '<'.

      The document object model specification states, "If there is no markup inside an
      element's content, the text is contained in a single object implementing the
      Text interface that is the only child of the element."

      try {
      String t1 = "<RAW_DATA_STRING><ACCOUNTS><ACCOUNT></RAW_DATA_STRING>";
      //String t1 = "<RAW_DATA_STRING>1234 1234</RAW_DATA_STRING>";

      XML_SAX_FI fi = new XML_SAX_FI();
      byte b[] = t1.getBytes();
      ByteArrayInputStream is = new ByteArrayInputStream(b);
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      fi.parse(is, os);

      DOMDocumentParser d1 = new DOMDocumentParser();
      Document d2 =
      DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();

      ByteArrayInputStream d3 = new ByteArrayInputStream(os.toByteArray());
      d1.parse(d2, d3);

      System.out.println(d2.getDocumentElement().getFirstChild().getNodeValue());
      } catch (Exception e) {
      e.printStackTrace();
      }

        Activity

        Hide
        oleksiys added a comment -

        Need more time for investigation.
        Downgrade bug to P4, as it's possible to get element's content by concatenating
        children node values.

        Show
        oleksiys added a comment - Need more time for investigation. Downgrade bug to P4, as it's possible to get element's content by concatenating children node values.
        Hide
        oleksiys added a comment -

        fixed
        testcase, proposed by reporter works.

        Show
        oleksiys added a comment - fixed testcase, proposed by reporter works.

          People

          • Assignee:
            fi-issues
            Reporter:
            zugarekd
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: