Ticket #148 (new defect)

Opened 4 months ago

Last modified 4 months ago

Incorrectly replacing "
" with "
"

Reported by: jpmoody Owned by: ser
Priority: normal Milestone:
Component: DOM Version: 3.1.6
Severity: major Keywords: 
 

Cc: Ruby version: 1.8.6
Operating system: Windows

Description

I made a script that edits an XML file. This file contains instances of "
", which is a line break. When after reading/editing/writing the file, it incorrectly replaces the & with &

This is with Ruby version 1.8.6-25 (I'm not sure how to find the version of REXML, so the one set on this ticket may not be the right version).

Here's the code (where configFile is the full path to the XML file):

doc = nil

File.open(configFile, "r") do |file|

doc = REXML::Document.new(file)

end

File.open(configFile, "w") do |file|

doc.write(file)

end

Change History

Changed 4 months ago by candlerb

To determine the REXML version:

ruby -vrrexml/rexml -e 'p REXML::VERSION,PLATFORM'
Note: See TracTickets for help on using tickets.