You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by "David Crossley (JIRA)" <ji...@apache.org> on 2005/12/24 03:18:31 UTC
[jira] Updated: (FOR-311) OOo Headings bug causes Forrest to fail
[ http://issues.apache.org/jira/browse/FOR-311?page=all ]
David Crossley updated FOR-311:
-------------------------------
Other Info: [Patch available]
Description:
There appears to be a bug or feature in OpenOffice which affects how haedings are stored as XML. It appears that if a virgin document is opened then all headings are stored in <text:h> tags, but if an existing document is opened that lacks a particular haeding style, then if you create that heading style it is stored in <text:p> tags.
This causes Forrest to mis-interpret headings, as the Forrest OOo XSL file identifies OOo headings by looking for the <text:h> tags.
(Moved detail from Description to Comment - see 2005-12-24)
was:
There appears to be a bug or feature in OpenOffice which affects how haedings are stored as XML. It appears that if a virgin document is opened then all headings are stored in <text:h> tags, but if an existing document is opened that lacks a particular haeding style, then if you create that heading style it is stored in <text:p> tags.
This causes Forrest to mis-interpret headings, as the Forrest OOo XSL file identifies OOo headings by looking for the <text:h> tags.
You can reproduce this effect as follows:
1 Create a new text file.
2 Create 20 lines of text, one of each style Heading 1-10, with a "default" format line between each.
3 Save this file (as "head.sxw" for example), unzip it and examine its content.xml. You will see that all of the headings are of the format:
<text:h text:style-name="Heading 5" text:level="5">Heading 5</text:h>
4 Copy head.sxw this to headless.sxw.
5 Open headless.sxw, delete the Heading 5 line, then save and close the file.
6 Reopen headless.sxw, and add a new line where the original Heading 5 line had been. Change the style of this new line to Heading 5.
7 Save this file, unzip it and examine its content.xml. The new line of style heading 5 is:
<text:p text:style-name="Heading 5">New heading 5</text:p>
So ...
So perhaps openoffice-writer2forrest.xsl should reconsider how it matches headings. Instead of the current:
<xsl:template match="text:h[@text:level='1']">
maybe it should match text:h or text:p with an attribute text:style-name="Heading 1" etc.
(Hopefully I will work out how to attach the .sxw and .xml files so you can see these examples easily)
You can reproduce this effect as follows:
1 Create a new text file.
2 Create 20 lines of text, one of each style Heading 1-10, with a "default" format line between each.
3 Save this file (as "head.sxw" for example), unzip it and examine its content.xml. You will see that all of the headings are of the format:
<text:h text:style-name="Heading 5" text:level="5">Heading 5</text:h>
4 Copy head.sxw this to headless.sxw.
5 Open headless.sxw, delete the Heading 5 line, then save and close the file.
6 Reopen headless.sxw, and add a new line where the original Heading 5 line had been. Change the style of this new line to Heading 5.
7 Save this file, unzip it and examine its content.xml. The new line of style heading 5 is:
<text:p text:style-name="Heading 5">New heading 5</text:p>
So ...
So perhaps openoffice-writer2forrest.xsl should reconsider how it matches headings. Instead of the current:
<xsl:template match="text:h[@text:level='1']">
maybe it should match text:h or text:p with an attribute text:style-name="Heading 1" etc.
(Hopefully I will work out how to attach the .sxw and .xml files so you can see these examples easily)
> OOo Headings bug causes Forrest to fail
> ---------------------------------------
>
> Key: FOR-311
> URL: http://issues.apache.org/jira/browse/FOR-311
> Project: Forrest
> Type: Improvement
> Components: Plugin: OpenOffice.org
> Versions: 0.6
> Environment: All
> Reporter: Charles Palmer
> Priority: Minor
> Attachments: headings.zip, openoffice-writer.sxw, openoffice-writer.sxw, openoffice-writer2forrest.xsl, openoffice-writer_clay.diff, openoffice-writer_update.sxw
>
> There appears to be a bug or feature in OpenOffice which affects how haedings are stored as XML. It appears that if a virgin document is opened then all headings are stored in <text:h> tags, but if an existing document is opened that lacks a particular haeding style, then if you create that heading style it is stored in <text:p> tags.
> This causes Forrest to mis-interpret headings, as the Forrest OOo XSL file identifies OOo headings by looking for the <text:h> tags.
> (Moved detail from Description to Comment - see 2005-12-24)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira