Page 1 of 1

DocBook / xml:base / rename problem

Posted: Tue Apr 28, 2020 9:03 pm
by ottoh
Greetings,
I believe there is a bug in renaming files, which have MasterFiles, and which have xml:base.

TL;DR
When renaming a file in the project browser that is xi:included using an href defined based upon xml:base, it "correctly" gives it a relative path from the current location that starts with ../. If there are multiple sub-directory levels, then there would multiple parent directory references (ie multiple ../).

This "correct" file path relative to the file which is xi:includeing it, is however incorrect from an XML xi:include perspective which is viewing relative paths based upon xml:base and not relative from the file which is referencing it.


Very simple example is shown in images below.

Initial project - three files, two sub-directories. Everything works.
img-1-bk-ch-sec.png
img-1-bk-ch-sec.png (72.55 KiB) Viewed 2979 times

Rename sec-issue.xml to sec-issue-bar.xml which gives rename preview screen shown in image below. Note that the new path, "correctly" is ../subDir2/sec-issue-bar.xml, however that is incorrect from the perspective of xi:include.
img-2-rename-preview.png
img-2-rename-preview.png (72.6 KiB) Viewed 2979 times

Accepting the change, obviously creates an error in attempting to include a file with a "correct" path of
../subDir2/sec-issue-bar.xml
which with the following
xml:base="/D:/Users/otto/product-bug-doc/oxygenxml/dcbk_issue-xmlbase-rename/"
results in a file path of
/D:/Users/otto/product-bug-doc/oxygenxml/dcbk_issue-xmlbase-rename/../subDir2/sec-issue-bar.xml
which is really
/D:/Users/otto/product-bug-doc/oxygenxml/subDir2/sec-issue-bar.xml

img-3-inc-path-error.png
img-3-inc-path-error.png (87.46 KiB) Viewed 2979 times

I'm going to guess that this is not simply a DocBook issue, but an issue with the use of MasterFiles, xml:base, and xi:include.

Am I correct in assuming this is a bug, or am I doing something wrong?
How might I be able to do a rename without this occurring?

Best regards,

..Otto

Re: DocBook / xml:base / rename problem

Posted: Tue May 26, 2020 11:47 am
by Radu
Hi Otto,

You are right, the renames and moves of resources should take the xml:base into account when computing the referenced paths. I reproduced the problem on my side and added an internal issue to look into it. We'll update this forum thread when a fix is available.

Regards,
Radu

Re: DocBook / xml:base / rename problem

Posted: Tue Jun 09, 2020 1:34 am
by ottoh
Radu, Thank you for verifying.

I look forward to a fix.
This is really important for me, since any rename needs to be manually fixed, greatly decreasing productivity.

Thank you for a great product.

Best regards,

..Otto

Re: DocBook / xml:base / rename problem

Posted: Tue Jun 09, 2020 10:46 am
by Radu
Hi Otto,

Right, I will try to increase its priority.

Regards,
Radu