Version: 3.0.1 Release date: 29-Aug-2006 Description: The first patch for 3.0.0. Contains critical fixes to the stable branch, as reported by users. Problems fixed: * [WSTX-69] Incorrect types returned by XMLStreamReader, when notations/entities are requested. (report by Michael K) * [WSTX-72] Closing of output streams/writers in cases where that should not be done (plus similar problems on input side) (reported by Matt S) * [WSTX-74] Woodstox wasn't throwing NoSuchElementException at the end (reported by Lucian H) * [WSTX-77] Bug in DTDValidator.validateAttribute() passing wrong args to StringUtil.matches() (reported by Vim D R) == History: == 3.0.0 [07-Aug-2006] Problems fixed: * A NullPointerException with StartElement.getAttributeByName() (apparently only happening when creating Attributes via Event Factory) * [WSTX-64]: CompactNsContext.outputNamespaceDeclarations NPE. (reported by Wolfgang H) * Fixed a problem with XMLEventReader.nextTag(), when peek() was called to access StartDocument event first. (reported by Lucien H) * Fixed a minor non-conformance issue with StartDocument, was not defaulting version pseudo-attribute to '1.0' (returned null if no xml declaration, ie. same as what XMLStreamReader returns). * [WSTX-65]: Fixed multiple problems with repairing stream writer, and the handling of automatic namespace declarations. 3.0rc2 [21-Jul-2006] Problems fixed: * [WSTX-57]: (partial fix) getNamespaceURI(int) will now return "" for 'no namespace', instead of null. Value will thus be the exact lexival value from the declaration. * [WSTX-58]: a problem with DOMWrappingReader throwing an NPE, when accessing attribute properties of an element with only ns declarations. * [WSTX-59]: Stream writer trying to quote \r and \t in prolog/epilog. * [WSTX-60]: No pom file was generated for woodstox jar distributions; added generation, and dependencies to stax api jar generated by ref. impl. * [WSTX-61]: Using non-woodstox XMLStreamReader with the default event allocator fails. 3.0rc1 [08-Jun-2006] Problems fixed: * [WTSX-38], [WSTX-56]: Filtered event reader was not filtering events correctly. Now should work much better. * [WSTX-54]: Added method XMLStreamWriter2.getEncoding, which allows for accessing encoding of the underlying output stream/writer (if such info available to the stream writer). * [WSTX-55]: XMLStreamWriter.flush() is now once again side-effect free (rule of minimal surprise) Improvements: * More significant parsing speed improvements, related to white space and linefeed handling. * Significant optimizations on the output side: adding BufferedWriter increases output speed very significantly (i.e. non-buffering basic OutputStreamWriter was dead slow for almost all use cases). Also, added simple buffer recycling, similar to reader side. New features: * [WSTX-25]: Added Stax2 interface ValidationProblemHandler, and associated methods to XMLStreamReader2 and XMLStreamWriter2: this allows for custom validation error handling, overriding default logic. * [WSTX-52]: Added a set of basic Stax2Source and Stax2Result implementations: these allow for more efficient and accurate source/result identification, and possible later optimizations. 2.9.3 [26-Apr-2006] Improvements: * [WSTX-53]: Implemented a simple byte/char buffer recycling system, using ThreadLocal and SoftReferences. Improves parsing speed of small (<4kB or so) documents by 15-20%. * Minor improvements to UTF-8 decoding speed (decoding part maybe 5% faster). New features: * javax.xml.transform.dom.DOMSource can now be used for constructing stream and event readers, i.e. it is possible to traverse DOM documents (and document fragments, sub-trees for given Element) using Stax API. 2.9.2 [31-Mar-2006] Problems fixed: * [WSTX-45]: WstxEventReader#peek() throwing EOF instead of returning null (reported by Arjen P) * [WSTX-46]: Trying to write another root element produced an incorrect error message (reported by John K) * [WSTX-20], [WSTX-47]: XMLStreamWriter throwing IllegalStateExceptions instead of XMLStreamExcpetions. (reported by Dims, John K) Improvements: * Added some more necessary methods to Stax2 XMLStreamReader2, to allow adding custom validators. New functionality: * Implemented (pluggable) XMLValidator for RelaxNG, based on Sun Multi-Schema Validator! 2.9.1 [22-Feb-2006] Problems fixed: * Numerous fixes to XML conformance; especially in areas of: * Valid xml character (for xml 1.0 as well as 1.1) checks, including checks for expanded character entities. * XML 1.1 vs 1.0 handling (including proper cascading to the external parsed entities) * Distinction between Well-Formedness Constraints (WFC, fatal) and Validation Constraints (VC); latter only thrown in validating mode. * Input nesting checks for Parameter and General Entity expansions (elements and GE expansions have to nest properly; similarly PE and DTD declarations have to properly nest). * Woodstox now handles gracefully namespaces that are declared using default attribute declarations (as well as basic namespace declaration entries in DTDs -- while unnecessary, some legacy DTDs use these). Improvements: * Added UTF-32 reader since JDK does not come with one. 2.9 [22-Jan-2006] Problems fixed: * [WSTX-18]: XMLOutputWriter should default to UTF-8 if no encoding explictly passed (when constructing output writer). * [WSTX-37]: Need to be return auto-detected character encoding for input streams; not just encoding application passed in. * [WSTX-39] (partial fix): If namespace declarations were declared in DTD (to support legacy documents or processors), Woodstox would not recognized their special status, and could add default values for those as if they were regular attributes. Now such declarations will basically be ignored, which usually should work acceptably. * Fixed a problem with bootstrapping UTF-16 streams; if "UTF-16" explicitly specified as encoding, underlying JDK reader did not always use correct endianness. * Root element name is now only check in validating mode (not if only DTD aware but not validating), since this really is validation, not just part of DTD awareness. Improvements: * [WSTX-30] Non-validating-but-DTD-aware mode now works better: attribute type information as well as attribute default values will now work, so validation only needs to be enabled for actual validation features. 2.8.2 [31-Dec-2005] Problems fixed: * Changed behaviour of BasicStreamReader.isCharacters() to be identical to the ref. impl, ie. only to return true if the current event is CHARACTERS (but not if it's CDATA and SPACE). * [WSTX-14]: Added property XMLInputFactory2.P_AUTO_CLOSE_INPUT that can enable automatic closing for all input types (default is false). Also, added explict XMLStreamReader2.closeCompletely() method to force closing of all associated streams, indepent of auto-closing property. * [WSTX-17]: Fixed the problem with new stream reader methods, so that the underlying input stream does get properly closed independent of value of XMLInputFactory2.P_AUTO_CLOSE_INPUT, if the source is URL, File or javax.xml.transform.Source. * Fixes that will go to 2.0.5 (WSTX-28, WSTX-29) Improvements: * Related to fixing [WSTX-29] (NamespaceContext problems with StartElement event), added a simple reuse schema for NamespaceContext instances. For typical namespace using documents, this can improve Event API parsing performance by up to 15% based on throughput measurements. * [WSTX-15] Added XMLStreamReader2.getNonTransientNamespaceContext() method. 2.8.1 [20-Dec-2005] Problems fixed: * Various fixes from 2.0.4 release. Improvements: * Improved performance of handling of elements that do not have any attributes: results in up to 5% speed increase for documents that are element-heavy but attribute poor. New functionality: * Full validator support on writer side: the existing Woodstox DTD validator (constructed via XMLSchemaFactory() or gotten from a XMLStreamReader2 instance) can be plugged in to validate output. * Added initial code coverage testing support using Emma (right now, test cover about 50% of Woodstox code). Refactoring: * DTD validation completely rewritten, to use the next StAX2 validation interfaces; some minor problems fixed. 2.8 [11-Oct-2005] New functionality: * [WSTX-6] Added new alternate input parsing modes ("fragment mode", "multi-document mode"; existing one calle "single-document mode"): these allow for parsing document fragments (which miss containing root/parent elements), and parsing streams that have more than one complete document. Improvements: * Configuration: * [WSTX-13] Added setProperty() in reader/writer instances, to allow for overriding some settings on per-instance basis (not just on per-factory basis). * Stream/Event readers: * [WSTX-11] Event readers are now always constructed lazy parsing disabled (no performance gain from lazy parsing; more accurate error reporting when it is disabled), and with min. segment size set to maximum (ie. text/cdata segments are never split). * Stream/Event writers: * [WSTX-16] Added P_PROBLEM_REPORT property for writers, to allow for notification mechanisms for non-fatal (or potential) problems using standard mechanism. * Entity handling: * [WSTX-4] It is possible to define a specific handler for undeclared entities; this handler will get called in entity-replacing mode, and if it returns a valid expansion, no exception will be thrown. * [WSTX-5] Undeclared entities (missing DTD, or dtd-handling disabled) do not throw an exception in the non-entity-replacing mode any more. Calling app can figure out whether the entity reference refers to a declared entity by checking if expansion value is null (via Cursor API), or if the entity reference does not refer to a declaration (via Event API, a null declarationn object returned). * Validation: * [WSTX-12] It is now ok for a document to not have a DOCTYPE declaration in validating mode: if so, validation will essentially be skipped, and a warning is sent via XMLReport interface (if any). Note that this does not apply to empty DOCTYPE declaration (empty internal subset), just to one completely missing. 2.5 - 2.7 [19-Jul-2005 - 29-Sep-2005] New functionality: * Adding support for pluggable validation support; this is pre-requisite for output side validation, as well dtd-based indentation. Improvements: * Now input stream factory tries to use Woodstox-specific (fast) readers even when specific encoding is passed. This should improve UTF-8 document handling when encoding is explicitly passed along with input stream. * Improved handling of text parsing in IS_COALESCING mode: now parser is more likely to be able to use the shared buffer, leading to up to 10 - 15% faster parsing in this mode (depending on usage patterns and length of segments), without change to non-coalescing mode. 2.0.1 - 2.0.4: [10-Aug-2005 - xx-Dec-2005] Problems fixed: * Fixed a nasty encoding bug in (configurable) attribute writers: trying to write entities failed with a NullPointerException [reported by Ulrich C and Peter T] * Fixed a problem with DTDs that had enumerated value "-" (or "--"), was throwing an exception [reported by Ulrich C] * [WSTX-3] output of DTD event was missing a double quote. [reported by Linus E] * Fixed a problem with single-byte (ascii, ISO-Latin1) encoding writer; char-array methods could omit characters after encoded entities. * [WSTX-7] SimpleNsStreamWriter#writeStartElement(StartElement) was stripping out attribute namespaces. [reported by Linus E] * [WSTX-8] nextTag() followed by peek() at the start of a document won't work. Also, fixed associated NPEs in WstxEventReader class. [reported by Patrick C] * [WSTX-9] sr.getTextCharacters(int srcStart, ...) fixed; had a bug that caused ArrayIndexOutOfBoundsException, and null chars in result [reported by Dan D, Erik S and Kevin V] * [WSTX-10] Handling of 3-byte UTF-8 Byte Order Marker did not work properly when XMLStreamReader was constructed for a Reader [reported by Heinz D] * [WSTX-19]: Unnecessary default namespace declarations were written by stream writers in repairing mode. [reported by Heinz D] * Fixed DTD/attribute value normalization problem with NMTOKEN; was not catching a problem if the first non-space character of the value was not valid a valid NMTOKEN character. * [WSTX-24]: Predefined namespace with prefix 'xml' was not handled properly for elements, only for attributes. * [WSTX-27]: Attribute #FIXED default value was not added (just checked for explicit attributes), now it is used properly. 2.0rc1-rc3,2.0-final: [11-Apr-2005 - 20-Jun-2005] New functionality: * XMLStreamReader2.getText(Writer) now implemented in fully streaming manner for CHARACTERS and CDATA events (also tested succesfully using unit tests, so it does really work). * Improved text/attribute value writer system so that they now use character entities for characters outside of encoding range (for ascii and ISO-Latin, for example) * Moved profile configuration methods from woodstox API to StAX2 API. Problems fixed: * XMLStreamReader: * Fixed "]]>"-detection; was erroneously matching some escaped variations where they shouldn't have matched. * XMLStreamWriter: * Not necessarily a problem, but I change the way XML declaration is output so that it's identical to format used by Stax RI (using single quotes, no trailing extra space). Makes life easier for some general stax testing (particularly ActiveSOAP), without affecting applications. * Changed the way flush() works, so that it can now "finish" start elements (both normal and closed ones) and force such start elements to be written out, even in the absence of following events. This is sometimes necessary for networked streaming applications. * StAX2: * XMLOutputFactory2: * Added P_AUTOMATIC_EMPTY_ELEMENTS property, enabled by default, which signals that the writer is allowed to output empty elements whenever writeStartElement() is immediately followed by a writeEndElement() (except there can be intervening writeAttribute() calls). If disabled, only explicit calls to writeEmptyElement() can produce empty elements. * XMLStreamWriter2 had wrong ordering for arguments for the new writeStartDocument(). Stax 1.0 is inconsistent, but the ordering as fixed makes more sense since they are in document order now. * XMLStreamWriter.writeCData(char[], int, int) was missing; added to make it consistent with writeCharacters(char[], int, int). * XMLEventReader: * StartElement: namespace information had extraneous default namespace declarations. Also a small problem with StartElement.getPrefix() fixed: checks for masked namespaces wasn't properly working. Also, * XMLEventWriter: START_DOCUMENT outputting fixed; was not always outputting encoding. * XMLInputFactory: entity/dtd resolvers were not properly passed to instances. 1.9.0: [20-Apr-2005] New functionality: * XMLStreamReader: * Full read-only access to configuration settings via getProperty() * StAX2 addition, LocationInfo, implemented to allow for extended access to location information: both start, end and current locations available, and "raw" access to start/end byte and char offsets (with appropriate long return values). Off latter, only char offsets actually implemented, due to problems with byte offset tracking with current i/o architecture. * XMLStreamWriter: * Full read-only access to configuration settings via getProperty() Problems fixed: * XMLStreamReader: * Fixed various Location reporting problems (OBOs, Location not properly updated in lazy-parsing mode) * XMLStreamWriter: * Repairing mode was not properly handling namespace bindings, esp. WRT default namespace. Now the implementation is believed to (finally!) work exactly as expected. * A compilation problem (on JDK 1.5) reported by Olivier Potonniee (a method name conflict in LineSuppressWriter) 1.8.2: [23-Mar-2005] Problems fixed: * XMLStreamWriter: * Had problems with writeEmptyElement() call followed by a writeEndElement() call; fixed now. * Problems with charset decoding: * Failed with UTF-16 encodings (reported by Mariun Raschip); now fixed. 1.8.1: [10-Mar-2005] Problems fixed: * Fixed 3 bugs reported by Eric Jain: * Bug that occured when declaring the default namespace in the same element as a non-default namespace (but only when the default one wasn't the first one) * ArrayIndexOutOfBoundsException sometimes occured with large documents, esp. if read using a network or gzip stream readers. * Problem with the repairing stream writer when generating the namespace declaration for elements dynamically; was trying to output bindings twice. * Fixes for XMLStreamWriter: * a minor incompatibility with the stax 1.0 specs: XMLStreamWriter.writeStartDocument() was not using default values defined by the specs. * writeComment() was quoting content ('<' and '&' specifically); shouldn't. 1.8: [28-Feb-2005] New functionality: * Implemented "StAX 2" interface; extended versions of many of StAX 1.0 interfaces and abstract classes. Improvements are in following areas: * Access to formerly missing information (DTDInfo, AttributeInfo, XMLStreamLocation2, new methods to XMLStreamReader) * Efficient (fully streaming) access to textual event content: XMLStreamReader2.getText() passing a writer, pass-through XMLStreamWriter2.copyEventFromReader() for copying events as read (more efficient than explicit piece-by-piece copying), XMLStreamReader2.skipElement() for skipping whole sub-trees. * Configurable output using XMLStreamWriter2: all XMLEvents can be output using specified XMLStreamWriter2 instance; can define custom text content and attribute value quoters (to quote/encode additional characters in output); raw output methods for by-passing all quoting and structural checks. * Basic support for per-instance (XMLStreamReader2, XMLStreamWriter2) configuration (only few features defined so far). Problems fixed: * Stream reader now correctly accesses attribute type information, when validating against DTD (passes matching staxtest test case). * Source package now contains jars absolutely needed for compilation. * Fixed a problem with UTF-8 reader; occasionally tried to read 0 bytes from the underlying stream, and threw an exception. 1.7: [12-Dec-2004] New functionality: * Added P_OUTPUT_CDATA_AS_TEXT for stream writers; it will force writer to output 'normal' (quoted) text when asked to output CDATA (may be useful when full control of output is needed). * Added P_PRESERVE_LOCATION flag for (event) reader: by default it is true, and Event objects have fully accurate Location information. Turning it off will make all Events use a shared location; this can improve performance of straight event-based parsing by up to 20-25%! * Added simple QName caching/recycling in input element stack; improves speed of event reader by ~5% for typical cases. * Adding some preliminary support for DTD++ (although full support is not planned to be part of 2.0 at this point): * Can enable/disable support via normal property set mechanism * Implements TARGETNS that allows proper mapping of prefixes to namespace URIs in DTD. Problems fixed: * Fixed a validation problem (pure text [#PCDATA] content didn't report validation problem when elements included) * Stream writer was adding an extra space between PI target and data, in cases where data already had space (such as when getting PI data from [broken] stream reader). * As pointed out by Glenn Marcy, processing instruction target should not contain leading space: Woodstox fixed, StAX specs need to clarify this too. * Fixed a small problem with attribute parsing; space between attribute value and following name was optional. * Finished full default value validation support (mostly relevant for NOTATION, ENTITY and ENTITIES types). * Improved event writer so that it preserves CDATA events. * Fixed a problem with UTF-8 decoder that could cause readers to block "too early", as decoder was trying to always read full buffers, instead of returning whatever could be decoded without further reads from the underlying input stream (reported by Sven Köhler). * Changed XMLEventReader.nextTag() implementation to be consistent with that of XMLStreamReader.nextTag(), even though stax (1.0) specs are bit unclear on exact behaviour. I assume it's just an oversight on specs' part, as XMLStreamReader's javadocs comments are clear. Refactoring: * Rewrote stream writer; now has 3 implementations (separated single namespace-aware writer into 2; repairing and non-repairing) Other: * Now dual-licensed under LGPL and ASL (formerly LGPL-only) 1.6: [31-Oct-2004] New functionality: * Completed DTD validation, including full handling of all attribute value types (for default values too); also better tested via StaxTest now. Problems fixed: * Fixes from 1.0.1 incorporated. 1.5: [13-Oct-2004] New functionality: * Partial DTD validation: * Full structural validation (element structure) * Full checks for definitions of attributes and elements * Handles mixed/non-mixed content checks * Partial attribute validation, including: * Checks for #REQUIRED and #FIXED values * Handles default values * Checks for ID/IDREF validity * Checks for enumerated and NOTATION validity * Normalizes attribute white space Still missing validation for some attribute types; also, not all validation fully tested yet. Problems fixed: * Now checks "split" comments and PIs; comments/PIs that start in entity expansion but do not finish. These aren't allowed by XML specs. Refactoring: * Created specific exception class (that extends RuntimeException) for throwing "lazy" parsing errors; allows for catching such exceptions reliably if necessary. * Refactored class hierarchy; flattened it so that not most sub-packages are no longer under com.ctc.wstx.stax, but directly under com.ctc.wstx. * Only change to public API: event factory is now in package com.ctc.wstx.stax.WstxEventFactory, instead of com.ctc.wstx.stax.evt.WstxEventFactory. This shouldn't usually matter, as deployment properties were updated. 1.0.1: [23-Oct-2004] Problems fixed: * UTF-8 decoding failed for 3- (and 4-) byte characters (1 and 2 byte decoding was working ok, ie. Ascii and ISO-Latin weren't affected) * Stream reader had getEncoding() and getCharacterEncodingScheme() mixed up. * Stream reader's nextTag() was not properly skipping comments and processing instructions. 1.0-RCx - 1.0-final: [28-Aug-2004 - 11-Oct-2004] Problems fixed: * A problem with reading CDATA section that could lead to infinite loop fixed. * Changed default setting of CHECK_NS for output factory to false, to be closer to what StAX API expects * Pre-defined entities in general internal entities were not properly handled; were expanded when reading the entity definition, which is incorrect (this was a regression bug somewhere before 1.0-RC series) * WstxEventFactory.createAttribute() didn't properly pass prefix. * Fixed a problem in default entity value parsing (ClassCastException). * Problem with stream writer (required WriteNamespace in namespace-repairing mode), now fixed. * XMLStreamReader.getElementText() didn't behave as specified by StAX specs, for empty elements (was throwing an exception; should return empty String). * Fixed problem of default "xml" namespace prefix not being recognized by the stream writer. * NullPointerException in event reader: was clearing out peeked event, but then trying to de-reference it (instead of temp variable that had that value copied from peeked event). * There was a bug in accessing local name of an attribute by index in non-namespace mode. * Another attribute name resolution bug; occured when there were lots of spills in the internal attribute map structure, array index exception was thrown (specific case with 11 attributes was found and reported by a user) * A subtle bug in entity handling; if an entity starts a segment, but expanded to content not starting with text, a "ghost" text segment with length 0 was returned. * Problem with stream writer (required WriteNamespace in namespace-repairing mode), now fixed. * A problem with reading CDATA section that could lead to infinite loop fixed. * Changed default setting of CHECK_NS for output factory to false, to be closer to what StAX API expects Refactoring: * Rewrote output factory code to use WriterConfig objects, just like input factories have done. * Made parsing somewhat "less lazy" in lazy mode; now reads in the "cheap" parts right away, in the hopes this may read the whole (text) segments, and also allows for slightly better error reporting. This also simplified entity handling a bit, as text segments that begin with an entity are now handled more reliably.