Projet

Général

Profil

Demande #1796

Je n'arrive plus à ouvrir un fichier très important dans le SVN

Ajouté par Isabella Vanni il y a plus de 7 ans. Mis à jour il y a plus de 3 ans.

Statut:
Fermé
Priorité:
Urgente
Assigné à:
Catégorie:
-
Version cible:
-
Début:
22/09/2016
Echéance:
% réalisé:

0%

Temps estimé:
Difficulté:

Description

Je n'arrive plus à ouvrir un fichier très important dans le SVN.

C'est le fichier :
recherche-salle.ods

Dans SVN/encours/20ansapril

Historique

#1

Mis à jour par François Poulain il y a plus de 7 ans

Pb corrigé e commité.

#2

Mis à jour par François Poulain il y a plus de 7 ans

  • Statut changé de Nouveau à Résolu

J'ai unzipé l'ods

$ unzip recherche-salle.ods 
Archive:  recherche-salle.ods
 extracting: mimetype                
 extracting: Thumbnails/thumbnail.png  
  inflating: settings.xml            
  inflating: content.xml             
  inflating: meta.xml                
  inflating: styles.xml              
  inflating: manifest.rdf            
   creating: Configurations2/statusbar/
  inflating: Configurations2/accelerator/current.xml  
   creating: Configurations2/floater/
   creating: Configurations2/images/Bitmaps/
   creating: Configurations2/toolbar/
   creating: Configurations2/menubar/
   creating: Configurations2/popupmenu/
   creating: Configurations2/toolpanel/
   creating: Configurations2/progressbar/
  inflating: META-INF/manifest.xml   

Puis j'ai édité content.xml. Rien de flagrant de visu. J'ai donc dégainé xmllint :

$ xmllint content.xml 
content.xml:2: parser error : Attribute fo:font-weight redefined
nt-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" 
                                                                               ^
content.xml:2: parser error : Attribute style:font-weight-asian redefined
nt-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" 
                                                                               ^
content.xml:2: parser error : Attribute style:font-weight-complex redefined
nt-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" 
                                                                               ^
content.xml:2: parser error : Attribute fo:font-weight redefined
ale Sans UI" style:font-weight-asian="normal" style:font-weight-complex="normal" 
                                                                               ^
content.xml:2: parser error : Attribute style:font-weight-asian redefined
ale Sans UI" style:font-weight-asian="normal" style:font-weight-complex="normal" 
                                                                               ^
content.xml:2: parser error : Attribute style:font-weight-complex redefined
ale Sans UI" style:font-weight-asian="normal" style:font-weight-complex="normal" 

Malheureusement tout le document est sur une seule ligne. Donc j'ai fait de la découpe à coup de sed vim (oui j'aurais pu faire plus subtil, mais quand on a un marteau magique on cherche à taper sur des clous...) :

:%s/\/>/^M&/g

Puis re xmllint:

$ xmllint content.xml 
content.xml:613: parser error : Attribute fo:font-weight redefined
/></style:style><style:style style:name="T40" style:family="text"><style:text-pr
^
content.xml:613: parser error : Attribute style:font-weight-asian redefined
/></style:style><style:style style:name="T40" style:family="text"><style:text-pr
^
content.xml:613: parser error : Attribute style:font-weight-complex redefined
/></style:style><style:style style:name="T40" style:family="text"><style:text-pr
^
content.xml:616: parser error : Attribute fo:font-weight redefined
/></style:style><style:style style:name="T43" style:family="text"><style:text-pr
^
content.xml:616: parser error : Attribute style:font-weight-asian redefined
/></style:style><style:style style:name="T43" style:family="text"><style:text-pr
^
content.xml:616: parser error : Attribute style:font-weight-complex redefined
/></style:style><style:style style:name="T43" style:family="text"><style:text-pr
^

Et alors je supprime les attributs jusque ce que ce dernier soit content. Ensuite dans le doute je recolle les morceaux à coup de sed vim:

:%s/\/>/^M&/g

Une fois terminé, je rezippe :

zip recherche-salle.unfucked.ods Configurations2 META-INF mimetype settings.xml Thumbnails content.xml manifest.rdf meta.xml styles.xml

Puis j'ouvre l'ods avec libreoffice qui me propose de le "réparer", parce que il doit y avoir du décalage dans des index ou metadatas.

Et zou.

#3

Mis à jour par Isabella Vanni il y a presque 7 ans

  • Statut changé de Résolu à Fermé

Merci beaucoup pour cette intervention imposante !

#4

Mis à jour par Christian P. Momon il y a plus de 3 ans

  • Assigné à mis à François Poulain

Formats disponibles : Atom PDF