Bug 163102 - DocBookTemplate.stw needs to be changed to ODF
Summary: DocBookTemplate.stw needs to be changed to ODF
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: low minor
Assignee: Laurent Balland
URL:
Whiteboard: target:25.2.0
Keywords:
Depends on:
Blocks: Templates
  Show dependency treegraph
 
Reported: 2024-09-23 07:55 UTC by Mike Kaganski
Modified: 2024-12-01 20:01 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
A DocBook to try (6.38 KB, text/xml)
2024-10-05 10:04 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2024-09-23 07:55:46 UTC
We have an obsolete format .STW file in our distribution: share/xslt/docbook/DocBookTemplate.stw.

It would be nice to change it to a normal supported file format.
Comment 1 Laurent Balland 2024-10-05 08:41:51 UTC
Any idea how to test if the new file works correctly?
Comment 2 Mike Kaganski 2024-10-05 10:04:40 UTC
Created attachment 196902 [details]
A DocBook to try

I see some DocBook sample XMLs in https://github.com/developerworks/docbook_samples ; I attach one of them here. Likely, if you modify the template, the modifications will be visible in documents that you get when opening the DocBook XML in LibreOffice.
Comment 3 Laurent Balland 2024-10-12 14:55:48 UTC
(In reply to Mike Kaganski from comment #2)
> Created attachment 196902 [details]
> A DocBook to try
> 
> I see some DocBook sample XMLs in
> https://github.com/developerworks/docbook_samples ; I attach one of them
> here. Likely, if you modify the template, the modifications will be visible
> in documents that you get when opening the DocBook XML in LibreOffice.

Thanks Mike for your example. However, I failed correctly opening your XML file with the current DocBookTemplate.stw: another template seems to be used. For instance, according to DocBookTemplate.stw, headings should use Thorndale font whereas Albany font is used. My procedure:
1. File > Open
2. Select filter DocBook
3. Select ch00.xml
4. Open

Is there a better procedure?

Ongoing work is available:
https://gerrit.libreoffice.org/c/core/+/174847
but needs some polish. And has no effect :-(
Comment 4 Mike Kaganski 2024-10-13 05:22:01 UTC
(In reply to Laurent Balland from comment #3)

Indeed, I also was confused by the result. Yet, monitoring filesystem activity, I see that DocBookTemplate.stw is opened during import. So I guessed that it takes the parameters that we looked at from the XML document itself, as it should (it only needs the template for what is not defined in the document itself) - and made a test creating a custom style in the template (I named it ACustomStyleNotExistingInXML). After opening the XML, I found this style in the document -> success.
Comment 5 Commit Notification 2024-12-01 11:31:24 UTC
Laurent Balland committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3ee73a4d1ee2b11564df2c001514bcfd8b5c632c

tdf#163102 Replace DocBookTemplate.stw by build-in...

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.