Bug 288644

Summary: xml:id Attribute redefined Parsing error
Product: [Applications] calligrawords Reporter: Giuseppe Calà <gcala>
Component: opendocumentAssignee: Halla Rempt <halla>
Status: RESOLVED FIXED    
Severity: critical CC: halla, rasasi78, smithjd15
Priority: NOR Keywords: release_blocker
Version: 2.4-snapshots   
Target Milestone: ---   
Platform: Chakra   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: document with error

Description Giuseppe Calà 2011-12-10 12:08:20 UTC
Created attachment 66585 [details]
document with error

Version:           2.4-snapshots (using KDE 4.7.3) 
OS:                Linux

Have created a test document to check Words 2.4.85. Have inserted standard paragraphs. I can save (as odt) and close it without any issues, but opening it again I got the following error:

Could not open...
Reason: Parsing error in the main document at line 15, column 1053
Error message: Attribute redefined.

Libreoffice returns error, too:
Read-Error:
Format error  discovered  in the file  in sub-document content.xml at 15,1001(row,col)

See attached sample document

Reproducible: Always

Steps to Reproduce:
1) Create an empty document
2) past the following text two times pressing Enter between (paste-[Enter]-paste)

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus ultrices, quam eget mollis molestie, metus est mollis mi, in scelerisque mauris mi at nunc. Praesent sodales pharetra tristique. Nam nec consectetur nibh. Pellentesque lacinia varius eleifend. Quisque et augue ac urna laoreet lobortis eu faucibus velit. Etiam ipsum purus, suscipit in tincidunt at, porttitor commodo purus. Fusce bibendum pretium lorem in eleifend. Nunc at ante sit amet urna tincidunt volutpat. Nulla porttitor eros libero. Donec vel enim eu felis faucibus interdum ac in metus. Proin sit amet nibh purus. Phasellus mattis semper augue in blandit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Ut congue dignissim mollis.

3) Save and close.
4) Open is ok
5) Insert empty line between paragraphs
6) Save and close
7) Open gives error

Actual Results:  
Error message: Attribute redefined.

Expected Results:  
No errors
Comment 1 Camilla Boemann 2011-12-10 12:24:46 UTC
due to the fact that w now also save text:id as xml:id we now have a clash with  rdf's use of xml:id
Comment 2 Halla Rempt 2012-01-02 10:05:45 UTC
I'm working on this right now.
Comment 3 Halla Rempt 2012-01-03 08:42:33 UTC
This is the action plan:

http://lists.kde.org/?l=calligra-devel&m=132396277701278&w=2
Comment 4 Halla Rempt 2012-02-29 10:10:09 UTC
Git commit 764ba8cb514c2b80013bacf97ddabe11bb43325b by Boudewijn Rempt.
Committed on 29/02/2012 at 11:03.
Pushed by rempt into branch 'master'.

Save and load xml:id as well as text:id and draw:id where necessary

ODF 1.2 migrates from draw:id and text:id to xml:id in most cases. This
patch introduces a new class, KoElementReference, that makes handling
id's mostly transparent.

It also changes KoShapeSavingContext to manage references and id's in
a transparent manner when saving. Most filters, even those that are
currently useless, have also been updated.
REVIEW: 104074

M  +7    -2    filters/stage/kpr2odf/Filterkpr2odf.cpp
M  +16   -0    filters/stage/pptx/PptxXmlSlideReader.cpp
M  +16   -14   filters/words/docx/DocxXmlDocumentReader.cpp
M  +1    -1    filters/words/oowriter/ExportFilter.h
M  +1    -0    karbon/common/KarbonDocument.cpp
M  +5    -2    krita/ui/flake/kis_shape_layer.cc
M  +5    -1    krita/ui/flake/kis_shape_selection.cpp
M  +2    -2    libs/flake/KoConnectionShape.cpp
M  +0    -2    libs/flake/KoImageCollection.cpp
M  +10   -8    libs/flake/KoShape.cpp
M  +14   -1    libs/flake/KoShapeLoadingContext.cpp
M  +12   -0    libs/flake/KoShapeLoadingContext.h
M  +58   -26   libs/flake/KoShapeSavingContext.cpp
M  +19   -24   libs/flake/KoShapeSavingContext.h
M  +1    -2    libs/kopageapp/KoPADocument.cpp
M  +0    -1    libs/kopageapp/KoPAPage.cpp
M  +20   -19   libs/kopageapp/KoPAPastePage.cpp
M  +2    -3    libs/kopageapp/tests/TestPACopyPastePage.cpp
M  +3    -2    libs/kopageapp/tests/TestPACopyPastePage.h
M  +5    -0    libs/kotext/KoDocumentRdfBase.cpp
M  +10   -0    libs/kotext/KoDocumentRdfBase.h
M  +2    -13   libs/kotext/KoInlineNote.cpp
M  +0    -9    libs/kotext/KoInlineNote.h
M  +1    -0    libs/kotext/KoInlineObject.h
M  +1    -1    libs/kotext/KoTextAnchor.cpp
M  +6    -0    libs/kotext/KoTextBlockData.cpp
M  +8    -0    libs/kotext/KoTextBlockData.h
M  +1    -1    libs/kotext/KoTextDrag.cpp
M  +12   -13   libs/kotext/KoTextInlineRdf.cpp
M  +2    -1    libs/kotext/KoTextInlineRdf.h
M  +28   -21   libs/kotext/changetracker/KoChangeTracker.cpp
M  +8    -6    libs/kotext/changetracker/KoChangeTracker.h
M  +28   -8    libs/kotext/opendocument/KoTextLoader.cpp
M  +3    -8    libs/kotext/opendocument/KoTextWriter.cpp
M  +1    -1    libs/kotext/opendocument/KoTextWriter.h
M  +17   -40   libs/kotext/opendocument/KoTextWriter_p.cpp
M  +1    -2    libs/kotext/opendocument/KoTextWriter_p.h
M  +4    -4    libs/kotext/opendocument/tests/CMakeLists.txt
M  +1    -1    libs/kotext/opendocument/tests/TestChangeTracking.cpp
M  +21   -0    libs/main/rdf/KoDocumentRdf.cpp
M  +9    -0    libs/main/rdf/KoDocumentRdf.h
M  +2    -0    libs/odf/CMakeLists.txt
A  +114  -0    libs/odf/KoElementReference.cpp     [License: LGPL (v2+)]
A  +132  -0    libs/odf/KoElementReference.h     [License: LGPL (v2+)]
M  +3    -3    libs/odf/KoEmbeddedDocumentSaver.cpp
M  +1    -0    libs/odf/KoGenChange.cpp
M  +23   -63   libs/odf/KoGenChanges.cpp
M  +5    -25   libs/odf/KoGenChanges.h
M  +10   -2    libs/odf/tests/CMakeLists.txt
A  +44   -0    libs/odf/tests/TestKoElementReference.cpp     [License: LGPL (v2+)]
A  +33   -0    libs/odf/tests/TestKoElementReference.h     [License: LGPL (v2+)]
M  +3    -2    plan/libs/ui/reports/odt/KoSimpleOdtCheckBox.cpp
M  +2    -4    plan/libs/ui/reports/odt/KoSimpleOdtLine.cpp
M  +1    -0    plan/libs/ui/reports/odt/KoSimpleOdtPicture.cpp
M  +1    -0    plan/libs/ui/reports/odt/KoSimpleOdtTextBox.cpp
M  +0    -1    plugins/pathshapes/enhancedpath/EnhancedPathShape.cpp
M  +10   -6    stage/part/animations/KPrAnimationBase.cpp
M  +0    -2    stage/part/animations/KPrAnimationLoader.cpp
M  +5    -0    stage/part/animations/KPrShapeAnimation.cpp
M  +0    -1    tables/part/Doc.cpp
M  +2    -0    words/part/KWOdfLoader.cpp
M  +9    -7    words/part/KWOdfWriter.cpp

http://commits.kde.org/calligra/764ba8cb514c2b80013bacf97ddabe11bb43325b