Page 1 of 1

DITA processing instruction provided by Astoria to include in webhelp output

Posted: Wed Jun 19, 2019 9:04 pm
by steinbacherGE
Hi There,

I need to modify the oxygen webhelp DITA-OT plugin to include information that is provided by Astoria within a processing instruction.

Example:

<task>
<?ASTDOCREVINFO __docVernName="1.6" __docVerDesc="Description goes here" __docVerUser="Leroy Steinbacher" __docVerDate="June 19, 2019 12:51:00 PM"?>

So far I've modified ..\plugins\com.oxygenxml.webhelp\xsl\dita\a_pluginOverrides.xml to check for the PI.

xsl:template match="processing-instruction('ASTDOCREFINFO')"

That's as far as I've gotten so far. Any suggestions?

Thanks,


Leroy Steinbacher

Re: DITA processing instruction provided by Astoria to include in webhelp output

Posted: Thu Jun 20, 2019 2:16 am
by steinbacherGE
So far I've figure this out. I was able to get the 2 attribute values I needed. I then attached those values to variables and tested them in the output.

<xsl:variable name="astVersion"/>
<xsl:variable name="astDate"/>

<xsl:template match="processing-instruction('ASTDOCREVINFO')">

Version: <xsl:value-of select="substring-before(substring-after(., '__docVerName=&quot;'), '&quot;')"/>
Date: <xsl:value-of select="substring-before(substring-after(., '__docVerDate=&quot;'), '&quot;')"/>

<xsl:variable name="astVersion" select="substring-before(substring-after(., '__docVerName=&quot;'), '&quot;')"/>
<xsl:variable name="astDate" select="substring-before(substring-after(., '__docVerDate=&quot;'), '&quot;')"/>

Variable Version: <xsl:value-of select="$astVersion"/>
Variable Date: <xsl:value-of select="$astDate"/>

</xsl:template>

The issue I'm facing now is I need the values of these variables in a different template later in the xsl file.

Any suggestions?

Can I define global variables and get values from the PI attributes outside of a template?

Thanks,

Leroy

Re: DITA processing instruction provided by Astoria to include in webhelp output

Posted: Thu Jun 20, 2019 7:31 am
by Radu
Hi Leroy,

I answered you here:

https://stackoverflow.com/questions/566 ... 0#56679010

Ideally you should try not to post the same question in multiple places. Both the DITA users list and stack overflow are good places where to ask DITA XSLT related questions. The DITA Users List is more oriented towards DITA processing, for example on stack overflow you may get answers from people who do not know what DITA is but they know XSLT.

Regards,
Radu