href to section title element breaking

Post here questions and problems related to editing and publishing DITA content.
msambasiva
Posts: 87
Joined: Tue Jul 17, 2018 6:57 am

href to section title element breaking

Post by msambasiva »

Hi,

DITA-OT-2.4.6
We have custom plugin for HTML output based outof org.dita.html5.

We have a broken link to a section title in the HTML output. The two links are failing. Can we have href to any element id? or is there any restrictions to href value? Below is the sample,
<section>
<title id="GUID-61F947E8">Topics:</title>
<ul id="UL_QMX">
<li>
<xref href="#./GUID-CB4EC4EA" type="title">Provided Mappings</xref>
</li>
<li>
<xref href="#./GUID-E512C7F8" type="title">Files for Import Management in CX Sales</xref>
</li>
</ul>
</section>
<section>
<title id="GUID-CB4EC4EA-C074">Provided Mappings</title>
</section>

<section>
<title id="GUID-E512C7F8">Files.... </title>
</section>

When I refer to other section id , it's working fine.

The above scenario is working fine in PDF.

Thanks,
Samba.
Radu
Posts: 9018
Joined: Fri Jul 09, 2004 5:18 pm

Re: href to section title element breaking

Post by Radu »

Hi Samba,

Looking at this link:

Code: Select all

<xref href="#./GUID-CB4EC4EA" type="title">Provided Mappings</xref>
there does not seem to be any element in your example with ID GUID-CB4EC4EA.
Also you should try setting ID's directly on the <section> elements and linking to the sections instead of the section titles.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
msambasiva
Posts: 87
Joined: Tue Jul 17, 2018 6:57 am

Re: href to section title element breaking

Post by msambasiva »

Thanks Radu.
It's my fault. Actual section should be as below,
<section>
<title id="GUID-CB4EC4EA">Provided Mappings</title>
</section>

It's working fine if we refer to section id from href. But failing when we refer to title id. Logically it should work if we refer to any element id.
The content is coming from other teams which we don't have control to changes as we required. It would be great if you can provide any suggestion to make it work for referencing to title id(s).

Thanks,
Samba.
Radu
Posts: 9018
Joined: Fri Jul 09, 2004 5:18 pm

Re: href to section title element breaking

Post by Radu »

Hi Samba,

I reproduced the problem and added a new issue for it:
https://github.com/dita-ot/dita-ot/issues/3612

maybe you can follow the advice in the issue and overwrite that entire template from your HTML5 plugin XSLTs.
As another workaround maybe you can create a Schematron schema showing errors when the @id attribute is set on a DITA title element and run it over the DITA content from time to time to identify and fix the references to point to the section instead.


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