Trying to use conref pull with xrefs

Post here questions and problems related to editing and publishing DITA content.
hendersj
Posts: 8
Joined: Sat Nov 15, 2014 2:24 am

Trying to use conref pull with xrefs

Post by hendersj »

Hi,

I've got a couple DITA tasks that basically are the same procedure, but one task has two additional steps at the top.

Getting it to handle pulling the steps in using a conkeyref with a conrefend worked great - except for one problem; in the middle of the procedure, I have a stepsection element that contains a note that references the steps that follow it - something like:

Code: Select all

1. Click "Edit"
2. Enter a Name
3. Enter an address

Note: For steps 4-5, you must first expand the "Advanced" options control

4. Enter a phone number
5. Enter your zip code
6. Click "save"
In the note, I tried setting up the step numbers as

Code: Select all


<xref href="#topic/step4" type="step"/>-<xref href="#topic/step5" type="step"/>
And within my "edit" file (which is the 'source' in this example), it worked just fine. (I used "step" rather than "li" because Oxygen gave me a warning if I used "li"; the type didn't make a difference to the problem.)

The problem is that in my "create" file (which pulls the steps from the "edit" file), I ended up with something like this as my output:

Code: Select all


1. Cilck "User"
2. Click "Add"
3. Click "Edit"
4. Enter a Name
5. Enter an address

Note: For steps 4-5, you must first expand the "Advanced" options control

6. Enter a phone number
7. Enter your zip code
8. Click "save"
The xrefs end up linking to steps 4 and 5 in the other procedure (which makes sense, since the topic being referenced is the topic that holds those steps) - but how do I tell it to "use the current topic" when doing the pull?

I worked around this by creating two step blocks and inserting static text between them in my conref, but that seems kludgy.

What am I missing?
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Trying to use conref pull with xrefs

Post by Radu »

Hi,

About your decision to set a @type attribute to the xrefs, in my opinion it is not necessary, the publishing engine should infer the type from the referenced element.

I'm not sure there is a solution for your problem right now (other than workarounds like referencing two ranges of steps and adding a stepsection in the middle or rephrasing the content a little).

The DITA 1.3 standard (which will be officially released next year) has a new construct called same-topic reference. For example in your case a same-topic reference would look like this:

Code: Select all

<xref href="#./step4"/>
and if I properly understand how it works, it would properly connect to the element in the topic in which the reference would be expanded.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
GKlimeck
Posts: 23
Joined: Tue Mar 07, 2017 7:54 pm

Re: Trying to use conref pull with xrefs

Post by GKlimeck »

In Oxygen is it possible, in a TASK with steps, to process a xref in a conref?
https://www.oxygenxml.com/dita/1.3/spec ... ref%2Chref
That link says TOPIC. Does that exclude tasks?

I receive this error:
Description: [DOTX033E]: Unable to generate link text for a cross reference to a list item: 'task-A.xml#task_csd_r4p_hdb/step_n1v_v4r_hdb'
Start location: 141:45
URL: http://www.oxygenxml.com/DITA-messages. ... __DOTX033E

(Source)
task-A has steps 10 and 11. Step 11 has an xref to step 10.
<step id="step_n1v_v4r_hdb" importance="optional"><cmd>step alpha verbiage.</cmd></step>
<step id="step_gfg_1kx_jdb" importance="optional"><cmd>step beta verbiage <xref href="#./step_n1v_v4r_hdb" type="step"/>.</cmd></step>

Note use of #./ in the xref

(Target)
task-B step 7 is a conref to task-A step 10 with conrefend step 11
<step conref="task-A.xml#task_xb5_bhl_3db/step_n1v_v4r_hdb" conrefend="task-B.xml#task_xb5_bhl_3db/step_gfg_1kx_jdb"><cmd/></step>

The output of task-B should be steps 7 and 8, where step 8 has a xref to step 7.

Thank you.
GKlimeck
Posts: 23
Joined: Tue Mar 07, 2017 7:54 pm

Re: Trying to use conref pull with xrefs

Post by GKlimeck »

Appending earlier post:
Oxygen 18.1 with DITA-OT-2.4.4.
Best Regards-
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Trying to use conref pull with xrefs

Post by Radu »

Hi,

I tested and indeed the self link does not seem to properly work, even with DITA OT 3.0.3.
I added a comment on an already opened issue:

https://github.com/dita-ot/dita-ot/issues/2284

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