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

jmp120
Posts: 5
Joined: Thu Aug 17, 2017 8:27 pm

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

Post by jmp120 » Tue Aug 18, 2020 6:36 pm

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?

Radu
Posts: 7218
Joined: Fri Jul 09, 2004 5:18 pm

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

Post by Radu » Wed Aug 19, 2020 9:40 am

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

jmp120
Posts: 5
Joined: Thu Aug 17, 2017 8:27 pm

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

Post by jmp120 » Wed Aug 19, 2020 3:10 pm

That did the trick. Thanks, Radu. I appreciate the help.

Post Reply