Also see the XMLC 2.2 Release Note, XMLC 2.2.1 Release Note, XMLC 2.2.2 Release Note, XMLC 2.2.3 Release Note, XMLC 2.2.4 Release Note, XMLC 2.2.5 Release Note, XMLC 2.2.6 Release Note, XMLC 2.2.7.1 Release Note, XMLC 2.2.8.1 Release Note, XMLC 2.2.9 Release Note, XMLC 2.2.10 Release Note, XMLC 2.2.11 Release Note, XMLC 2.2.12 Release Note, XMLC 2.2.13 Release Note, XMLC 2.2.14 Release Note, XMLC 2.2.15 Release Note, and XMLC 2.2.16 Release Note.
XmlReader
, originally from the Rome project, synched with latest version
XMLC uses a modified version of the XmlReader
from the Rome project. Synched with changes through Rome version 1.18; corrects various bugs in XML encoding detection. Modfied InputDocument
to account for XMLReader
changes.
Previously, only the count of XML parser errors were reported in XMLCException
s thrown by org.enhydra.xml.xmlc.compiler.Parse.parse(MetaData)
. Now, at runtime, in addition to the count, each specific error is listed (one per/line) including the file path, the line number, and the error message from the parser. At compile-time, only the count is provided in the XMLCException
, but the errors are printed to System.err
, as always.
Replaced use of standard org.xml.sax.InputSource
with org.enhydra.xml.io.ClosingInputSource
, which wraps streams and readers in private, respective, implementations that make sure they get closed after they've been fully read. Also using file.lastModified()
instead of url.openConnection().getLastModified()
when dealing with file:
URL's to avoid needing to load the whole file as an InputSream
, which is required in order to call stream.close()
which removes the lock on the file by URLConnection
.
This is of major benefit to those utilizing XMLCContext
"xmlcReparseResourceDirs"
functionality for streamlined development of XMLC markup files in a webapp. Just edit in place, refresh, view changes, repeat! Previously, one couldn't edit in place (at least not on Windows) because the files were locked by streams left open after the first load. The workaround was to overwrite the active file with an edited copy from from another location (why Windows allows this when the file is locked and not editing in place, I have no idea?). While that worked, it was awefully inconvenient and container application reloading unfriendly. No worries now!
org.enhydra.xml.io.ClosingInputSource
to respect InputStream/Reader contract by allowing read() methods to return -1 more than once.
Related to making XMLC more application reload friendly, modified org.enhydra.xml.io.ClosingInputSource
to avoid "java.io.IOException: Stream closed" and respect InputStream/Reader contract by allowing read() methods to return -1 more than once. Track the closed state and return -1 when in said state. Works around issue where a parser reaches EOF multiple times. Changes contributed by Marc Guillemot from the NekoHTML list.
-get-tag-return-type
and -docformat
Added said options to gain parity with XML formatted XMLC medatadata files. Here's sample usage...
#xml, html, or unspecified -docformat xml #Element, HTMLElement, or fully qualified dom type implementing org.w3c.dom.Element #Note: declaring -create-get-tag-methods is unnecessary when using -get-tag-return-type -get-tag-return-type org.enhydra.xml.xhtml.dom.XHTMLElement
Runtime-based Dynamic Loading previously only accepted XML-formatted metadata files and threw exceptions if it found command-line-based options.xmlc files. Command-line-based options files are both less verbose and combineable with other command-line-based options files (only one XML metadata file is loadable at one time, and is really meant more as a generated end storage format than a user-editable configuration format). This allows for using options.xmlc to define defaults and individual per/markup file options files to define things like "-implements SomeInterface" or "-generate interface" for use in compiled classes. At compile-time, XMLC generates per/markup file XML metadata files based on the combination of all the command-line-based options files it finds. These are used for Deferred Parsing at runtime, so that options.xmlc is never referenced. But if options.xmlc is still in the classpath, it will be used as a fallback by Dynamic Loading, since the dynamically loaded markup files won't have associated per/markup file XML metadata files.
Previously, to be compatible with runtime Dynamic Loading, the options.xmlc file either had to be a custom made XML metadata file (which is tedious to write/maintain and conflicts with XMLC compilation using multiple options files) or be specifically kept out of the classpath at runtime. Now that there is no conflict, there is no longer a need for either of these workarounds.
The new "suffix" attribute more clearly describes its purpose; to append the value as the suffix to the XMLC generated class. This is not evident with the "markup" attribute. As such, it is now deprecated.
Additionally, new, more intelligent, default behavior has been implemented when not defining the "suffix" attribute. By default, XMLC generated classes now use the markup file's extension, UPPER-cased, as the suffix. The old default was hard-coded as "HTML".
Updated all instances of package-private SecuritySupport
and ObjectFactory
classes as well as various DOMImplementation
classes (made singleton instances final) to align with the latest changes made in Xerces2.
Made use of the new "suffix" <xmlc/> attribute to replace the "markup" attribute to avoid warnings and not use it at all in cases where multiple types of markup documents are being compiled. Also made better use of "packagename" and "packagedir" attributes.
Modified options.xmlc to be command-line-based instead of XML-based. Made use of the new "-docformat" option. Updated a few markup files to exercise HTML Parser/Formatter capabilities.
Added catalina.properties to control how the Tomcat classloader hierarchy is defined and added log4j.properties to utilize custom log4j configuration.
Removed some warnings for unused fields, etc...
Updated to Log4j-1.2.15 and ASM-3.1