DocBook / xml:base / rename problem

ottoh
Posts: 7
Joined: Thu Nov 19, 2015 11:31 pm

DocBook / xml:base / rename problem

Post 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 2988 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 2988 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 2988 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
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: DocBook / xml:base / rename problem

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ottoh
Posts: 7
Joined: Thu Nov 19, 2015 11:31 pm

Re: DocBook / xml:base / rename problem

Post 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
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: DocBook / xml:base / rename problem

Post by Radu »

Hi Otto,

Right, I will try to increase its priority.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply