History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-3773
Type: Bug Bug
Status: Closed Closed
Resolution: Cannot Reproduce
Priority: P1 P1
Assignee: Unassigned
Reporter: Adam Wolff
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

Newlines not escaped in attribute values

Created: 23/Mar/07 05:08 AM   Updated: 17/Jul/07 11:19 AM
Component/s: LFC - Data
Affects Version/s: 3.4.1, 4.0.2
Fix Version/s: Legals, 4.0.3

Time Tracking:
Not Specified

Severity: Minor
Fixed in Change#: 4,462
Fixed in branch: branches/4.0
Runtime: N/A
Fix in hand: True


 Description  « Hide
Newlines are not currently escaped in XML serialization.

The W3C sez that this is not a "canonical form":
http://www.w3.org/TR/1999/WD-xml-c14n-19991109.html#charescaping

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Sarah Allen - 26/Apr/07 03:22 PM
Fixed with change to OL trunk, svn revision 4462

Sarah Allen - 26/Apr/07 03:24 PM
Release Notes:
XML serialization has been updated to escape newlines in attribute values.
                                                                                
Details:
W3 character escaping says that the canonical form of CR uses an escape code.
Server code that we're writing appears to support this.
http://www.w3.org/TR/1999/WD-xml-c14n-19991109.html#charescaping

NB that the linefeed or carriage return would be a reasonable
choice here, but I went with carriage return since that best
matches the definition of Javascript charCode 13.

Sarah Allen - 26/Apr/07 04:50 PM
re-opening: as we discussed, we should probably escape LF and maybe TAB

Mamye Kratt - 06/Jun/07 01:43 PM
Frisco to investigate.

Frisco Del Rosario - 06/Jun/07 05:48 PM
Ran the following in 3.4 and 4.0.2:

<canvas debug="true">
<simplelayout axis="y"/>

<dataset name="myData">
    <myXML>
        <name>Homer
        Jay
        Simpson
      </name>
    </myXML>
</dataset>
  
<text id="foo" datapath="myData:/myXML/name/text()"/>

<script>
Debug.write(foo.datapath);
</script>

</canvas>

The result of 3.4 shows that CR is escaped, but LF is not:
«LzDatapath#0| <name>Homer&#xD;\n Jay&#xD;\n Simpson&#xD;\n </name>»

The result of 4.0.2 shows that neither is escaped:
<name>Homer\r\n Jay\r\n Simpson\r\n </name>

P T Withington - 12/Jul/07 03:17 AM
I can't reproduce this in Legal's or 4.0.3. 3.4.x is closed.

Mamye Kratt - 17/Jul/07 11:19 AM
Close in 4.0.3 and legals.