Page 1 of 1

DITA-OT Publishing Fails with '#' in xrefed email address

Posted: Tue Aug 18, 2020 6:36 pm
by jmp120
Our company has email lists that are in the format #email_list_name@company.com.

When I add an xref to this email in the format <xref format="html" href="mailto:#email_list_name@company.com" scope="external'/>, the publishing fails. I don't get much information:

Code: Select all

BUILD FAILED
D:\InfoShare\App\Utilities\DITA-OT\GKS-2.5.4\build.xml:45: The following error occurred while executing this line:
D:\InfoShare\App\Utilities\DITA-OT\GKS-2.5.4\plugins\org.dita.base\build_preprocess.xml:55: Failed to run pipeline: Expected scheme-specific part at index 7: mailto:#email_list_name@company.com
If I eliminate the <xref> and simply have in the email in the block element, it publishes fine. If I eliminate the '#', it publishes fine but is no longer the correct email address. So, obviously the # is the issue. I suspect this is because # is used to specify an id for a sub-element when referencing a topic. So, maybe it's reserved. But is there away around this such as an escape character or something?

Re: DITA-OT Publishing Fails with '#' in xrefed email address

Posted: Wed Aug 19, 2020 9:40 am
by Radu
Hi,

According to the DITA specs all xref @href attributes need to be valid URIs and "#" is not part of a valid URI:

https://www.oxygenxml.com/dita/1.3/spec ... ssing.html

Maybe you can escape "#" to "%23" in the DITA content:

Code: Select all

<xref format="html" href="mailto:%23email_list_name@company.com" scope="external"/>
From what I tested the transformation should finish and clicking the link should properly work. You can set some text inside the xref to take control over how the link text looks like in the HTML.

Regards,
Radu

Re: DITA-OT Publishing Fails with '#' in xrefed email address

Posted: Wed Aug 19, 2020 3:10 pm
by jmp120
That did the trick. Thanks, Radu. I appreciate the help.