Rapport hebdomadaire 8

Apprentissage de Xerces, une librairie Java pour XML.


Mots-clés:

Xerces, Java, SAX, DOM.
 

Bibliographie:

XML and Java: Developing Web Application; Hiroshi Maruyama, Kent Tamura, Naohiko Uramoto (IBM), ed. Addison-Wesley 1999
Unleashed XML; Michael Morrison, ed. Sams Publishing 2000
 

Sites internet:

Xerces - XML parsers in Java, C++ (with Perl and COM bindings):
http://xml.apache.org/xerces-j/index.html
The Xerces Java Parser 1.3.1 supports XML 1.0 recommendation and contains advanced parser functionality, such as XML Schema, DOM Level 2 version 1.0, and SAX Version 2, in addition to supporting the industry-standard DOM Level 1 and SAX version 1 APIs.

Acknowledgment: I have added the address
   barkati@edite-de-paris.com.fr
to the xerces-j-user mailing list.

Acknowledgment: I have added the address
   barkati@edite-de-paris.com.fr
to the batik-users mailing list.
 

Apprentissage de Xerces:

La version 1.3.1 de Xerces propose des parsers DOM (Document Object Model), SAX (Simple API for XML), et SAX2. Une première analyse comparative a été faite, ainsi qu'un test positif de chargement et d'analyse de fichier MusicXML:
[barkati@ceres sax]$ java sax.SAXCount ~/MusicXML/mut.xml
/home/barkati/MusicXML/mut.xml: 13218 ms (9120 elems, 730 attrs, 56139 spaces, 15060 chars)
[barkati@ceres sax]$ java sax.SAX2Count ~/MusicXML/mut.xml
/home/barkati/MusicXML/mut.xml: 16154 ms (9120 elems, 730 attrs, 56139 spaces, 15060 chars)
[barkati@ceres sax]$ cd -
[barkati@ceres dom]$ java dom.DOMCount ~/MusicXML/mut.xml
/home/barkati/MusicXML/mut.xml: 15877 ms (9120 elems, 730 attrs, 56139 spaces, 15060 chars)
La prochaine étape concerne XSL.
 

Par rapport à Java, deux modifications ont permis d'utiliser correctement Xerces:

export CLASSPATH=.:$JAVA_HOME/
Pour complier un ficher appartenant à un package, il faut préciser le nom du package à la compilation:
[barkati@ceres dom]$ java dom.DOMCount good.xml


Quelques nouvelles interessantes ont été glanées:
Xerces-J 1.4.0 is now ready for prime-time.  The most important new feature in Xerces-J 1.4.0 is full schema support (except for some small limitations as detailed in the documentation).
The SVG Font Converter illustrates how Batik can help you embed SVG Font definitions in an SVG file by providing an application that converts ranges of characters from a True Type Font format to the SVG Font format.