Valid XHTML     Valid CSS2    

XML en L2, université d'Angers

    gilles.hunault@univ-angers.fr

 

T.P. numéro 1 : outils ligne de commandes et structuration XML

 

Table des matières cliquable

  1. Outils logiciels en ligne de commandes

  2. Rendre un document HTML valide pour la grammaire XHTML 1.0 Strict

  3. Passer de XHTML 1.0 Transitionnel à XHTML 1.0 Strict

  4. Réparer des fichiers mal formés ?

  5. Compter des éléments et des attributs

  6. Attributs uniques

  7. XML et bureautique

 

Il est possible d'afficher toutes les solutions via  ?solutions=1  et de les masquer via  ?solutions=0 .

 

1. Outils logiciels en ligne de commandes

Vérifier que, sous Linux dans les salles de T.P. au département informatique de la faculté des sciences, les outils en ligne de commandes nommés recode, iconv, rxp, xmllint, xmlstarlet et xsltproc sont installés. On indiquera leur version respective et on lira l'aide en ligne afin d'en connaitre les paramètres.

Où sont les pages d'aides associées sur le Web ?

Rappeler comment on teste si un fichier est bien formé avec rxp, xmllint et xmlstarlet. On pourra utiliser les fichiers dbf.xml et dmf.xml pour tester les commandes associées. Doit-on rapatrier les fichiers, par exemple avec wget ou est-ce que rxp, xmllint, xmlstarlet et xsltproc sont capables de lire des URL ?

Pour celles et ceux qui font les T.P. à distance, vérifier que les exécutables de l'archive outilsXMLpourWindows fournissent les mêmes outils pour Windows.

Afin de tester facilement les fichiers du cours, on trouvera dans l'archive documentsL2Xml tousles fichiers XML, DTD, XSD et XSL du cours.

Au passage : quel visualiseur de fichiers peut-on utiliser pour voir/afficher les fichiers XML ? Et quel éditeur de texte pour éditer/afficher les fichiers XML ?

Solution :  

La page officielle pour rxp est http://www.cogsci.ed.ac.uk/~richard/rxp.html. La page d'aide (man) est http://www.cogsci.ed.ac.uk/~richard/rxp.txt dont une version un peu plus lisible est ici. Une autre page d'aide est (merci à M. Racine et R. Gaborieau de nous l'avoir signalée).

xmllint fait partie du package libxml2-utils et est disponible via http://xmlsoft.org. La page d'aide est http://xmlsoft.org/xmllint.html.

On peut trouver la page d'aide pour xmlstarlet sur sourceforge : xmlstarlet-ug.html.

On peut trouver la page d'aide pour xsltproc sur le site xmlsoft : xsltproc2.html.

Sur notre ordinateur, la version de ces logiciels est 


     $gh> recode --version
     
     Free recode 3.6
     
     $gh> iconv --version
     
     iconv (Ubuntu GLIBC 2.23-0ubuntu9) 2.23
     
     $gh> rxp -v
     
     RXP 1.5.0 Copyright Richard Tobin, LTG, HCRC, University of Edinburgh
     
     $gh> xmllint --version
     
     xmllint: using libxml version 20903
     
     $gh> xmlstarlet --version
     
     compiled against libxml2 2.9.2, linked with 20903
     compiled against libxslt 1.1.28, linked with 10128
     
     $gh> xsltproc --version
     
     Using libxml 20903, libxslt 10128 and libexslt 817
     xsltproc was compiled against libxml 20903, libxslt 10128 and libexslt 817
     libxslt 10128 was compiled against libxml 20903
     libexslt 817 was compiled against libxml 20903
     

Voici les commandes à utiliser pour tester si un fichier est bien formé :


          rxp       dbf.xml
          rxp -s    dbf.xml
          rxp       dmf.xml
          rxp -s    dmf.xml
     
          xmllint         dbf.xml
          xmllint --noout dbf.xml
          xmllint --noout dmf.xml
     
          xmlstarlet val    -w dbf.xml
          xmlstarlet val    -w dmf.xml
          xmlstarlet val -e -w dmf.xml
     

On voit donc que dbf.xml est bien formé et que dmf.xml ne l'est pas.

L'aide en ligne s'obtient avec le paramètre --help. Pour rxp l'aide est très succincte, mais man rxp fournit plus d'informations.

Pour xmllint, xmlstarlet et xsltproc il y a beaucoup d'options.

rxp, xmllint et xmlstarlet sont capables de lire des URL.

Voici d'autres commandes à exécuter pour tester que les outils fournis sont fonctionnels :


     ## lecture à distance de fichiers
     ## rappel: si rien ne s'affiche, c'est qu'il n'y a pas d'erreurs
     
        rxp            -s       http://forge.info.univ-angers.fr/~gh/internet/L2Xml/mineau3.xsl
        xmllint        --noout  http://forge.info.univ-angers.fr/~gh/internet/L2Xml/leadb880.xml
        xmlstarlet val -w       http://forge.info.univ-angers.fr/~gh/internet/L2Xml/firefox.svg
     
     ## validation par rapport à une grammaire
     
         xmllint   --dtdvalid molecule.dtd eau.xml
         xmlstarlet val -e -d molecule.dtd eau.xml
     
         xmllint --noout --schema molecule.xsd eau2.xml
         xmlstarlet val -e  -s    molecule.xsd eau2.xml
     
     ## xpath et transformations
     
        xmllint --xpath "//service[@nomDeService]" serv03.xml
     
        xsltproc      proteines.xsl leadb880.xml
        xmlstarlet tr proteines.xsl leadb880.xml
     
     ## sous Ubuntu, avec le package libxml-xpath-perl
     
        xpath -e "//service" serv01.xml
     
     ## recodages d'accents
     
        iconv -f ISO_8859-1 -t UTF-8  boncourage.txt  > boncourage.unicode
        recode   ISO-8859-15..UTF8    boncourage.txt  > boncourage.utf
     
     

Pour celles et ceux qui ne sauraient pas ou qui ne voudraient pas installer de logiciel, on peut utiliser des pages Web mais il faut alors copier/coller ou importer le(s) fichier(s) à traiter, comme par exemple le site xmlvalidation.

La visualisation de fichiers XML peut se faire avec un navigateur (Chrome, Firefox, Opera...). La plupart des navigateurs sont capables de montrer/masquer ou plier/déplier les contenus des éléments. N'importe quel éditeur de texte pour éditer/afficher les fichiers XML pourrait suffire s'il s'agissait d'écrire du texte. Toutefois, à cause de la syntaxe stricte de XML, un éditeur qui sait colorier les éléments, les attributs via une coloration syntaxique et qui est capable de plier/déplier les contenus des éléments devient vite indispensable. Nous conseillons le logiciel gratuit Geany, disponible sous Linux comme sous Windows et Mac, téléchargeable ici. D'autres éditeurs sont possibles, comme Notepad++, Visual Studio... pourvu que vous les maitrisiez et qu'ils aient la coloration syntaxique, le repliement, le choix de l'encodage...

 
                non su               non su

 

2. Rendre un document HTML valide pour la grammaire XHTML 1.0 Strict

Ce n'est pas parce qu'un navigateur affiche un document qu'il est valide. Corriger le document HTML de l'archive l2xml_bad.zip pour qu'il soit valide pour la grammaire XHTML 1.0 Strict. On pourra utiliser des outils Web ou en ligne de commandes.

Solution :  

Que ce soit à l'aide d'un outil Web comme le W3C validator, d'un outil intégré à Firefox comme HTML Validator ou d'un outil en ligne de commandes comme rxp, xmllint ou xmlstarlet, on trouve les erreurs suivantes :

  • il manque la structure englobante html/head/body ;

  • il manque donc aussi l'élément title dans la partie head ;

  • le deuxième paragraphe qui commence en ligne 4 n'est pas fermé car il n'y a pas de </p> correspondant à son <p> ;

  • toujours en ligne 4 l'entité &nbsp est mal écrite, il manque un point-virgule en fin d'entité  ;

  • le lien pour Google est incorrect, il faut des guillemets autour de l'URL  ;

  • le lien pour Google est un élément inline et doit être inclus dans un élément de type boite comme par exemple un élément p ou div.

La page l2xml_ok.html contient une version corrigée de la page et avec une indication explicite du jeu de caractères utilisé.

Remarque : une page Web peut comporter autre chose que du HTML ; ainsi les erreurs CSS et JavaScript ne sont pas détectables via ces outils.

 

3. Passer de XHTML 1.0 Transitionnel à XHTML 1.0 Strict

Quelles sont les principales différences entre les grammaires XHTML 1.0 Transitionnel et XHTML 1.0 Strict ?

Solution :  

Comme le montre notre comparateur de grammaires DTD, ce sont surtout les éléments font, iframe et center qui ne sont plus admis en XHTML 1.0 Strict. Ce qui signifie qu'il faut utiliser plus de CSS.

On pourra lire l'article trans-vs-strict pour plus de détails.

Passer de XHTML 1.0 Transitionnel à XHTML 1.0 Strict peut être parfois compliqué. Ainsi pour démarrer une liste avec l'année courante (ici 2017), le code <ol start="2017"... est incorrect car l'attribut start est interdit en XHTML strict. Soit on passe par du CSS (mais cela se généralise mal) soit on utilise du code Javascript pour réaliser un setAttribute("start","2017"), ce qui rajoute des difficultés...

 

4. Réparer des fichiers mal formés ?

Indiquez pour chacun des fichiers suivant s'il est bien formé ou non. Lorsqu'il n'est pas bien formé, indiquez si on peut le corriger pour qu'il le soit.

fichier01.xml       fichier02.xml       fichier03.xml       fichier04.xml       fichier05.xml       

Solution :  

Aucun souci pour le fichier fichier01.xml : il est bien formé.

Il y a juste une erreur dans le fichier fichier02.xml. C'est à la ligne 723. On y trouve <xsd:sequence minOccurs= maxOccurs>. Il serait sans doute possible de le corriger, par exemple en ajoutant juste des guillemets et pas de valeur pour ces attributs, mais ce n'est certainement pas une bonne solution. En effet, un nombre d'occurrences est soit un nombre entier soit la valeur unbounded et à moins de connaitre précisément ce que spécifie ce fichier il n'est pas possible de choisir des valeurs pour ces deux attributs.

Il y a le même problème pour fichier03.xml : il est mal formé car on a deux fois un même nom d'attribut. Choisir lequel est le bon (pour autant qu'il y en ait un qui soit le bon) ne relève pas de compétences en informatique.

Il y a plusieurs erreurs corrigeables dans fichier04.xml. Tout d'abord à la ligne 219, il manque </NOM>. Ensuite, à la ligne 673, il manque un P pour bien terminer l'élément ACTPNOM. Enfin, à la ligne 704 il y a un petit "s" en trop. A ce propos, il y de fortes chances que cette ligne 704 soit incorrecte  : les prénoms sont écrits pour tous les autres acteurs avec l'élément ACTPNOM. Or ici c'est l'élément ACTPRENOM qui est utilisé. Au final, le document sera bien formé, mais il ne sera pas valide si on définit dans une grammaire qu'on doit utiliser un élément ACTPNOM pour définir un prénom...

Il y a aussi plusieurs erreurs dans fichier05.xml mais elles ne sont sans doute pas toutes corrigeables.

 

5. Compter des éléments et des attributs

Compter le nombre de lignes puis lister tous les éléments XML distincts utilisés dans le logo du renard ci-dessous, puis compter tous les éléments avec leurs attributs.

                              non su

On s'intéresse ensuite au fichier leadb880.xml suivant qui contient des données pour des protéines LEA :

Après avoir décrit la structure du fichier, compter le nombre de lignes, le nombre de lignes vides, d'éléments et d'attributs. Vous pouvez utiliser tout outil logiciel qui vous parait adapté. Comment trouver le nombre d'éléments distincts ?

Quelles options des commandes grep et sort devriez-vous réviser au passage ?

Si vous êtes sous Windows, il faut installer grep à partir de la page gnuwin32 grep sans oublier les dépendances... Vous pouvez aussi installer wc mais la commande find de Windows avec les options /c et /v remplace wc.

Solution :  

Il y a en fait assez peu d'éléments utilisés pour le renard. Ainsi la commande xmlstarlet el -u firefox.svg renvoie une liste de 26 éléments distincts dans l'arbre, pour 348 éléments en tout. Si on retire les éléments égaux emboités comme g et g/g, il ne reste que 17 "vrais" éléments utilisés :


     # éléments issus de xmlstarlet el -u firefox.svg             # éléments uniques
     
     0001 svg                                                     0001 clipPath
     0002 svg/desc                                                0002 defs
     0003 svg/g                                                   0003 desc
     0004 svg/g/filter                                            0004 ellipse
     0005 svg/g/filter/feGaussianBlur                             0005 feGaussianBlur
     0006 svg/g/filter/feMerge                                    0006 feMerge
     0007 svg/g/filter/feMerge/feMergeNode                        0007 feMergeNode
     0008 svg/g/filter/feOffset                                   0008 feOffset
     0009 svg/g/g                                                 0009 filter
     0010 svg/g/g/ellipse                                         0010 g
     0011 svg/g/g/g                                               0011 linearGradient
     0012 svg/g/g/g/clipPath                                      0012 path
     0013 svg/g/g/g/clipPath/use                                  0013 radialGradient
     0014 svg/g/g/g/defs                                          0014 stop
     0015 svg/g/g/g/defs/ellipse                                  0015 svg
     0016 svg/g/g/g/linearGradient                                0016 title
     0017 svg/g/g/g/linearGradient/stop                           0017 use
     0018 svg/g/g/g/path
     0019 svg/g/g/g/radialGradient
     0020 svg/g/g/g/radialGradient/stop
     0021 svg/g/g/linearGradient
     0022 svg/g/g/linearGradient/stop
     0023 svg/g/g/path
     0024 svg/g/g/radialGradient
     0025 svg/g/g/radialGradient/stop
     0026 svg/title
     
     

Pour connaitre les attributs utilisés et pour compter chacun des éléments, on pourrait programmer le comptage des balises d'ouverture et de fermeture, ce que fait notre programme eltattres.php dont l'interface de départ est ici. On pourra cliquer sur le lien elementsRenard pour le vérifier et lire les comptages. On peut aussi enchainer des commandes Unix :


      wc -l firefox.svg                                #  428 lignes
     
      xmlstarlet el    firefox.svg | wc -l             #  348 éléments
      xmlstarlet el -u firefox.svg | wc -l             #   26 éléments
      xmlstarlet el -a firefox.svg | wc -l             # 1311 éléments
      xmlstarlet el -a firefox.svg | grep "@" | wc -l  #  963 attributs
     

Pour le fichier leadb880.xml, visiblement l'élément racine du fichier se nomme proteins et il ne contient que des éléments nommés protein. Chaque élément protein contient trois éléments, à savoir accession, class et fasta. De plus seul cet élément fasta possède un attribut nommé length.

Avec la commande xmlstarlet el -u on dispose de la structure des données en termes d'éléments :


     xmlstarlet el -u leadb880.xml
     
     proteins
     proteins/protein
     proteins/protein/accession
     proteins/protein/class
     proteins/protein/fasta
     

Il ne manque donc que la ligne proteins/protein/fasta/@length pour compléter cette description des éléments et attributs.

On peut facilement obtenir le nombre de lignes avec la commande système nommée wc. Pour le nombre de lignes vides, chainer grep et wc est sans doute un bon choix. Pour le nombre d'éléments distincts et la structure, xmlstarlet est un outil biens adapté. Enfin, pour le nombre d'éléments en tout, on peut chainer xmlstarlet et wc alors que pour le nombre d'attributs en tout, il faut chainer xmlstarlet, grep et wc. Voici le détail des commandes associées :


     
          wc -l leadb880.xml                                 # nombre de lignes (6163)
          grep "^$" leadb880.xml         | wc -l             # nombre de lignes vides (881)
          xmlstarlet el leadb880.xml     | wc -l             # nombre d'éléments (3521)
          xmlstarlet el -u leadb880.xml  | wc -l             # nombre d'éléments distincts (5)
          xmlstarlet el -a leadb880.xml  | wc -l             # nombre d'éléments ou attributs (4401)
          xmlstarlet el -a leadb880.xml  | grep "/@" | wc -l # nombre d'attributs (880)
          xmlstarlet el -a leadb880.xml  | grep "@" |  wc -l # idem
     
     

Attention aux commandes Unix. Elles sont efficaces à condition de bien les connaitre. Ainsi, grep -c compte les lignes correspondantes, ce qui évite de chainer grep et wc. La commande uniqu ne fonctionne que pour les lignes adjacentes. Il est donc prudent de commencer par trier avec sort avant d'utiliser uniqu.


      grep    "" leadb880.xml        | wc -l             # nombre de lignes vides...raté (6164)
      grep    "^$" leadb880.xml      | wc -l             # nombre de lignes vides (881)
      grep -c "^$" leadb880.xml                          # nombre de lignes vides (881) en plus court
     
      xmlstarlet el    leadb880.xml  |                 wc -l             # nombre d'éléments (3521)
      xmlstarlet el    leadb880.xml  |         uniq  | wc -l             # nombre d'éléments distincts... raté (3521)
      xmlstarlet el    leadb880.xml  | sort  | uniq  | wc -l             # nombre d'éléments distincts... OK (5)
      xmlstarlet el    leadb880.xml  | sort -u       | wc -l             # nombre d'éléments distincts... OK (5) un peu plus court
      xmlstarlet el -u leadb880.xml  |                 wc -l             # nombre d'éléments distincts (5) -- le plus court
     

Il serait sans doute bon de réviser les options -c -i -n -l -v pour grep et -k -n -r -u pour sort.

 

6. Attributs uniques

On s'intéresse ici au document films2.xml qui contient des films et des artistes.

Donner la structure explicite du fichier en termes d'éléments.

Trouver comment on peut produire la liste des attributs uniques du fichier, ce que ne sait pas faire xmlstarlet. Voici ce qu'on s'attend à voir :


     FILMSETARTISTES/ARTISTES/ARTISTE/@id
     FILMSETARTISTES/FILMS/FILM/@Annee
     FILMSETARTISTES/FILMS/FILM/MES/@idref
     

Solution :  

Avec xmlstarlet el -u on peut voir la structure en termes d'éléments :


     FILMSETARTISTES
     FILMSETARTISTES/ARTISTES
     FILMSETARTISTES/ARTISTES/ARTISTE
     FILMSETARTISTES/ARTISTES/ARTISTE/ANNEENAISS
     FILMSETARTISTES/ARTISTES/ARTISTE/ARTNOM
     FILMSETARTISTES/ARTISTES/ARTISTE/ARTPRENOM
     FILMSETARTISTES/FILMS
     FILMSETARTISTES/FILMS/FILM
     FILMSETARTISTES/FILMS/FILM/GENRE
     FILMSETARTISTES/FILMS/FILM/MES
     FILMSETARTISTES/FILMS/FILM/PAYS
     FILMSETARTISTES/FILMS/FILM/RESUME
     FILMSETARTISTES/FILMS/FILM/ROLES
     FILMSETARTISTES/FILMS/FILM/ROLES/ROLE
     FILMSETARTISTES/FILMS/FILM/ROLES/ROLE/INTITULE
     FILMSETARTISTES/FILMS/FILM/ROLES/ROLE/NOM
     FILMSETARTISTES/FILMS/FILM/ROLES/ROLE/PRENOM
     FILMSETARTISTES/FILMS/FILM/TITRE
     

Il y a donc deux sous-arbres, un pour les artistes et un pour les films. Les artistes ont un élément pour l'année, de naissance, le nom et le prénom. Les films ont un élément genre, mes (metteur en scène), pays, résumé (sans accent), titre et un sous-arbre roles. Cet élément roles contient des éléments role (au singulier) avec un intitulé, un nom et un prénom.

La commande suivante compléte la description des éléments uniques en chainant xmlstarlet, grep et sort :

      xmlstarlet el -a films2.xml | grep "/@" | sort -u .

 

7. XML et bureautique

Dans quelle mesure peut-on dire qu'un fichier-archive, une base de données et un fichier XML sont des conteneurs ?

Ecrire le texte «Bon courage à tous et à toutes» -- exactement comme cela, avec courage en gras, tous en bleu et toutes en gras et bleu foncé -- dans un fichier Word au format DOCX, puis au format RTF ; écrire le même texte dans un fichier Libre Office au format Texte ODT. Si ce sont des fichiers XML, pourquoi ne peut-on pas les ouvrir directement avec un éditeur de texte ? A quoi correspond le format .FODT ?

Reprendre avec les informations ci-dessous (fichier tableur_data.txt) qu'on mettra dans les cellules d'un tableur, qu'on sauvegardera au format XLSX, CSV et Classeur ODS :


     Iden       Longueur
     1906384B   110
     1YYCA      174
     A2XG55     33
     

Solution :  

Un fichier-archive, une base de données MySql, un document XML, un objet (au sens de la programmation objets) ou même un DVD du commerce sont des conteneurs dans la mesure où ils permettent de regrouper des contenus (données) hétérogènes : une base de données contient des tables qui elles-mêmes contiennent des champs, l'élément racine du document XML peut contenir d'autres éléments qui peuvent contenir eux-mêmes d'autres éléments, un objet en PO peut contenir plusieurs variables-mémoires, voire plusieurs tableaux ou d'autres objets, un DVD du commerce contient des vidéos, des sous-titres, voire des menus, des images... Ce qu'apportent en plus XML et l'objet, c'est la possibilité d'agir sur leurs contenus...

On pourrait exporter une base de données en XML avec la structure suivante (MySql dispose d'une option de sortie HTML et d'une option de sortie XML qui ressemble un peu à celle-ci) :


     <baseDeDonnées>
     
       <table1>
         <ligne1>
            <colonne1>
             [... données de la table 1]
            </colonne1>
            <colonne2>
            ...
            </colonne2>
            ...
         <ligne1>
       </table1>
     
       <table2>
         [... données de la table 2]
       </table2>
     
       ...
     
     </baseDeDonnées>
     

Les fichiers .ODS et .DOCX sont des documents compressés, c'est-à-dire des archives et ne peuvent donc pas être lus directement. Seul le format .RTF est lisible, si l'on peut dire. En voici le contenu :


     {\rtf1\ansi\deff3\adeflang1025
     {\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}
      {\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset128 Times New Roman;}
       {\f4\fswiss\fprq2\fcharset128 Arial;}{\f5\fnil\fprq2\fcharset128 WenQuanYi Micro Hei;}
        {\f6\fnil\fprq2\fcharset128 Lohit Hindi;}{\f7\fnil\fprq0\fcharset128 Lohit Hindi;}}
     {\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red128\green128\blue128;}
     {\stylesheet{\s0\snext0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}
      \cf0\kerning1\hich\af5\langfe2052\dbch\af6\afs24\alang1081\loch\f3\fs24\lang1036 Standard;}
     {\*\cs15\snext15\b\ab Accentuation forte;}
     {\s16\sbasedon0\snext17\sb240\sa120\keepn\hich\af5\dbch\af6\afs28\loch\f4\fs28 Titre;}
     {\s17\sbasedon0\snext17\sb0\sa120 Corps de texte;}
     {\s18\sbasedon17\snext18\sb0\sa120\dbch\af7 Liste;}
     {\s19\sbasedon0\snext19\sb120\sa120\noline\i\dbch\af7\afs24\ai\fs24 L\u233\'3fgende;}
     {\s20\sbasedon0\snext20\noline\dbch\af7 Index;}
     }{\info{\author Hunault }{\creatim\yr2012\mo7\dy23\hr22\min18}{\revtim\yr0\mo0\dy0\hr0\min0}
     {\printim\yr0\mo0\dy0\hr0\min0}{\comment LibreOffice}{\vern3500}}\deftab709
     
     {\*\pgdsctbl
     {\pgdsc0\pgdscuse195\pgwsxn11906\pghsxn16838\marglsxn1134\margrsxn1134
      \margtsxn1134\margbsxn1134\pgdscnxt0 Standard;}}
     \formshade\paperh16838\paperw11906\margl1134\margr1134\margt1134\margb1134
     \sectd\sbknone\sectunlocked1\pgndec\pgwsxn11906\pghsxn16838\marglsxn1134
     \margrsxn1134\margtsxn1134\margbsxn1134\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc
     \aftnrstcont\aftnstart1\aftnnrlc
     \pgndec\pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}
     \cf0\kerning1\hich\af5\langfe2052\dbch\af6\afs24\alang1081\loch\f3\fs24\lang1036
     {\cs15\b\ab\b0\ab0\rtlch \ltrch\loch
     Bon }{\cs15\b\ab\b\ab\rtlch \ltrch\loch
     courage}{\cs15\b\ab\b0\ab0\rtlch \ltrch\loch
      \uc2 \u224\'c3\'a0 \uc1 }{\cs15\b\ab\cf2\b0\ab0\rtlch \ltrch\loch
     tous}{\cs15\b\ab\b0\ab0\rtlch \ltrch\loch
      et \uc2 \u224\'c3\'a0 \uc1 }{\cs15\b\ab\cf2\b\ab\rtlch \ltrch\loch
     toutes}
     \par }
     

Un afffichage plus lisible pour un fichier similaire se trouve à l'adresse courage.rtfste qui correspond à l'exercice 9 de nos exercices PHP série 1 (énoncé, solution). On pourra aussi consulter l'exercice 1 de notre cours FarCompr, partie stockage (énoncé,solution).

Pour retrouver les fichiers des archives, il suffit d'utiliser un décompresseur comme unzip par exemple :


     $gh> unzip -v boncourage.odt
     
     Archive:  boncourage.odt
      Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
     --------  ------  ------- ---- ---------- ----- --------  ----
           39  Stored       39   0% 2012-07-23 20:24 0c32c65e  mimetype
          869  Stored      869   0% 2012-07-23 20:24 8a9d38c1  meta.xml
         9005  Defl:N     1393  85% 2012-07-23 20:24 7685b30d  settings.xml
         4469  Defl:N      966  78% 2012-07-23 20:24 7ee053d5  content.xml
         1240  Stored     1240   0% 2012-07-23 20:24 1549604c  Thumbnails/thumbnail.png
          899  Defl:N      261  71% 2012-07-23 20:24 d268f7b4  manifest.rdf
            0  Stored        0   0% 2012-07-23 20:24 00000000  Configurations2/images/Bitmaps/
            0  Stored        0   0% 2012-07-23 20:24 00000000  Configurations2/popupmenu/
            0  Stored        0   0% 2012-07-23 20:24 00000000  Configurations2/toolpanel/
            0  Stored        0   0% 2012-07-23 20:24 00000000  Configurations2/statusbar/
            0  Stored        0   0% 2012-07-23 20:24 00000000  Configurations2/progressbar/
            0  Stored        0   0% 2012-07-23 20:24 00000000  Configurations2/toolbar/
            0  Stored        0   0% 2012-07-23 20:24 00000000  Configurations2/floater/
            0  Stored        0   0% 2012-07-23 20:24 00000000  Configurations2/menubar/
            0  Defl:N        2   0% 2012-07-23 20:24 00000000  Configurations2/accelerator/current.xml
        11214  Defl:N     2071  82% 2012-07-23 20:24 7b480a79  styles.xml
         1086  Defl:N      289  73% 2012-07-23 20:24 1205fba3  META-INF/manifest.xml
     --------          -------  ---                            -------
        28821             7130  75%                            17 files
     
     $gh> unzip -v boncourage.docx
     
     Archive:  boncourage.docx
      Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
     --------  ------  ------- ---- ---------- ----- --------  ----
          573  Defl:N      217  62% 2012-07-23 20:23 2301d0e8  _rels/.rels
          595  Defl:N      224  62% 2012-07-23 20:23 21e3b303  word/fontTable.xml
          400  Defl:N      184  54% 2012-07-23 20:23 6294fd88  word/_rels/document.xml.rels
         1521  Defl:N      484  68% 2012-07-23 20:23 218c2506  word/document.xml
         2085  Defl:N      604  71% 2012-07-23 20:23 458984fb  word/styles.xml
          267  Defl:N      163  39% 2012-07-23 20:23 8f99c3e9  docProps/app.xml
          509  Defl:N      284  44% 2012-07-23 20:23 3004c3c0  docProps/core.xml
          987  Defl:N      286  71% 2012-07-23 20:23 606aa6aa  [Content_Types].xml
     --------          -------  ---                            -------
         6937             2446  65%                            8 files
     
     
     

Les «vrais» fichiers pour Open Office et Microsoft Office sont nommés respectivement content.xml et document.xml :


     $gh> cat content.xml
     
     <?xml version="1.0" encoding="UTF-8"?>
     <office:document-content
     xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
     xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
     xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
     xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
     xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
     xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
     xmlns:xlink="http://www.w3.org/1999/xlink"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
     xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
     xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
     xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
     xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
     xmlns:math="http://www.w3.org/1998/Math/MathML"
     xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
     xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
     xmlns:ooo="http://openoffice.org/2004/office"
     xmlns:ooow="http://openoffice.org/2004/writer"
     xmlns:oooc="http://openoffice.org/2004/calc"
     xmlns:dom="http://www.w3.org/2001/xml-events"
     xmlns:xforms="http://www.w3.org/2002/xforms"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:rpt="http://openoffice.org/2005/report"
     xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2"
     xmlns:xhtml="http://www.w3.org/1999/xhtml"
     xmlns:grddl="http://www.w3.org/2003/g/data-view#"
     xmlns:tableooo="http://openoffice.org/2009/table"
     xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0"
     xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
     xmlns:css3t="http://www.w3.org/TR/css3-text/"
     office:version="1.2"><office:scripts/>
     
     <office:font-face-decls><style:font-face style:name="Lohit Hindi1" svg:font-family="&apos;Lohit Hindi&apos;"/>
     <style:font-face style:name="Times New Roman" svg:font-family="&apos;Times New Roman&apos;" style:font-family-generic="roman"
     style:font-pitch="variable"/><style:font-face style:name="Arial" svg:font-family="Arial" style:font-family-generic="swiss"
     style:font-pitch="variable"/><style:font-face style:name="Lohit Hindi" svg:font-family="&apos;Lohit Hindi&apos;"
     style:font-family-generic="system" style:font-pitch="variable"/><style:font-face style:name="WenQuanYi Micro Hei"
     svg:font-family="&apos;WenQuanYi Micro Hei&apos;" style:font-family-generic="system" style:font-pitch="variable"/>
     </office:font-face-decls><office:automatic-styles><style:style style:name="T1" style:family="text">
     <style:text-properties fo:font-weight="normal" style:font-weight-asian="normal" style:font-weight-complex="normal"/>
     </style:style><style:style style:name="T2" style:family="text"><style:text-properties fo:font-weight="bold"
     style:font-weight-asian="bold" style:font-weight-complex="bold"/></style:style><style:style style:name="T3"
     style:family="text"><style:text-properties fo:color="#0000ff" fo:font-weight="normal" style:font-weight-asian="normal"
     style:font-weight-complex="normal"/></style:style><style:style style:name="T4" style:family="text">
     <style:text-properties fo:color="#0000ff" fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/>
     </style:style></office:automatic-styles>
     
     <office:body>
     <office:text><text:sequence-decls><text:sequence-decl
     text:display-outline-level="0" text:name="Illustration"/><text:sequence-decl text:display-outline-level="0"
     text:name="Table"/><text:sequence-decl text:display-outline-level="0" text:name="Text"/><text:sequence-decl
     text:display-outline-level="0" text:name="Drawing"/></text:sequence-decls><text:p text:style-name="Standard">
     <text:span text:style-name="Strong_20_Emphasis"><text:span text:style-name="T1">Bon </text:span></text:span>
     <text:span text:style-name="Strong_20_Emphasis"><text:span text:style-name="T2">courage</text:span></text:span>
     <text:span text:style-name="Strong_20_Emphasis"><text:span text:style-name="T1"> à </text:span></text:span>
     <text:span text:style-name="Strong_20_Emphasis"><text:span text:style-name="T3">tous</text:span></text:span>
     <text:span text:style-name="Strong_20_Emphasis"><text:span text:style-name="T1"> et à </text:span></text:span>
     <text:span text:style-name="Strong_20_Emphasis"><text:span text:style-name="T4">toutes</text:span></text:span>
     </text:p></office:text>
     </office:body>
     
     </office:document-content>
     
     $gh> cat document.xml
     
     <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
     
     <w:document
     xmlns:o="urn:schemas-microsoft-com:office:office"
     xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
     xmlns:v="urn:schemas-microsoft-com:vml"
     xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
     xmlns:w10="urn:schemas-microsoft-com:office:word"
     xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing">
     
     <w:body>
     <w:p><w:pPr><w:pStyle w:val="style0"/></w:pPr><w:r><w:rPr><w:rStyle w:val="style15"/><w:b w:val="false"/>
     <w:bCs w:val="false"/></w:rPr><w:t xml:space="preserve">Bon </w:t></w:r><w:r><w:rPr><w:rStyle w:val="style15"/>
     <w:b/><w:bCs/></w:rPr><w:t>courage</w:t></w:r><w:r><w:rPr><w:rStyle w:val="style15"/><w:b w:val="false"/>
     <w:bCs w:val="false"/></w:rPr><w:t xml:space="preserve"> à </w:t></w:r><w:r><w:rPr><w:rStyle w:val="style15"/>
     <w:b w:val="false"/><w:bCs w:val="false"/><w:color w:val="0000FF"/></w:rPr><w:t>tous</w:t></w:r><w:r><w:rPr>
     <w:rStyle w:val="style15"/><w:b w:val="false"/><w:bCs w:val="false"/></w:rPr><w:t xml:space="preserve"> et à
     </w:t></w:r><w:r><w:rPr><w:rStyle w:val="style15"/><w:b/><w:bCs/><w:color w:val="0000FF"/></w:rPr><w:t>toutes</w:t></w:r></w:p>
     <w:sectPr><w:type w:val="nextPage"/><w:pgSz w:h="16838" w:w="11906"/><w:pgMar w:bottom="1134" w:footer="0"
     w:gutter="0" w:header="0" w:left="1134" w:right="1134" w:top="1134"/><w:pgNumType w:fmt="decimal"/>
     <w:formProt w:val="false"/><w:textDirection w:val="lrTb"/></w:sectPr>
     </w:body>
     
     </w:document>
     
     
     
     

Si la documentation du Wiki français détaille ce que sont les fichiers Open Document, elle ne dit rien sur ce qu'est le format .FODT alors que la documentation du Wiki anglais explique qu'il s'agit d'un format «à plat» (non compressé) monobloc (tout en un seul fichier). On pourra le vérifier en consultant boncourage.fodt (judicieusement recopié en boncourage_fodt.xml) dont le contenu est :


     $gh> cat boncourage.fodt
     
     
     <?xml version="1.0" encoding="UTF-8"?>
     
     <office:document
     xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
     xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
     xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
     xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
     xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
     xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
     xmlns:xlink="http://www.w3.org/1999/xlink"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
     xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
     xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
     xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
     xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
     xmlns:math="http://www.w3.org/1998/Math/MathML"
     xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
     xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
     xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"
     xmlns:ooo="http://openoffice.org/2004/office"
     xmlns:ooow="http://openoffice.org/2004/writer"
     xmlns:oooc="http://openoffice.org/2004/calc"
     xmlns:dom="http://www.w3.org/2001/xml-events"
     xmlns:xforms="http://www.w3.org/2002/xforms"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:rpt="http://openoffice.org/2005/report"
     xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2"
     xmlns:xhtml="http://www.w3.org/1999/xhtml"
     xmlns:grddl="http://www.w3.org/2003/g/data-view#"
     xmlns:tableooo="http://openoffice.org/2009/table"
     xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0"
     xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
     xmlns:css3t="http://www.w3.org/TR/css3-text/" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text">
     
     <office:meta>
     <meta:initial-creator>Hunault </meta:initial-creator>
     <meta:creation-date>2012-07-23T22:18:01</meta:creation-date>
     <meta:generator>LibreOffice/3.5$Linux_X86_64 LibreOffice_project/350m1$Build-2</meta:generator>
     <meta:document-statistic meta:table-count="0" meta:image-count="0"
     meta:object-count="0" meta:page-count="1" meta:paragraph-count="1"
     meta:word-count="7" meta:character-count="30"
     meta:non-whitespace-character-count="24"/>
     </office:meta>
     
     <office:settings>
       <config:config-item-set config:name="ooo:view-settings">
        <config:config-item config:name="ViewAreaTop" config:type="long">0</config:config-item>
        <config:config-item config:name="ViewAreaLeft" config:type="long">0</config:config-item>
        <config:config-item config:name="ViewAreaWidth" config:type="long">19738</config:config-item>
        <config:config-item config:name="ViewAreaHeight" config:type="long">13741</config:config-item>
        <config:config-item config:name="ShowRedlineChanges" config:type="boolean">true</config:config-item>
        <config:config-item config:name="InBrowseMode" config:type="boolean">false</config:config-item>
        <config:config-item-map-indexed config:name="Views">
         <config:config-item-map-entry>
          <config:config-item config:name="ViewId" config:type="string">view2</config:config-item>
          <config:config-item config:name="ViewLeft" config:type="long">8246</config:config-item>
          <config:config-item config:name="ViewTop" config:type="long">3002</config:config-item>
          <config:config-item config:name="VisibleLeft" config:type="long">0</config:config-item>
          <config:config-item config:name="VisibleTop" config:type="long">0</config:config-item>
          <config:config-item config:name="VisibleRight" config:type="long">19736</config:config-item>
          <config:config-item config:name="VisibleBottom" config:type="long">13739</config:config-item>
          <config:config-item config:name="ZoomType" config:type="short">0</config:config-item>
          <config:config-item config:name="ViewLayoutColumns" config:type="short">0</config:config-item>
          <config:config-item config:name="ViewLayoutBookMode" config:type="boolean">false</config:config-item>
          <config:config-item config:name="ZoomFactor" config:type="short">135</config:config-item>
          <config:config-item config:name="IsSelectedFrame" config:type="boolean">false</config:config-item>
         </config:config-item-map-entry>
        </config:config-item-map-indexed>
       </config:config-item-set>
       <config:config-item-set config:name="ooo:configuration-settings">
        <config:config-item config:name="PrintTables" config:type="boolean">true</config:config-item>
        <config:config-item config:name="AddParaTableSpacingAtStart" config:type="boolean">true</config:config-item>
        <config:config-item config:name="ChartAutoUpdate" config:type="boolean">true</config:config-item>
        <config:config-item config:name="IsLabelDocument" config:type="boolean">false</config:config-item>
        <config:config-item config:name="MathBaselineAlignment" config:type="boolean">true</config:config-item>
        <config:config-item config:name="OutlineLevelYieldsNumbering" config:type="boolean">false</config:config-item>
        <config:config-item config:name="PrintLeftPages" config:type="boolean">true</config:config-item>
        <config:config-item config:name="AlignTabStopPosition" config:type="boolean">true</config:config-item>
        <config:config-item config:name="DoNotJustifyLinesWithManualBreak" config:type="boolean">false</config:config-item>
        <config:config-item config:name="PrintTextPlaceholder" config:type="boolean">false</config:config-item>
        <config:config-item config:name="UseOldNumbering" config:type="boolean">false</config:config-item>
        <config:config-item config:name="PrintProspectRTL" config:type="boolean">false</config:config-item>
        <config:config-item config:name="ProtectForm" config:type="boolean">false</config:config-item>
        <config:config-item config:name="CurrentDatabaseCommand" config:type="string"/>
        <config:config-item config:name="PrintBlackFonts" config:type="boolean">false</config:config-item>
        <config:config-item config:name="SmallCapsPercentage66" config:type="boolean">false</config:config-item>
        <config:config-item config:name="CharacterCompressionType" config:type="short">0</config:config-item>
        <config:config-item config:name="PrintControls" config:type="boolean">true</config:config-item>
        <config:config-item config:name="PrintHiddenText" config:type="boolean">false</config:config-item>
        <config:config-item config:name="IsKernAsianPunctuation" config:type="boolean">false</config:config-item>
        <config:config-item config:name="UseFormerTextWrapping" config:type="boolean">false</config:config-item>
        <config:config-item config:name="PrintProspect" config:type="boolean">false</config:config-item>
        <config:config-item config:name="PrintEmptyPages" config:type="boolean">true</config:config-item>
        <config:config-item config:name="UnbreakableNumberings" config:type="boolean">false</config:config-item>
        <config:config-item config:name="UseFormerObjectPositioning" config:type="boolean">false</config:config-item>
        <config:config-item config:name="PrintReversed" config:type="boolean">false</config:config-item>
        <config:config-item config:name="TabsRelativeToIndent" config:type="boolean">true</config:config-item>
        <config:config-item config:name="TableRowKeep" config:type="boolean">false</config:config-item>
        <config:config-item config:name="ConsiderTextWrapOnObjPos" config:type="boolean">false</config:config-item>
        <config:config-item config:name="PrintRightPages" config:type="boolean">true</config:config-item>
        <config:config-item config:name="PrintPaperFromSetup" config:type="boolean">false</config:config-item>
        <config:config-item config:name="AddFrameOffsets" config:type="boolean">false</config:config-item>
        <config:config-item config:name="UpdateFromTemplate" config:type="boolean">true</config:config-item>
        <config:config-item config:name="AddParaSpacingToTableCells" config:type="boolean">true</config:config-item>
        <config:config-item config:name="PrintSingleJobs" config:type="boolean">false</config:config-item>
        <config:config-item config:name="AddExternalLeading" config:type="boolean">true</config:config-item>
        <config:config-item config:name="PrinterIndependentLayout" config:type="string">high-resolution</config:config-item>
        <config:config-item config:name="LinkUpdateMode" config:type="short">1</config:config-item>
        <config:config-item config:name="PrintAnnotationMode" config:type="short">0</config:config-item>
        <config:config-item config:name="UseOldPrinterMetrics" config:type="boolean">false</config:config-item>
        <config:config-item config:name="RedlineProtectionKey" config:type="base64Binary"/>
        <config:config-item config:name="PrinterName" config:type="string"/>
        <config:config-item config:name="CollapseEmptyCellPara" config:type="boolean">true</config:config-item>
        <config:config-item config:name="PrinterSetup" config:type="base64Binary"/>
        <config:config-item config:name="IgnoreFirstLineIndentInNumbering" config:type="boolean">false</config:config-item>
        <config:config-item config:name="InvertBorderSpacing" config:type="boolean">false</config:config-item>
        <config:config-item config:name="PrintPageBackground" config:type="boolean">true</config:config-item>
        <config:config-item config:name="DoNotCaptureDrawObjsOnPage" config:type="boolean">false</config:config-item>
        <config:config-item config:name="TabOverflow" config:type="boolean">true</config:config-item>
        <config:config-item config:name="ApplyUserData" config:type="boolean">true</config:config-item>
        <config:config-item config:name="TabAtLeftIndentForParagraphsInList" config:type="boolean">false</config:config-item>
        <config:config-item config:name="UnxForceZeroExtLeading" config:type="boolean">false</config:config-item>
        <config:config-item config:name="SaveVersionOnClose" config:type="boolean">false</config:config-item>
        <config:config-item config:name="PrintFaxName" config:type="string"/>
        <config:config-item config:name="PrintDrawings" config:type="boolean">true</config:config-item>
        <config:config-item config:name="AddParaTableSpacing" config:type="boolean">true</config:config-item>
        <config:config-item config:name="LoadReadonly" config:type="boolean">false</config:config-item>
        <config:config-item config:name="PrintGraphics" config:type="boolean">true</config:config-item>
        <config:config-item config:name="FieldAutoUpdate" config:type="boolean">true</config:config-item>
        <config:config-item config:name="AllowPrintJobCancel" config:type="boolean">true</config:config-item>
        <config:config-item config:name="SaveGlobalDocumentLinks" config:type="boolean">false</config:config-item>
        <config:config-item config:name="CurrentDatabaseDataSource" config:type="string"/>
        <config:config-item config:name="UseFormerLineSpacing" config:type="boolean">false</config:config-item>
        <config:config-item config:name="IgnoreTabsAndBlanksForLineCalculation" config:type="boolean">false</config:config-item>
        <config:config-item config:name="CurrentDatabaseCommandType" config:type="int">0</config:config-item>
        <config:config-item config:name="DoNotResetParaAttrsForNumFont" config:type="boolean">false</config:config-item>
        <config:config-item config:name="ClipAsCharacterAnchoredWriterFlyFrames" config:type="boolean">false</config:config-item>
       </config:config-item-set>
     </office:settings>
     
     <office:scripts>
       <office:script script:language="ooo:Basic">
        <ooo:libraries xmlns:ooo="http://openoffice.org/2004/office" xmlns:xlink="http://www.w3.org/1999/xlink">
         <ooo:library-embedded ooo:name="Standard"/>
        </ooo:libraries>
       </office:script>
      </office:scripts>
     
      <office:font-face-decls>
       <style:font-face style:name="Lohit Hindi1" svg:font-family="&apos;Lohit Hindi&apos;"/>
       <style:font-face style:name="Times New Roman"
         svg:font-family="&apos;Times New Roman&apos;" style:font-family-generic="roman" style:font-pitch="variable"/>
       <style:font-face style:name="Arial"
         svg:font-family="Arial" style:font-family-generic="swiss" style:font-pitch="variable"/>
       <style:font-face style:name="Lohit Hindi"
         svg:font-family="&apos;Lohit Hindi&apos;" style:font-family-generic="system" style:font-pitch="variable"/>
       <style:font-face style:name="WenQuanYi Micro Hei"
         svg:font-family="&apos;WenQuanYi Micro Hei&apos;" style:font-family-generic="system" style:font-pitch="variable"/>
      </office:font-face-decls>
     
      <office:styles>
       <style:default-style style:family="graphic">
        <style:graphic-properties svg:stroke-color="#808080" draw:fill-color="#cfe7f5"
        fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm"
        draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm"
        draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/>
        <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict"
        style:writing-mode="lr-tb" style:font-independent-line-spacing="false">
         <style:tab-stops/>
        </style:paragraph-properties>
        <style:text-properties style:use-window-font-color="true" fo:font-size="12pt" fo:language="fr"
        fo:country="FR" style:letter-kerning="true" style:font-size-asian="10.5pt" style:language-asian="zh"
        style:country-asian="CN" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/>
       </style:default-style>
       <style:default-style style:family="paragraph">
        <style:paragraph-properties fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha"
        style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/>
        <style:text-properties style:use-window-font-color="true" style:font-name="Times New Roman"
        fo:font-size="12pt" fo:language="fr" fo:country="FR" style:letter-kerning="true"
        style:font-name-asian="WenQuanYi Micro Hei" style:font-size-asian="10.5pt"
        style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Hindi"
        style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"
        fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2"/>
       </style:default-style>
       <style:default-style style:family="table">
        <style:table-properties table:border-model="collapsing"/>
       </style:default-style>
       <style:default-style style:family="table-row">
        <style:table-row-properties fo:keep-together="auto"/>
       </style:default-style>
       <style:style style:name="Standard" style:family="paragraph" style:class="text"/>
       <style:style style:name="Heading" style:family="paragraph" style:parent-style-name="Standard"
       style:next-style-name="Text_20_body" style:class="text">
        <style:paragraph-properties fo:margin-top="0.423cm" fo:margin-bottom="0.212cm"
        fo:keep-with-next="always"/>
        <style:text-properties style:font-name="Arial" fo:font-size="14pt" style:font-name-asian="WenQuanYi Micro Hei"
        style:font-size-asian="14pt" style:font-name-complex="Lohit Hindi" style:font-size-complex="14pt"/>
       </style:style>
       <style:style style:name="Text_20_body" style:display-name="Text body" style:family="paragraph"
       style:parent-style-name="Standard" style:class="text">
        <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.212cm"/>
       </style:style>
       <style:style style:name="List" style:family="paragraph" style:parent-style-name="Text_20_body"
       style:class="list">
        <style:text-properties style:font-size-asian="12pt" style:font-name-complex="Lohit Hindi1"/>
       </style:style>
       <style:style style:name="Caption" style:family="paragraph" style:parent-style-name="Standard" style:class="extra">
        <style:paragraph-properties fo:margin-top="0.212cm" fo:margin-bottom="0.212cm"
        text:number-lines="false" text:line-number="0"/>
        <style:text-properties fo:font-size="12pt" fo:font-style="italic" style:font-size-asian="12pt"
        style:font-style-asian="italic" style:font-name-complex="Lohit Hindi1"
        style:font-size-complex="12pt" style:font-style-complex="italic"/>
       </style:style>
       <style:style style:name="Index" style:family="paragraph" style:parent-style-name="Standard"
       style:class="index">
        <style:paragraph-properties text:number-lines="false" text:line-number="0"/>
        <style:text-properties style:font-size-asian="12pt" style:font-name-complex="Lohit Hindi1"/>
       </style:style>
       <style:style style:name="Strong_20_Emphasis" style:display-name="Strong Emphasis" style:family="text">
        <style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/>
       </style:style>
       <text:outline-style style:name="Outline">
        <text:outline-level-style text:level="1" style:num-format="">
         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
          <style:list-level-label-alignment text:label-followed-by="listtab"
          text:list-tab-stop-position="0.762cm" fo:text-indent="-0.762cm" fo:margin-left="0.762cm"/>
         </style:list-level-properties>
        </text:outline-level-style>
        <text:outline-level-style text:level="2" style:num-format="">
         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
          <style:list-level-label-alignment text:label-followed-by="listtab"
          text:list-tab-stop-position="1.016cm" fo:text-indent="-1.016cm" fo:margin-left="1.016cm"/>
         </style:list-level-properties>
        </text:outline-level-style>
        <text:outline-level-style text:level="3" style:num-format="">
         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
          <style:list-level-label-alignment text:label-followed-by="listtab"
          text:list-tab-stop-position="1.27cm" fo:text-indent="-1.27cm" fo:margin-left="1.27cm"/>
         </style:list-level-properties>
        </text:outline-level-style>
        <text:outline-level-style text:level="4" style:num-format="">
         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
          <style:list-level-label-alignment text:label-followed-by="listtab"
          text:list-tab-stop-position="1.524cm" fo:text-indent="-1.524cm" fo:margin-left="1.524cm"/>
         </style:list-level-properties>
        </text:outline-level-style>
        <text:outline-level-style text:level="5" style:num-format="">
         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
          <style:list-level-label-alignment text:label-followed-by="listtab"
          text:list-tab-stop-position="1.778cm" fo:text-indent="-1.778cm" fo:margin-left="1.778cm"/>
         </style:list-level-properties>
        </text:outline-level-style>
        <text:outline-level-style text:level="6" style:num-format="">
         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
          <style:list-level-label-alignment text:label-followed-by="listtab"
          text:list-tab-stop-position="2.032cm" fo:text-indent="-2.032cm" fo:margin-left="2.032cm"/>
         </style:list-level-properties>
        </text:outline-level-style>
        <text:outline-level-style text:level="7" style:num-format="">
         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
          <style:list-level-label-alignment text:label-followed-by="listtab"
          text:list-tab-stop-position="2.286cm" fo:text-indent="-2.286cm" fo:margin-left="2.286cm"/>
         </style:list-level-properties>
        </text:outline-level-style>
        <text:outline-level-style text:level="8" style:num-format="">
         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
          <style:list-level-label-alignment text:label-followed-by="listtab"
          text:list-tab-stop-position="2.54cm" fo:text-indent="-2.54cm" fo:margin-left="2.54cm"/>
         </style:list-level-properties>
        </text:outline-level-style>
        <text:outline-level-style text:level="9" style:num-format="">
         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
          <style:list-level-label-alignment text:label-followed-by="listtab"
          text:list-tab-stop-position="2.794cm" fo:text-indent="-2.794cm" fo:margin-left="2.794cm"/>
         </style:list-level-properties>
        </text:outline-level-style>
        <text:outline-level-style text:level="10" style:num-format="">
         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
          <style:list-level-label-alignment text:label-followed-by="listtab"
          text:list-tab-stop-position="3.048cm" fo:text-indent="-3.048cm" fo:margin-left="3.048cm"/>
         </style:list-level-properties>
        </text:outline-level-style>
       </text:outline-style>
       <text:notes-configuration text:note-class="footnote" style:num-format="1"
       text:start-value="0" text:footnotes-position="page" text:start-numbering-at="document"/>
       <text:notes-configuration text:note-class="endnote" style:num-format="i"
       text:start-value="0"/>
       <text:linenumbering-configuration text:number-lines="false"
       text:offset="0.499cm" style:num-format="1" text:number-position="left" text:increment="5"/>
      </office:styles>
      <office:automatic-styles>
       <style:style style:name="T1" style:family="text">
        <style:text-properties fo:font-weight="normal"
        style:font-weight-asian="normal" style:font-weight-complex="normal"/>
       </style:style>
       <style:style style:name="T2" style:family="text">
        <style:text-properties fo:font-weight="bold"
        style:font-weight-asian="bold" style:font-weight-complex="bold"/>
       </style:style>
       <style:style style:name="T3" style:family="text">
        <style:text-properties fo:color="#0000ff" fo:font-weight="normal"
        style:font-weight-asian="normal" style:font-weight-complex="normal"/>
       </style:style>
       <style:style style:name="T4" style:family="text">
        <style:text-properties fo:color="#0000ff" fo:font-weight="bold"
        style:font-weight-asian="bold" style:font-weight-complex="bold"/>
       </style:style>
       <style:page-layout style:name="pm1">
        <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm"
        style:num-format="1" style:print-orientation="portrait" fo:margin="2cm" fo:margin-top="2cm"
        fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb"
        style:footnote-max-height="0cm">
         <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm"
         style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left"
         style:rel-width="25%" style:color="#000000"/>
        </style:page-layout-properties>
        <style:header-style/>
        <style:footer-style/>
       </style:page-layout>
      </office:automatic-styles>
      <office:master-styles>
       <style:master-page style:name="Standard" style:page-layout-name="pm1"/>
      </office:master-styles>
     
      <office:body>
       <office:text>
        <text:sequence-decls>
         <text:sequence-decl text:display-outline-level="0" text:name="Illustration"/>
         <text:sequence-decl text:display-outline-level="0" text:name="Table"/>
         <text:sequence-decl text:display-outline-level="0" text:name="Text"/>
         <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
        </text:sequence-decls>
        <text:p text:style-name="Standard"><text:span text:style-name="Strong_20_Emphasis">
        <text:span text:style-name="T1">Bon </text:span></text:span>
        <text:span text:style-name="Strong_20_Emphasis"><text:span text:style-name="T2">courage</text:span></text:span>
        <text:span text:style-name="Strong_20_Emphasis"><text:span text:style-name="T1"> à </text:span></text:span>
        <text:span text:style-name="Strong_20_Emphasis"><text:span text:style-name="T3">tous</text:span></text:span>
        <text:span text:style-name="Strong_20_Emphasis"><text:span text:style-name="T1"> et à </text:span></text:span>
        <text:span text:style-name="Strong_20_Emphasis"><text:span text:style-name="T4">toutes</text:span></text:span>
        </text:p>
     
       </office:text>
      </office:body>
     </office:document>
     

Le format CSV est un format texte délimité dont le séparateur par défaut est la virgule en mode EN et le point-virgule en modeFR. Le wiki anglais et le wiki français ne fournissent pas exactement les mêmes informations sur ce format :


     $gh>cat tableur_data.csv
     
     "Iden";"Longueur"
     "1906384B";110
     "1YYCA";174
     "A2XG55";33
     

Là encore, les formats ODS et XLSX correspondent à des archives de fichiers XML :


     @ghchu~/public_html/Webrd|(~gH) > unzip -v tableur_data.ods
     
     Archive:  tableur_data.ods
      Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
     --------  ------  ------- ---- ---------- ----- --------  ----
           46  Stored       46   0% 2012-08-11 21:30 8a396c85  mimetype
         4586  Defl:N     1055  77% 2012-08-11 21:30 709917f1  content.xml
         6515  Defl:N     1495  77% 2012-08-11 21:30 5930af5f  styles.xml
          703  Stored      703   0% 2012-08-11 21:30 0ed35f21  meta.xml
         3139  Defl:N     2535  19% 2012-08-11 21:30 dc135285  Thumbnails/thumbnail.png
            0  Defl:N        2   0% 2012-08-11 21:30 00000000  Configurations2/accelerator/current.xml
            0  Stored        0   0% 2012-08-11 21:30 00000000  Configurations2/progressbar/
            0  Stored        0   0% 2012-08-11 21:30 00000000  Configurations2/floater/
            0  Stored        0   0% 2012-08-11 21:30 00000000  Configurations2/popupmenu/
            0  Stored        0   0% 2012-08-11 21:30 00000000  Configurations2/menubar/
            0  Stored        0   0% 2012-08-11 21:30 00000000  Configurations2/toolbar/
            0  Stored        0   0% 2012-08-11 21:30 00000000  Configurations2/images/Bitmaps/
            0  Stored        0   0% 2012-08-11 21:30 00000000  Configurations2/statusbar/
         7231  Defl:N      945  87% 2012-08-11 21:30 9393bb63  settings.xml
         1896  Defl:N      330  83% 2012-08-11 21:30 ff80d544  META-INF/manifest.xml
     --------          -------  ---                            -------
        24116             7111  71%                            15 files
     
     @ghchu~/public_html/Webrd|(~gH) > unzip -v tableur_data.xlsx
     
     Archive:  tableur_data.xlsx
      Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
     --------  ------  ------- ---- ---------- ----- --------  ----
          571  Defl:N      224  61% 2012-08-11 21:29 b782aa66  _rels/.rels
          392  Defl:N      223  43% 2012-08-11 21:29 aae67dae  docProps/core.xml
          358  Defl:N      218  39% 2012-08-11 21:29 dc515681  docProps/app.xml
          549  Defl:N      210  62% 2012-08-11 21:29 7af9f04f  xl/_rels/workbook.xml.rels
         2610  Defl:N      970  63% 2012-08-11 21:29 54a219b2  xl/worksheets/sheet1.xml
         4425  Defl:N      671  85% 2012-08-11 21:29 9e9cee72  xl/styles.xml
          718  Defl:N      411  43% 2012-08-11 21:29 e0a08d5d  xl/workbook.xml
          270  Defl:N      186  31% 2012-08-11 21:29 d3e2279e  xl/sharedStrings.xml
         1111  Defl:N      305  73% 2012-08-11 21:29 44d373f5  [Content_Types].xml
     --------          -------  ---                            -------
        11004             3418  69%                            9 files
     

Pour Open Office, le «vrai» fichier est content.xml ; pour Microsoft Office, le «vrai» fichier utilise sheet1.xml et sharedStrings.xml.

 

 

Code-source php de cette page.

 

 

retour gH    Retour à la page principale de   (gH)