[Issue 15] New - Parsing of escaped characters is not normalized.

View: New views
3 Messages — Rating Filter:   Alert me  

[Issue 15] New - Parsing of escaped characters is not normalized.

by zugarekd :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://fi.dev.java.net/issues/show_bug.cgi?id=15
                 Issue #|15
                 Summary|Parsing of escaped characters is not normalized.
               Component|fi
                 Version|current
                Platform|All
              OS/Version|All
                     URL|
                  Status|NEW
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P3
            Subcomponent|core
             Assigned to|issues@fi
             Reported by|zugarekd






------- Additional comments from zugarekd@... Wed Jul 25 15:57:27 +0000 2007 -------
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();
}

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@...
For additional commands, e-mail: issues-help@...


[Issue 15] Parsing of escaped characters is not normalized.

by oleksiys :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://fi.dev.java.net/issues/show_bug.cgi?id=15



User oleksiys changed the following:

                What    |Old value                 |New value
================================================================================
                Priority|P3                        |P4
--------------------------------------------------------------------------------




------- Additional comments from oleksiys@... Wed Jul 25 17:20:27 +0000 2007 -------
Need more time for investigation.
Downgrade bug to P4, as it's possible to get element's content by concatenating
children node values.

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@...
For additional commands, e-mail: issues-help@...


[Issue 15] Parsing of escaped characters is not normalized.

by oleksiys :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://fi.dev.java.net/issues/show_bug.cgi?id=15



User oleksiys changed the following:

                What    |Old value                 |New value
================================================================================
                  Status|NEW                       |RESOLVED
--------------------------------------------------------------------------------
              Resolution|                          |FIXED
--------------------------------------------------------------------------------




------- Additional comments from oleksiys@... Wed Aug  8 21:32:39 +0000 2007 -------
fixed
testcase, proposed by reporter works.



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@...
For additional commands, e-mail: issues-help@...

LightInTheBox - Buy quality products at wholesale price