Referencing previous steps

Post here questions and problems related to editing and publishing DITA content.
mdslup
Posts: 167
Joined: Tue Mar 06, 2018 1:34 am

Referencing previous steps

Post by mdslup »

I'm working on a task topic. In some of the later steps, I want to refer back to earlier steps. I don't want to hardcode the step number....if I add a new step, those numbers will become wrong. So I'm setting up an xref to get the step number, like so:

<cmd>Reconnect any connectors that were disconnected in step <xref href="#TaskID/StepID"/>.</cmd>

My goal is to create a PDF document that will be printed and mailed to a customer. In this case, when I run my PDF transformation, the step numbers come out blue. I think it looks bad to have blue text (obviously a link) in a printed document. I was able to change the link-attrs.xsl file to make them black. Is this the best that I can do? I know that they are still considered links because when I hover over them while looking at the PDF in Adobe, the cursor icon changes.

Does Oxygen have a way to reference another step's *number* that is not link-based? Additionally, in my above example, the step number that appears in Author mode is wrong, but the step number in the generated output.

I can live with both of these things, but just wanted to make sure I wasn't missing anything.
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: Referencing previous steps

Post by Radu »

Hi,

So:
Is this the best that I can do? I know that they are still considered links because when I hover over them while looking at the PDF in Adobe, the cursor icon changes.
Probably with more XSLT customization you can have them treated as plain text content or set a special @outputclass attribute value on the xref to state that you do not want it to appear as a link in the published output, but you would need more work for this and it may not be worth it.
Does Oxygen have a way to reference another step's *number* that is not link-based?
No, the DITA standard only has the possibilities to use <xref> or <link> to refer to various target elements and have that link text be automatically filled.
Additionally, in my above example, the step number that appears in Author mode is wrong, but the step number in the generated output.
If you give me a small DITA content example with the way in which the Author visual mode is mistaken when the step number is computed we could try to fix it in a future version.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
mdslup
Posts: 167
Joined: Tue Mar 06, 2018 1:34 am

Re: Referencing previous steps

Post by mdslup »

Thanks. First, here is a screenshot (Using XML Editor 20.0, build 2018032903): https://i.imgur.com/17oKOIg.png

The code is below. You can see that the "refer to" in step 5 should point to step 1, but it points to step 2.

When testing this, I first set up this file, and linked to the step. Oxygen correctly put the step number. Then I added some more steps in-between, and Oxygen didn't "refresh" the step number.

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task
id="StepRefTest">
<title>Step Ref Test</title>
<taskbody>
<steps>
<step
id="ReferredToStep">
<cmd>Do a thing.</cmd>
<stepxmp><image
href="StepRefImage.png"
id="image_ij3_nkw_xdb"/></stepxmp>
</step>
<step>
<cmd>Do a thing.</cmd>
</step>
<step>
<cmd>Do a thing.</cmd>
<stepxmp><image
href="StepRefImage.png"
id="image_c2v_skw_xdb"/></stepxmp>
</step>
<step>
<cmd>Do a thing.</cmd>
<stepxmp><image
href="StepRefImage.png"
id="image_inv_skw_xdb"/></stepxmp>
</step>
<step>
<cmd>Do a thing. Refer to step <xref
href="#StepRefTest/ReferredToStep"/></cmd>
</step>
<step>
<cmd>Do a thing.</cmd>
</step>
</steps>
</taskbody>
</task>
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: Referencing previous steps

Post by Radu »

Hi,

Thanks for the example, I understand now. Indeed we do not refresh the reference counter every time you add new steps to the current document. I will add an internal issue to look into this. In the meantime in the "DITA" main menu there is a "Refresh References" which you can manually call.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
mdslup
Posts: 167
Joined: Tue Mar 06, 2018 1:34 am

Re: Referencing previous steps

Post by mdslup »

Oh, great that's super helpful. Thanks for the discussion.
Post Reply