Annexe B. Logiciels XML

B.1. Memento logiciels

B.1.1. Validation DTD

Validation d'un document avec DTD interne ou locale

xmllint --noout --valid xmlfile.xml
xmllint --noout --dtdvalid dtdfile.dtd xmlfile.xml
export SP_CHARSET_FIXED="yes"
export SP_ENCODING="XML"
export SGML_CATALOG_FILES="/usr/share/sgml/opensp-1.5.2/OpenSP/xml.soc"
nsgmls -s xmlfile.xml

B.1.2. Validation par un schéma

xmllint --noout --schema schema.xsd xmlfile.xml

B.1.3. Application de transformation XSLT

xsltproc --stringparam param value stylesheet.xsl source.xml
saxon8 source.xml stylesheet.xsl param=value
xt source.xml stylesheet.xsl param=value

Le caractère $ est un caractère spécial du shell.

sabcmd source.xml stylesheet.xsl \$param=value
xalan -IN source.xml -XSL stylesheet.xsl -PARAM param value

B.1.4. Création d'un fichier PDF avec fop

# Directement à partir d'un fichier FO
fop source.fo result.pdf
# Application d'une feuille de style pour produire le fichier FO
fop -xsl stylesheet.xsl -xml source.xml -pdf result.pdf