Ticket #147 (new defect)

Opened 3 months ago

Last modified 3 months ago

quoting bug

Reported by: patrick Owned by: ser
Priority: normal Milestone:
Component: DOM Version: 3.1.6
Severity: normal Keywords:
Cc: Ruby version: 1.8.5
Operating system: Linux

Description

when reading an xml file containing escaped characters in node attributes (e.g. <entry name="&quotblah&quot" />) and not touching these attributes before saving the document again the quotes get quoted again (e.g. <entry name="&amp;quotblah&amp;quot" />).

Here is a little program which demonstrates that.

Attachments

test.xml (13 bytes) - added by patrick 3 months ago.
run init once, and resave several times
xml_test.rb (0.8 kB) - added by patrick 3 months ago.
run init once and resave several time

Change History

Changed 3 months ago by patrick

run init once, and resave several times

Changed 3 months ago by patrick

run init once and resave several time

Changed 3 months ago by patrick

Here is a workaround (apply this function to the root node before saving):

def touch_all_attributes( node )

node.attributes.each do |name, value|

node.attributes[name] = value

end node.elements.each do |el|

touch_all_attributes( el )

end

end

Note: See TracTickets for help on using tickets.