Replies: 1 comment
-
Hello Helmut,
I have not required nor used such an append/merge ODT functionality.
When I look at
org.odftoolkit.odfdom.doc.OdfTextDocument
and its parent
org.odftoolkit.odfdom.doc.OdfDocument
I can not find such functionality, so it seems it simply does not exist,
yet.
If this already existed in Simple API, you should try to port it back to
ODFDOM.
The following functionality comes initially to my mind:
1. Copy the content beyond <office:body> behind the content of the other
beyond <office:body>
But beware there is also
a content-prelude:
https://docs.oasis-open.org/office/OpenDocument/v1.3/os/schemas/OpenDocument-v1.3-schema-rng.html#office-text-content-prelude
a content-epilogue:
https://docs.oasis-open.org/office/OpenDocument/v1.3/os/schemas/OpenDocument-v1.3-schema-rng.html#office-text-content-epilogue
which needs to be merged when it exists!
2. As it is a generic functionality for all ODF documents, you might
place it at its parent OdfDocument.
But you need to override at least parts as the content of <office:body>
differs and you will not be able to append different document types:
https://docs.oasis-open.org/office/OpenDocument/v1.3/os/schemas/OpenDocument-v1.3-schema-rng.html#office-body-content
3. All used automatic and template styles must be copied as well, if not
already existent - or if the same in name but different in formatting
properties must be renamed
4. The footer/header of one document will likely win, right? I the
styles.xml.
5. How about the data of meta.xml? Depends on the metadata, right?
6. If both documents use the same @xml:id one has to be changed.
7. Directories of embedded documents as files have to be copied into the
new zip
8. ...there might be more challenges that will be revealed when
starting. Perhaps you take a look at the content.xml of a complex file
https://docs.oasis-open.org/office/OpenDocument/v1.3/os/part2-packages/OpenDocument-v1.3-os-part2-packages.odt
or even bigger
https://docs.oasis-open.org/office/OpenDocument/v1.3/os/part3-schema/OpenDocument-v1.3-os-part3-schema.odt
Perhaps starting to port the previous SimpleAPI functionality and
explaining its limitations might already help when it suits your needs. :-)
Any pull request is very welcome!
Godspeed!
Svante
…On Sat, 15 Feb 2025 at 16:29, HelmutL ***@***.***> wrote:
Hi,
most probably, I am dumb.
I had done this already using simple.TextDocument, but I want to get rid
of it.
But I cannot find out how to do using OdfTextDocuments. Or at least append
the content of the second document.
Thanks in advance
Helmut
—
Reply to this email directly, view it on GitHub
<#345>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGJNW4DVDF32ZOUVIZ2P6T2P5MMNAVCNFSM6AAAAABXGSHCDSVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZXHE3DSNZQG4>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
most probably, I am dumb.
I had done this already using simple.TextDocument, but I want to get rid of it.
But I cannot find out how to do using OdfTextDocuments. Or at least append the content of the second document.
Thanks in advance
Helmut
Beta Was this translation helpful? Give feedback.
All reactions