Systèmes de communication

XML, éléments choisis (3)


La déclaration NOTATION

<!NOTATION GIF SYSTEM "nom applic">
<!ENTITY maison SYSTEM "home.gif" NDATA GIF>
<!ELEMENT image EMPTY>
<!ATTLIST image file ENTITY #REQUIRED>

------
<image file="maison"/>

Namespaces (noms de domaines)

Les "noms de domaines" (namespaces) permettent de mélanger des DTD de provenances diverses.

Exemple:

Déclaration d'un "namespace":
<Chapter xmlns:catalog="http://www.wrox.com/bookdefs/PubCatalog.dtd">

Utilisation:
<catalog:Book>....</catalog:Book>

Quelques "namespaces" gérés par le W3C: xml, xlink, xsl, xsd, fo, rdf, ...

Compléments de langage

XLink (XML Linking Language): utilise la syntaxe XML pour décrire des liens "complexes" entre différentes ressources.

XPath: sa première utilité est de fournir une syntaxe qui permet "d'adresser" des parties d'un document XML (utilisé par XPointer et XSLT).

XPointer: langage utilisé pour référencer un fragment d'une ressource de type text/xml ou application/xml.

XSL: langage pour fabriquer une feuille de style. Il est composé de 3 parties.

Le processus de mise en forme est formé de deux parties: transformation puis formattage. La transformation transforme un "arbre" XML en un autre arbre. Par exemple HTML (dont la feuille de style représente la partie formatage), mais aussi un arbre d'objets de formattage (préfixe fo: ensemble d'abstractions typographiques) qui pourra être rendu avec les interfaces appropriés (voir aussi FOP).

Schema

Une alternative aux DTD pour spécifier le format de documents. Avantage: la description est écrite en XML. Inconvénient: difficilement "human readable".

En même temps, les possibilités de description on été affinées (nouveaux types d'attributs, etc.).

DOM (Document Object Model)

Version restreinte: page HTML vue d'un langage de script (par exemple JavaScript)

Version large: structure objet d'un document XML complet

Le DOM définit de façon abstraite les structures (objet) et manipulations de documents XML (ou HTML)

SAX (Simple Api for XML)

Interface pour lire des informations dans un document XML.

Les projets Apache

The goals of the Apache XML Project are: to provide commercial-quality standards-based XML solutions that are developed in an open and cooperative fashion, to provide feedback to standards bodies (such as IETF and W3C) from an implementation perspective, and to be a focus for XML-related activities within Apache projects.

The Apache XML Project currently consists of seven sub-projects, each focused on a different aspect of XML:

FOP (Formatting Objects Processor) is the world's first print formatter driven by XSL formatting objects and the world's first output independent formatter. It is a Java application that reads a formatting object tree and then renders the resulting pages to a specified output. Output formats currently supported are PDF, PCL, PS, SVG, XML (area tree representation), Print, AWT, MIF and TXT. The primary output target is PDF.

Différents éditeurs

Xeena (www.alphaworks.ibm.com/tech/xeena): Editeur XML en Java mis à disposition par IBM.

Xerlin (extrait de: www.xerlin.org) : Xerlin is a Java based XML modeling application written to make creating and editing XML files easier. It runs on any Java 2 virtual machine (JDK1.2.2 or JDK1.3). The application is extensible via custom editor plugins that can be added for individual DTD's. (Open source).

XML Spy (extrait de: www.xmlspy.com): XML Spy 4.2 IDE (integrated development environment) is the industry leading solution for XML-based applications, making it easy to create and manage XML documents, stylesheets, and schemas. It is the essential power tool for XML application developers.

NetBeans: L'IDE Java NetBeans soutenu par SUN possède des outils permettant de gérér DTD, fichiers XML et transformation XSL.