gcc/libjava/classpath/doc
Andrew John Hughes c10bf728da Merge GNU Classpath libgcj-snapshot-20090102.
2009-01-06  Andrew John Hughes  <gnu_andrew@member.fsf.org>

	Import GNU Classpath (libgcj-snapshot-20090102).

	* libjava/classpath/lib/java/text/RuleBasedCollator$CollationSorter.class,
	* libjava/classpath/lib/java/text/MessageFormat$MessageFormatElement.class,
	* libjava/classpath/lib/java/text/MessageFormat.class,
	* libjava/classpath/lib/java/text/SimpleDateFormat.class,
	* libjava/classpath/lib/java/text/NumberFormat.class,
	* libjava/classpath/lib/java/text/RuleBasedCollator$CollationElement.class,
	* libjava/classpath/lib/java/text/MessageFormat$Field.class,
	* libjava/classpath/lib/java/text/RuleBasedCollator.class,
	* libjava/classpath/lib/java/text/NumberFormat$Field.class,
	* libjava/classpath/lib/gnu/xml/transform/Bindings.class,
	* libjava/classpath/lib/gnu/java/locale/LocaleData.class,
	* libjava/classpath/lib/gnu/java/awt/peer/gtk/FreetypeGlyphVector.class,
	* libjava/classpath/lib/gnu/javax/crypto/jce/key/SecretKeyGeneratorImpl.class,
	* libjava/gnu/java/awt/peer/gtk/FreetypeGlyphVector.h,
	* libjava/java/text/MessageFormat.h,
	* libjava/java/text/RuleBasedCollator$CollationSorter.h,
	* libjava/java/text/RuleBasedCollator.h,
	* libjava/java/text/SimpleDateFormat.h:
	Regenerated.

2009-01-02  Andrew John Hughes  <gnu_andrew@member.fsf.org>

       * ChangeLog-2008: New file.

2009-01-02  Andrew John Hughes  <gnu_andrew@member.fsf.org>

       * java/text/MessageFormat.java:
       (setLocale(Locale)): Integer format should use
       NumberFormat.getIntegerInstance.

libjava/classpath/ChangeLog-2008

2008-12-31  Andrew John Hughes  <gnu_andrew@member.fsf.org>

       * java/text/MessageFormat.java:
       (parse(String,ParsePosition)): Emulate behaviour
       of Vector's setSize() which was being implicitly relied on.

2008-12-31  Andrew John Hughes  <gnu_andrew@member.fsf.org>

       * java/text/SimpleDateFormat.java:
       Remove superfluous empty line introduced
       in last commit.

2008-12-31  Andrew John Hughes  <gnu_andrew@member.fsf.org>

       * java/text/MessageFormat.java:
       Convert variables to use generic types, use
       CPStringBuilder in place of StringBuilder.
       (Field()): Suppress warning due to only being used by
       deserialization.
       (scanFormat(String,int,CPStringBuilder,List,Locale)):
       Use ArrayList instead of Vector as no synchronisation needed.
       (parse(String,ParsePosition)): Likewise.
       * java/text/NumberFormat.java:
       (Field()): Suppress warning due to only being used by
       deserialization.
       * java/text/RuleBasedCollator.java:
       Convert variables to use generic types.
       (CollationElement): Make fields final.
       (CollationSorter): Likewise.
       (CollationSorter(int,String,int,boolean)): New constructor.
       * java/text/SimpleDateFormat.java,
       Convert variables to use generic types.
       (applyPattern(String)): Clear list rather than creating a new instance.

2008-12-30  Andrew John Hughes  <gnu_andrew@member.fsf.org>

       * java/text/SimpleDateFormat.java:
       (standardChars): Use standard characters from CLDR.
       (RFC822_TIMEZONE_FIELD): Fixed to match new standard
       characters.

2008-12-22  Andrew John Hughes  <gnu_andrew@member.fsf.org>

       * java/lang/String.java:
       (byte[],int,int,String): Call new Charset method.
       (stringToCharset(String)): Private method added to
       handle exception conversion.
       (byte[],int,int,Charset): Implemented.
       (byte[], Charset): Likewise.
       (getBytes(String)): Call new Charset method.
       (getBytes(Charset)): Implemented.

2008-12-18  Andrew John Hughes  <gnu_andrew@member.fsf.org>

       * native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c:
       Include '\0' in the string.

2008-12-09  Andrew John Hughes  <gnu_andrew@member.fsf.org>

       PR classpath/38473:
       * native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c:
       (Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getGlyphOutlineNative):
       Check that the glyph is an outline before calling
       FT_Outline_Decompose.

2008-11-16  Andrew John Hughes  <gnu_andrew@member.fsf.org>

       * gnu/xml/transform/Bindings.java:
       Add generics to collections.

2008-11-16  Andrew John Hughes  <gnu_andrew@member.fsf.org>

       * gnu/javax/crypto/jce/key/SecretKeyGeneratorImpl.java:
       (init(int,SecureRandom)): Improve exception message.

2008-11-06  Mark Wielaard  <mark@klomp.org>

       * native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c
       (getKerning): Removed unused cls, method, values.

2008-11-05  Andrew Haley  <aph@redhat.com>

       * gnu/java/awt/peer/gtk/FreetypeGlyphVector.java (getKerning):
       Return result in a float[], not a Point2D.
       (performDefaultLayout): Call getKerning with a float[].
       * native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c
       (getKerning): Return result in a float[], not a Point2D.

2008-11-05  Andrew Haley  <aph@redhat.com>

       * tools/Makefile.am (UPDATE_TOOLS_ZIP, CREATE_TOOLS_ZIP): Exclude
       .svn direcories.

2008-10-23  David Edelsohn  <edelsohn@gnu.org>

       * native/fdlibm/fdlibm.h: Undef hz.

2008-10-20  Andrew John Hughes  <gnu_andrew@member.fsf.org>

       * m4/ac_prog_antlr.m4:
       Remove redundant checks.
       * tools/Makefile.am:
       Use gjdoc_gendir when calling antlr.

2008-10-17  Robert Lougher  <rob.lougher@gmail.com>

       * native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c
       (Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoDrawGlyphVector):
       Release 'fonts'.

2008-10-16  Tom Tromey  <tromey@redhat.com>

       * tools/gnu/classpath/tools/jar/WorkSet.java (initSet): Use
       foreach.  Change argument type.
       (WorkSet): Change argument type.
       * tools/gnu/classpath/tools/jar/Indexer.java (indexJarFile): Use
       foreach.
       * tools/gnu/classpath/tools/jar/Creator.java
       (writeCommandLineEntries): Use foreach.
       (getAllEntries): Likewise.

2008-10-15  Andrew John Hughes  <gnu_andrew@member.fsf.org>

       * configure.ac:
       Remove superfluous AC_PROG_JAVA call.

From-SVN: r143139
2009-01-06 22:44:05 +00:00
..
api re PR libgcj/33764 (gij is built as 32-bit binary when building multilib gcc) 2008-11-12 21:55:13 +01:00
.cvsignore Merged gcj-eclipse branch to trunk. 2007-01-09 19:58:05 +00:00
Makefile.am re PR libgcj/37636 (java tools are unable to find resource files) 2008-10-21 17:55:01 +00:00
Makefile.in re PR libgcj/33764 (gij is built as 32-bit binary when building multilib gcc) 2008-11-12 21:55:13 +01:00
README.jaxp * doc/README.jaxp: Fix typos. 2008-01-27 21:29:02 +00:00
cp-hacking.texinfo Import GNU Classpath (classpath-0_97_2-release). 2008-06-28 13:29:13 +00:00
cp-tools.texinfo re PR libgcj/37636 (java tools are unable to find resource files) 2008-10-21 17:55:01 +00:00
cp-vmintegration.texinfo Import GNU Classpath (classpath-0_97_2-release). 2008-06-28 13:29:13 +00:00
texi2pod.pl libjava/classpath/ChangeLog.gcj: 2007-06-03 23:18:43 +00:00
texinfo.tex Merge GNU Classpath libgcj-snapshot-20090102. 2009-01-06 22:44:05 +00:00

README.jaxp

This file describes the jaxp (xml processing) implementation of GNU Classpath.
GNU Classpath includes interfaces and implementations for basic XML processing
in in the java programming language, some general purpose SAX2 utilities, and
transformation.

These classes used to be maintained as part of an external project GNU JAXP
but are now integrated with the rest of the core class library provided by
GNU Classpath.

PACKAGES
    
. javax.xml.* ... JAXP 1.3 interfaces

. gnu.xml.aelfred2.* ... SAX2 parser + validator
. gnu.xml.dom.* ... DOM Level 3 Core, Traversal, XPath implementation
. gnu.xml.dom.ls.* ... DOM Level 3 Load & Save implementation
. gnu.xml.xpath.* ... JAXP XPath implementation
. gnu.xml.transform.* ... JAXP XSL transformer implementation
. gnu.xml.pipeline.* ... SAX2 event pipeline support
. gnu.xml.stream.* ... StAX pull parser and SAX-over-StAX driver
. gnu.xml.util.* ... various XML utility classes
. gnu.xml.libxmlj.dom.* ... libxmlj DOM Level 3 Core and XPath
. gnu.xml.libxmlj.sax.* ... libxmlj SAX parser
. gnu.xml.libxmlj.transform.* ... libxmlj XSL transformer
. gnu.xml.libxmlj.util.* ... libxmlj utility classes

In the external directory you can find the following packages.
They are not maintained as part of GNU Classpath, but are used by the
classes in the above packages.

. org.xml.sax.* ... SAX2 interfaces
. org.w3c.dom.* ... DOM Level 3 interfaces
. org.relaxng.datatype.* ... RELAX NG pluggable datatypes API

CONFORMANCE

    The primary test resources are at http://xmlconf.sourceforge.net
    and include:

    SAX2/XML conformance tests
	That the "xml.testing.Driver" addresses the core XML 1.0
	specification requirements, which closely correspond to the
	functionality SAX1 provides.  The driver uses SAX2 APIs to
	test that functionality It is used with a bugfixed version of
	the NIST/OASIS XML conformance test cases.
	
	The AElfred2 parser is highly conformant, though it still takes
	a few implementation shortcuts.  See its package documentation
	for information about known XML conformance issues in AElfred2.

	The primary issue is using Unicode character tables, rather than
	those in the XML specification, for determining what names are
	valid.  Most applications won't notice the difference, and this
	solution is smaller and faster than the alternative.

	For validation, a secondary issue is that issues relating to
	entity modularity are not validated; they can't all be cleanly
	layered.  For example, validity constraints related to standalone
	declarations and PE nesting are not checked.

        The current implementation has also been tested against Elliotte
        Rusty Harold's SAXTest test suite (http://www.cafeconleche.org/SAXTest)
        and achieves approximately 93% conformance to the SAX specification
        according to these tests, higher than any other current Java parser.

    SAX2
	SAX2 API conformance currently has a minimal JUNIT (0.2) test suite,
	which can be accessed at the xmlconf site listed above.  It does
	not cover namespaces or LexicalHandler and Declhandler extensions
	anywhere as exhaustively as the SAX1 level functionality is
	tested by the "xml.testing.Driver".  However:

	    - Applying the DOM unit tests to this implementation gives
	      the LexicalHandler (comments, and boundaries of DTDs,
	      CDATA sections, and general entities) a workout, and
	      does the same for DeclHandler entity declarations.
	    
	    - The pipeline package's layered validator demands that
	      element and attribute declarations are reported correctly.
	
	By those metrics, SAX2 conformance for AElfred2 is also strong. 
    
    DOM Level 3 Core Tests
        The DOM implementation has been tested against the W3C DOM Level 3
        Core conformance test suite (http://www.w3.org/DOM/Test/). Current
        conformance according to these tests is 72.3%. Many of the test
        failures are due to the fact that GNU JAXP does not currently
        provide any W3C XML Schema support.

    XSL transformation
        The transformer and XPath implementation have been tested against
        the OASIS XSLT and XPath TC test suite. Conformance against the
        Xalan tests is currently 77%.


libxmlj
========================================================================

libxmlj is an effort to create a 100% JAXP-compatible Java wrapper for
libxml2 and libxslt. JAXP is the Java API for XML processing, libxml2
is the XML C library for Gnome, and libxslt is the XSLT C library for
Gnome.

libxmlj currently supports most of the DOM Level 3 Core, Traversal, and
XPath APIs, SAX2, and XSLT transformations. There is no W3C XML Schema
support yet.

libxmlj can parse and transform XML documents extremely quickly in
comparison to Java-based JAXP implementations. DOM manipulations, however,
involve JNI overhead, so the speed of DOM tree construction and traversal
can be slower than the Java implementation.

libxmlj is highly experimental, doesn't always conform to the DOM
specification correctly, and may leak memory. Production use is not advised.

The implementation can be found in gnu/xml/libxmlj and native/jni/xmlj.
See the INSTALL file for the required versions of libxml2 and libxslt.
configure --enable-xmlj will build it.

Usage
------------------------------------------------------------------------

To enable the various GNU JAXP factories, set the following system properties
(command-line version shown, but they can equally be set programmatically):

  AElfred2:
   -Djavax.xml.parsers.SAXParserFactory=gnu.xml.aelfred2.JAXPFactory

  GNU DOM (using DOM Level 3 Load & Save):
   -Djavax.xml.parsers.DocumentBuilderFactory=gnu.xml.dom.DomDocumentBuilderFactory

  GNU DOM (using AElfred-only pipeline classes):
   -Djavax.xml.parsers.DocumentBuilderFactory=gnu.xml.dom.JAXPFactory

  GNU XSL transformer:
   -Djavax.xml.transform.TransformerFactory=gnu.xml.transform.TransformerFactoryImpl

  GNU StAX:
   -Djavax.xml.stream.XMLEventFactory=gnu.xml.stream.XMLEventFactoryImpl
   -Djavax.xml.stream.XMLInputFactory=gnu.xml.stream.XMLInputFactoryImpl
   -Djavax.xml.stream.XMLOutputFactory=gnu.xml.stream.XMLOutputFactoryImpl

  GNU SAX-over-StAX:
   -Djavax.xml.parsers.SAXParserFactory=gnu.xml.stream.SAXParserFactory

  libxmlj SAX:
   -Djavax.xml.parsers.SAXParserFactory=gnu.xml.libxmlj.sax.GnomeSAXParserFactory

  libxmlj DOM:
   -Djavax.xml.parsers.DocumentBuilderFactory=gnu.xml.libxmlj.dom.GnomeDocumentBuilderFactory

  libxmlj XSL transformer:
   -Djavax.xml.transform.TransformerFactory=gnu.xml.libxmlj.transform.GnomeTransformerFactory

When using libxmlj, the libxmlj shared library must be available.
In general it is picked up by the runtime using GNU Classpath. If not you
might want to try adding the directory where libxmlj.so is installed
(by default ${prefix}/lib/classpath/) with ldconfig or specifying in the
LD_LIBRARY_PATH environment variable. Additionally, you may need to specify
the location of your shared libraries to the runtime environment using the
java.library.path system property.

Missing (libxmlj) Features
------------------------------------------------------------------------ 

See BUGS in native/jni/xmlj for known bugs in the libxmlj native bindings.

This implementation should be thread-safe, but currently all
transformation requests are queued via Java synchronization, which
means that it effectively performs single-threaded. Long story short,
both libxml2 and libxslt are not fully reentrant.  

Update: it may be possible to make libxmlj thread-safe nonetheless
using thread context variables.

Update: thread context variables have been introduced. This is very
untested though, libxmlj therefore still has the single thread
bottleneck.


Validation
===================================================

Pluggable datatypes
---------------------------------------------------
Validators should use the RELAX NG pluggable datatypes API to retrieve
datatype (XML Schema simple type) implementations in a schema-neutral
fashion. The following code demonstrates looking up a W3C XML Schema
nonNegativeInteger datatype:

  DatatypeLibrary xsd = DatatypeLibraryLoader
    .createDatatypeLibrary(XMLConstants.W3C_XML_SCHEMA_NS_URI);
  Datatype nonNegativeInteger = xsd.createDatatype("nonNegativeInteger");

It is also possible to create new types by derivation. For instance,
to create a datatype that will match a US ZIP code:

  DatatypeBuilder b = xsd.createDatatypeBuilder("string");
  b.addParameter("pattern", "(^[0-9]{5}$)|(^[0-9]{5}-[0-9]{4}$)");
  Datatype zipCode = b.createDatatype();

A datatype library implementation for XML Schema is provided; other
library implementations may be added.