Ticket #81 (closed defect: fixed)
Strange XML serialization bug.
| Reported by: | aquasync | Owned by: | ser |
|---|---|---|---|
| Priority: | high | Milestone: | 3.1.7 |
| Component: | DOM | Version: | 3.1.3 |
| Severity: | critical | Keywords: | |
| Cc: | Ruby version: | 1.8.4 | |
| Operating system: | Windows |
Description (last modified by ser) (diff)
This is a pretty strange bug.
Essentially, when saving my xml out to a file, using the .to_s method of REXML::Document, I'm getting elements where the tag name includes the xpath index number (such as <table:table-row[2] .... />) (I'm processing some .odt files.)
I narrowed down the changes made to my code to make it work again. Disabling my call to .xpath (REXML::Element), caused it to no longer occur. That seemed odd, so I fiddled further, and eventually found that changing the line:
rv << "#{idx+1}" to rv += "#{idx+1}"
in rexml/element.rb _to_xpath_helper, made it work. Which defies my understanding, perhaps << is inplace, and is modifiying expanded_name?
Anyway, let me know if you want more info/explanation.
I'm using REXML 3.1.3, and have the same problem with ruby 1.8.4 mingw32, and cygwin.
