Conref Reuse

shiney_98
Posts: 8
Joined: Thu Sep 09, 2021 12:03 pm

Conref Reuse

Post by shiney_98 » Mon Oct 18, 2021 4:43 pm

Hi,

I created a source topic



I created a target topic and used conref attribute to make use of the tags.



I created map and used both source and target topics and created a bookmap and inserted the map.

After Publishing the bookmap, I am not able to get the text processed properly in the PDF.

This is happening only for conref attributes.
Last edited by shiney_98 on Tue Oct 19, 2021 10:33 am, edited 1 time in total.

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

Re: Conref Reuse

Post by Radu » Tue Oct 19, 2021 7:58 am

Hi,

This is probably a duplicate of: post63695.html

I'm testing with Oxygen 24 and its bundled publishing engine, without any customizations.
I created a topic "t1.dita" with the content:

Code: Select all

<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="t1">
    <title>T1</title>
    <body>
        <p></p>
        <section id="section_nmx_w4q_hrb">
            <title>S1</title>
            <div><b id="b_yzp_y4q_hrb">DIV REUSE CONTENT</b></div>
        </section>
    </body>
</topic>
and a topic "t2.dita" with the content:

Code: Select all

<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="t2">
    <title>T2</title>
    <body>
        <div><b conref="t1.dita#t1/b_yzp_y4q_hrb"/></div>
    </body>
</topic>
I referenced both topics in a DITA Map and produced PDF using either the "DITA Map PDF - based on XSL-FO" or the "DITA Map PDF - based on HTML5 & CSS" predefined transformation scenarios. In both cases the bold text was properly rendered in the "t2.dita".

If you have the same problem using my samples, maybe you have some PDF customization interfering and causing this problem.

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

shiney_98
Posts: 8
Joined: Thu Sep 09, 2021 12:03 pm

Re: Conref Reuse

Post by shiney_98 » Fri Oct 22, 2021 11:22 am

Hi,

So my source topic is like this

topic1.dita:

<section>
<p id="reuse"> <b id="conref"> Para </b></p>
</section>

And when i use the conref in the target topic, the xml in text mode for the conref is shown like this

topic2:

<p conref = topic1.dita#topic1/reuse />

The id of b tag is getting processed inside the conref element.

I'm currently using this as my xsl.

<xsl:if test="@conref=''">
<xsl:variable name="id" select="substring-after($consub, '/')"/>
<xsl:value-of select="//p[$id = @id]"/>
</xsl:if>

Is there any other solution available for the b tag to get inside ?

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

Re: Conref Reuse

Post by Radu » Fri Oct 22, 2021 11:31 am

Hi,

The XML content of the topic indeed looks like this:

Code: Select all

<p conref = topic1.dita#topic1/reuse />
DITA content is published usually using the DITA Open Toolkit. The DITA Open Toolkit has a pre-processing state in which it expands all content references and creates in a temporary files folder an equivalent of the topic with all content references resolved:

https://www.dita-ot.org/3.6/reference/p ... ssing.html

So if for example I create a plugin for the DITA Open Toolkit which has an XSLT processing stage, that stage will be applied over some topics located in the temporary files folder which have all conrefs expanded.
If you have not implemented a DITA OT plugin before, some links which may be useful:

https://www.dita-ot.org/dev/topics/custom-plugins.html
https://www.youtube.com/watch?v=SK9_FiJiKQs

But if you apply your XSLT directly over the original DITA topic, you will need to expand the conref on your own, directly from the XSLT code.

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

Post Reply