REXML - Change Log

# Change Log

#### 2.7.1

- 2.5.7: Fixed a bug in the new distribution mechanism.
- 2.5.6:
  - Fix for bug #36 (Stream parser and ISO-8859-1 accents). This was a generic bug in stream parsing and non-UTF8 encodings.
- 2.5.5:
  - Re-fixed bug #25; the previous fix was baaaaad.
- 2.5.4:
  - On request, changed the format of printed elements so that whitespace appears before the close of empty tags; EG, <tag/> -> <tag />
  - Improved parsing speed by a chunk
  - Bug #29: SAX2Parser was not processing XML declarations or processing instructions.
  - Bug #29: REXML pull parser and SAX2 parser both now report :processing_instruction, rather than :instruction. This is less consistent with REXML, which tends to be more minimal, but is more consistent with the SAX2 parser API. Let me know if you disagree with this decision before I go to 2.6.0.
  - Bug #30: In some cases, REXML would refuse to delete an attribute. This has been fixed.
  - Bug #31: Ignored element fix applied.
  - Fixed a whitespace parsing bug that resulted in some documents causing parse errors.
  - Fixed a tutorial error
  - Added Shift_JIS encoding. This is the same as Shift-JIS, but correct IANA registrated name is Shift_JIS. I've left Shift-JIS for backwards compatibility.
  - Fixed a non-conformance bug in XPath, WRT whitespace in predicates.
  - Changed the unit tests to use the new test/unit API.
- 2.5.3:
  - Bug #22: A bug in doctype output somehow made it past the unit tests. Well, not somehow. There just wasn't a test for it :-/. There is now.
  - Bug #23: Functions floor(), ceiling(), and round() were broken. Identified and fixed by Kou.
  - Bug #24: Function lang() was broken. Identified and fixed by Kou.
  - Bug #25: Duplicate prefixes declared with identical namespaces is required by XML to be an error. REXML was ignoring that. Fixed.
  - Bug #28: start_document, end_document weren't being generated for SAX2Listeners. Fixed.
- 2.5.2:
  - Applied a patch from Takashi that fixed a bug in the encoding code.
  - Applied patch (bug fix) and unit test from Kouhei WRT entity replacement.
  - Added another patch & unit test from Kouhei WRT the new ignore_whitespace_nodes
  - Applied another patch from Kouhei that fixes XPath's substring-before() and substring-after().
  - Figured out a fix for the buffer size problem, allowing REXML to pull from the input stream in arbitrary length strings. This improves the stream handling, for things like XML-RPC
  - Added some pinning to regexps, which should reduce, if not eliminate those rare 'hangs'.
  - Improved the pattern for matching elements, so that more malformed XML is caught, and with a small speed improvement, to boot!
- 2.5.1:
  - SJIS and EUS_JP encoded documents are now supported, and it is much, much easier to add support for additional encodings. ISHIKAWA 'pyon' YUICHIRO sent a patch that provides SJIS and EUS_JP encoding support. This code was instrumental in my decision to restructure the way REXML handles encodings. See the "Hacking Encoding" document for instructions on how to add encodings to REXML.
  - Numerous people alerted me to the fact that, once again, I've distributed REXML without upgrading the version number :-/. This has been fixed
  - Whitespace after XML decl, before root node, was incorrectly handled.
  - Added start_document and end_document to the SAX2 API; they were missing. Also sped up SAX parsing a lot in the case where only hooks are used, rather than listeners, with a SAX2 application. SAX2 with listeners is a little slower.
  - Fixed a bug in the mailing list, introduced by our migration to Gentoo on the server.
  - Fixed a bug in Functions::substring. (PR#13)
- 2.4.0:
  - Internal entities weren't being (recursively) expanded.
  - PullParser text() method now returns two arguments; normalized text, and unnormalized text. That means that users have access to the raw text, without entity replacement, and processed text, with entities replaced. Existing applications using PullParser don't need to be changed; the behavior is backwards compatible. I can't do it for SAX2 yet, because I don't know whether text should be passed to SAX2 listeners normalized or not.
  - Hannes Wyss noticed a bug involving whitespace before the root document element.
- 2.3.7: This is also the 2.4.0 FRC release.
  - REXML is now in the RPKG database, and is a Gentoo package as well.
  - The root node of an XML document is the document, not the document element. Make sense? Well, it's true. '/' of "<a/>" in XPath gives you the parent of 'a', which is a Document object, not 'a'. REXML's XPath has been correct in this for a while. However, REXML always gave that Document node a name: "UNDEFINED". This was not correct. Document::name and Document::expanded_name now return an empty string, which is more in line with the XPath spec.
  - Mike fixed up Functions::tr to handle Unicode better.
  - Fixed a bug in Functions::number.
  - Added some more good diffs from Mike, cleaning up some Ruby 1.7 warnings. Mike also pointed me to a regexp optimization and sent me the most awesome tea cozy -- pictures will be posted.
  - Changed the behaviour of XPath. Please notice this, because it is important. By popular demand, the XPath axe `attribute::` (and the shortcut `@`) now return an `Attribute` node, not the attribute value. This means that you have to specifically fetch the attribute value if that is what you want. Additionally, to do this without incurring a massive speed penalty, I had to change the behavior of `Attribute::to_s().` It now returns just the attribute value, not the key='value' attribute string. If you want that formatted string, you have to use `Attribute::to_string()`, which is a new method.
  - The distribution mechanism that I use to make releasing versions of REXML easy has been completely revamped, and now seems to have most of the bugs worked out. One of the hard drives on the server died, and we took the opportunity to install a new version of Linux; the sourcecode repository seems to have settled down, and jitterbug is back to working. Sorry for any inconveniences during the changeover.
  - Kouhei found a bug in XPath WRT processing instructions. I've fixed it.
  - Kouhei also found a bug in XPath numeric comparisons. Fixed.
- 2.3.6:
  - attribute::* and @* now works
  - If node()[@x] matched a non-Element node, XPath would throw an exception.
  - Upgraded the install.rb file; fixed a couple of bugs, added redirection and a --noop mode. This was for Portage support.
- 2.3.5:
  - Fixed a bug that caused text containing > to be split into two text nodes. This incurred a speed penalty, but I'll try to improve that later.
  - Added a bug tracking system.
  - Fixed a comment parsing bug.
  - Mike Stok fixed Functions#translate and cleaned up some cruft that slipped through in Functions#substring.
  - Fixed a bug in Element#prefixes, and fixed Attributes#prefixes to use DOCTYPE declared namespaces. Added DocType#attributes_of(Element).
  - Fixed a bug in writing Attlist declarations.
  - Added AttlistDecl#each; AttlistDecl now includes Enumerable
  - Fixed Functions#name and Functions#local_name; fixed unit test.
  - Fixed a bug re. functions w/in predicates in XPath
  - Fixes for Child#parent=()
  - Fixes and speed improvement for creating Text nodes
  - SAX2Parser bug fixes
  - Added dist.xml and an ant build file
  - Tom sent a new version of his pretty printer
  - Kouhei has a new version of his Japanese API documentation translation online
- 2.3.4: Fixed a bug in XPath that kept non-Element nodes from being returned from recursive paths. This had a side effect of speeding up XPath recursions. Fixed a bug in Document WRT text outside of the document. Added peek and unshift methods to the PullParser API. XPath methods now accept an array of nodes in addition to a single node. Fixed a bug in Functions::string(). Changed the unit tests to the Test::Unit platform. This allows the unit tests to be run under a GUI. More Function fixes (substring) by Mike Stok. There was a major bug in XPath handling of math operations, which is fixed. Strings pulled from IO streams are now tainted. Lots of bug fixes in PullParser -- it now passes 100% of the Oasis tests. Bug fix for stream parsing in Entity. Bug fixes in DocType -- SAX2Parser now passes 100% of Oasis tests. REXML now processes internal ATTLIST declarations in the doctype. This includes processing of XML namespaces in the doctype. Changed pretty printing. Whitespace is now never added around Text nodes, and there's a new context property, :ignore_whitespace_nodes. There's also a new transitive pretty printer, obtained by passing 'true' as the third argument to write().
- 2.3.3: Added an alternate pretty printer by Thomas Sawyer; it is in the contrib/ directory. Speed optimizations; REXML is noticably faster now. In particular, PullParser is now just as fast as Stream parsing (10x speed increase over first version). Fixed a bug in Element.add_namespace. Fixed a problem that occurred on some systems with Entities. News: Kouhei Sutou has done a Japanese translation of the REXML API docs. See the section in the main REXML page about the API documentation for links. Mike Stock fixed a bug in the starts_with XPath function. Added, on request, methods to Element to filter children on type. cdatas(), instructions(), comments(), and texts() now return immutable arrays of only those child nodes.
- 2.3.2: Added a (more or less) SAX2 conforming parser. Really, this and the pull parser are just a thin layer over the legacy REXML stream parser, and you'll get better results with the original API. The best thing about this (and the primary reason I did it this way) is that REXML maintains backward compatibility with the old Stream API. After I play with pure pull parsing some more, I may decide to reimplement stream parsing on top of pull parsing, but it shouldn't affect SAX2 in any way. The SAX2 parser is slower primarily because SAX2 requires the parser to do a lot more work -- resolving namespaces and so on -- so while I know I can improve the speed some, SAX2 will never be as fast as REXML vanilla stream parsing. That said, the SAX2 API is pretty nice, and includes all of those stream API changes I wanted to get in, except for filter parsing. Check out the tutorial for usage information.
- 2.3.1: Added a pull parser. This is VERY experimental, and the API is likely to change.
- 2.3.0: Internal entities are now handled10. Speed has been further improved for most operations, but especially for stream parsing, writing, and large document parsing.
- 2.2.1: Fixed a bug in benchmark/bench.rb that kept it from running. Added stand_alone?() to XMLDecl as an alias for the standalone accessor. Improvements to the streaming API; in particular, pulling data from non-closing streams doesn't require passing a block size of 1 to the IOSource class any longer; in fact, the block size is ignored. Added a user-supplied patch to fix the fact that not all of the DTD events were getting passed to the listener. Improved entity parsing. Better test suite; you can now pass `--help` to the main test suite to get a list of the new options, which include listing the available suites and listing methods in the suites, as well as instructions on how to run only certain suites or methods in suites.
- 2.1.3: Fixed broken links in documentation. Added new documentation layout; the old format -- everything on one page -- was getting a bit overwhelming. Added RSS for changelog. Bugfix for element cloning namespace loss. The Streaming API wasn't normalizing input strings; this has been fixed. Added support for deep cloning via Parent.deep_clone(). Fixed some streaming issues for SOAP4RUBY. In particular, text normalization is now also done for the Streaming API. '\r' handling is now correct, as per the XML spec, and entities are handled better. &#13; is now converted to '\r' internally, and then translated back to '\r' on output. All other numeric entities (&#nnn; and &#xnnn;) are now converted to unicode on input, but are only converted back to entities if they don't fit in the requested encoding.
- 2.1.2: Fixed a bug with reading ISO-8859-1 encoded documents, and Document now includes Output, which it always should have.
- 2.1.1: Forgot to add output.rb to the repository.
- 2.1.0: IO optimizations, and support for ISO-8859-1 output. Fixed up pretty-printing a little. Now, if pretty-printing is turned on, text nodes are stripped before printing. This, obviously, can mess up what you'd expect from :respect_whitespace, but pretty printing, by definition, must change your formatting. Updated the tutorial a bit. Please see the section on adding text for a warning, if you're using a non-UTF-8 compatable encoding. Changed behavior of `Element.attributes.each`. It now itterates over key, value pairs, rather than attributes. This was a feature request. Expanded the unit tests and subsequently fixed a number of obscure bugs. I'm distributing the API documentation seperately from the main distribution now, because the API docs constitute nearly 50% of the total distribution size. FIxed a bug in namespace handling in attributes. Completely updated the API documentation for Element, Element.Elements, and Element.Attributes; the rest of the classes to follow. I'm seriously contemplating removing the examples from the API documentation, because most of them are practically duplicates of the unit tests in `test/`.
- 2.0.4: 2.0 munged the encoding value in output. This is fixed. I left debugging turned on in XPath in 2.0.2 :-/
- 2.0.2: Added grouping '(...)' and preceding:: and following:: axis. This means that, aside from functional bugs, XPath should have no missing functionality bugs. Keep in mind that not all Functions are tested, though.
- 2.0.1: Added some unit tests, and fixed a namespace XPath bug WRT attribute default NS's. Unicode support was screwing up the upper end of ASCII support; chars between 0xF0 and 0xFD were getting munged. This has been fixed, at the cost of a small amount of speed. Optimized the descendant axes of XPath; it should be significantly faster for '//' and other descendant operations. Added several user contributed unit tests. Re-added QuickPath, the old, non-fully-XPath compliant, yet much faster, XPath processor. Everything is being converted to UTF8 now, and the XML declaration reflects this. See the bugs for more information.
- 2.0: True XPath support. Finally. XPath is fully implemented now, and passes all of the tests I can throw at it, including complex XPaths such as `'*[* and not(*/node()) and not(*[not(@style)]) and not(*/@style != */@style)]'`. It may be slower than it was, but it should be reasonably efficient for what it is doing. The XPath spec doesn't help, and thwarts most attempts at optimization. Please see the notes on XPath for more information. Oh, and some minor bugs were fixed in the XML parser.
- 1.2.8: Fixed a bug pointed out by Peter Verhage where the element names weren't being properly parsed if a namespace was involved.
- 1.2.7: Fixing problems with the 1.2.6 distribution :-/. Added an "applications using REXML" section in this document -- send me those links! Added rdoc documentation. I'm not using API2XML anymore. I think API2XML was the right model, generating XML rather than HTML (which is what rdoc does), but rdoc does a much better job at parsing Ruby source, and I really didn't want to go there in the first place. Also, I had forgotten to generate the Tutorial HTML.
- 1.2.6: Documentation fix (TR). Fixed a bug in Element.add (and, therefore, Element.add_element). Added Robert Feldt's terse xml constructor to contrib/ (check it out; it's handy). Tobias discovered a terrible bug, whereby ENTITY wasn't printing out a final '>'. After a long discussion with a couple of users, and some review of the XML spec, I decided to reverse the default handling of whitespace and pretty printing. REXML now no longer defaults to pretty printing, and preserves whitespace unless otherwise directed. Added provisional namespace support to XPath. XPath is going to require another rewrite.
- 1.2.5: Bug fixes: doctypes that had spaces between the closing ] and > generated errors. There was a small bug that caused too many newlines to be generated in some output. Eelis van der Weegen (what a great name!) pointed out one of the numerous API errors. Julian requested that add_attributes take both Hash (original) and array of arrays (as produced by StreamListener). I killed the mailing list, accidentally, and fixed it again. Fixed a bug in next_sibling, caused by a combination of mixing overriding <=>() and using Array.index().
- 1.2.4: Changes since 1.1b: 100% OASIS valid tests passed. UTF-8/16 support. Many bug fixes. to_a() added to Parent and Element.elements. Updated tutorial. Added variable IOSource buffer size, for stream parsing. delete() now fails silently rather than throwing an exception if it can't find the elemnt to delete. Added a patch to support REXMLBuilder. Reorganized file layout in distribution; added a repackaging program; added the logo.
- 1.1b: Changes since 1.1a: Stream parsing added. Bug fixes in entity parsing. New XPath implementation, fixing many bugs and making feature complete. Completed whitespace handling, adding much functionality and fixing several bugs. Added convenience methods for inserting elememnts. Improved error reporting. Fixed attribute content to correctly handle quotes and apostrophes. Added mechanisms for handling raw text. Cleaned up utility programs (profile.rb, comparison.rb, etc.). Improved speed a little. Brought REXML up to 98.9% OASIS valid source compliance.

10) Please note that entity handling complicates text manipulation. See the note in the tutorial