I'm creating an XREF to an anchor on the same page. I'm following the DITA standard practice of formatting it as #[topic]/[id]
<?xml version="1.0" ?>
<!DOCTYPE reference
PUBLIC '-//OASIS//DTD DITA Reference//EN'
'reference.dtd'>
<reference id="dummy-page">
<title> Dummy page title</title>
<refbody>
<section>
<title>Section One</title>
<xref format="" href="#dummy-page/target">
<b>DITA-formatted link</b>
</xref>
</section>
<section id="target">
<title>Section Two</title>
<div>Lower content</div>
</section>
</refbody>
</reference>
But, in the generated HTML (XHTML Transform in Oxygen-XML, or DITA-OT publish command) the two ids (xref and element-id) don't match, so the link does not work:
Any clues to what I'm doing wrong?
Aah, have got it. The format=""
in the XREF was preventing DITA-OT
from mangling the anchor to match the one used in the published HTML.
Providing format="dita"
or removing the format
attribute altogether generates valid code.