DITA processing instruction provided by Astoria to include in webhelp output

Here should go questions about transforming XML with XSLT and FOP.
steinbacherGE
Posts: 12
Joined: Tue Mar 13, 2018 6:07 pm

DITA processing instruction provided by Astoria to include in webhelp output

Post by steinbacherGE » Wed Jun 19, 2019 9:04 pm

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

steinbacherGE
Posts: 12
Joined: Tue Mar 13, 2018 6:07 pm

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

Post by steinbacherGE » Thu Jun 20, 2019 2:16 am

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

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

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

Post by Radu » Thu Jun 20, 2019 7:31 am

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply