dita-ot-1.8.5 Temp File Attributes when using keyref for image tags
Posted: Tue Dec 06, 2022 12:13 pm
Hello Team,
I wanted some help/information about the the temp folder files that are being generated by dita-ot-1.8.5 version when running our customised XHTML plugin transformation locally using Oxygen Editor.
This use-case is about the insertion of a image into the Topic file which is Authored using Oxygen Editor , but in this case for referring the image name we are using Keyref (Not href) with a unique ID like below way inside the Topic file:
As we are migrating everything with href to be replaced with the keyref for the new oxygen plugin we are developing
<image placement="break" keyref="GUID-7EA66D7E-9077-4834-A35E-46AB4D5450A7" align="left" id="IMAGE_O2Q_1ZY_LRB" scalefit="yes">
<longdescref keyref="GUID-03E8E371-20CA-4CD2-A7FF-6E06886F7053"/>
</image>
Since we are using "keyref" inside the image that we inserted in the above Topic file, they are not getting resolved against the file name which is usually specified inside the href attribute of a keydef which is defined in the "guids.ditamap" like below way for eg:
<keydef keys="GUID-7EA66D7E-B742-4834-A35E-46AB4D5450A7"
href="Autonomous_Data_Guard=GUID-7EA66D7E-B742-4834-A35E-46AB4D5450A7=1.png" format="png"/>
And this guids.ditamap is referred as mapref inside the main ditamap file like below way:
<topicgroup processing-role="resource-only" toc="no">
<topicmeta>
<navtitle>System</navtitle>
</topicmeta>
<mapref href="guids.ditamap" format="ditamap"/>
</topicgroup>
----------------------
Also the temporary generated file for above Topic where I had inserted the image looks like below way, where it has both keyref & href values for image tag alone but not for longdescref:
<image placement="break" keyref="GUID-7EA66D7E-B742-4834-A35E-46AB4D5450A7" align="left"
id="IMAGE_O2Q_1ZY_LRB" scalefit="yes"
ishlabelxpath="./title | @alt | @href | @conref | self::*[@id and not(@varid)]/@id"
ishlinkxpath="@conref | @href[contains(parent::*/@class,' topic/image ') and not(parent::*/@conref)] | @href[contains(parent::*/@class,' topic/longdescref ') and not(parent::*/@conref)] | @href[contains(parent::*/@class,' topic/longquoteref ') and not(parent::*/@conref)]"
ishvarinusexpath="./@varref" ishvarassignedxpath="./@varid" ishtype="ISHIllustration"
class="- topic/image "
xtrf="/Users/koushiktm/Desktop/projects/dita-ot-1.8.5/ditaroot/longdescACMS/xml/About_AuDG=GUID-C57B9A6E-7471-4CDC-8F10-B8386538E31C=3.xml"
xtrc="image:1;26:133"
href="Autonomous_Data_Guard=GUID-7EA66D7E-B742-4834-A35E-46AB4D5450A7=1.png" format="png">
<longdescref keyref="GUID-03E8E371-20CA-4CD2-A7FF-6E06886F7053"
ishlabelxpath="./title | @alt | @href | @conref | self::*[@id and not(@varid)]/@id"
ishlinkxpath="@conref | @href[contains(parent::*/@class,' topic/image ') and not(parent::*/@conref)] | @href[contains(parent::*/@class,' topic/longdescref ') and not(parent::*/@conref)] | @href[contains(parent::*/@class,' topic/longquoteref ') and not(parent::*/@conref)]"
class="- topic/longdescref "
xtrf="/Users/koushiktm/Desktop/projects/dita-ot-1.8.5/ditaroot/longdescACMS/xml/About_AuDG=GUID-C57B9A6E-7471-4CDC-8F10-B8386538E31C=3.xml"
xtrc="longdescref:1;27:72"/>
</image>
Since my XSLT code for XHTML customised plugin looks for href attribute it works fine for the image tag I mentioned above since it has the href attribute for the temp Topic file generated above, it would fail for the longdescref which is again a keyref inside the image tag as mentioned above which usually contains the image descriptions usually.
'longdescrefs' are failing in this case with the below error when running the local transformations ,because XSLT code inside XHTML customised plugin is looking for href attribute and it doesn't find anything inside temp Topic file and fails eventually for longdescrefs but it's not the case with images as it has the href attribute being generated for it inside temp files.
Fatal Error! An empty sequence is not allowed as the value of variable $tempTopic
So if we are able to figure out on how to generate the href attribute for 'longdescref' keyref similar to that of image inside temp Topic file, it would resolve my issue without making any changes to the existing XSLT code from the customised XHTML plugin.
Appreciate your help!
Thanks & Regards,
Koushik
I wanted some help/information about the the temp folder files that are being generated by dita-ot-1.8.5 version when running our customised XHTML plugin transformation locally using Oxygen Editor.
This use-case is about the insertion of a image into the Topic file which is Authored using Oxygen Editor , but in this case for referring the image name we are using Keyref (Not href) with a unique ID like below way inside the Topic file:
As we are migrating everything with href to be replaced with the keyref for the new oxygen plugin we are developing
<image placement="break" keyref="GUID-7EA66D7E-9077-4834-A35E-46AB4D5450A7" align="left" id="IMAGE_O2Q_1ZY_LRB" scalefit="yes">
<longdescref keyref="GUID-03E8E371-20CA-4CD2-A7FF-6E06886F7053"/>
</image>
Since we are using "keyref" inside the image that we inserted in the above Topic file, they are not getting resolved against the file name which is usually specified inside the href attribute of a keydef which is defined in the "guids.ditamap" like below way for eg:
<keydef keys="GUID-7EA66D7E-B742-4834-A35E-46AB4D5450A7"
href="Autonomous_Data_Guard=GUID-7EA66D7E-B742-4834-A35E-46AB4D5450A7=1.png" format="png"/>
And this guids.ditamap is referred as mapref inside the main ditamap file like below way:
<topicgroup processing-role="resource-only" toc="no">
<topicmeta>
<navtitle>System</navtitle>
</topicmeta>
<mapref href="guids.ditamap" format="ditamap"/>
</topicgroup>
----------------------
Also the temporary generated file for above Topic where I had inserted the image looks like below way, where it has both keyref & href values for image tag alone but not for longdescref:
<image placement="break" keyref="GUID-7EA66D7E-B742-4834-A35E-46AB4D5450A7" align="left"
id="IMAGE_O2Q_1ZY_LRB" scalefit="yes"
ishlabelxpath="./title | @alt | @href | @conref | self::*[@id and not(@varid)]/@id"
ishlinkxpath="@conref | @href[contains(parent::*/@class,' topic/image ') and not(parent::*/@conref)] | @href[contains(parent::*/@class,' topic/longdescref ') and not(parent::*/@conref)] | @href[contains(parent::*/@class,' topic/longquoteref ') and not(parent::*/@conref)]"
ishvarinusexpath="./@varref" ishvarassignedxpath="./@varid" ishtype="ISHIllustration"
class="- topic/image "
xtrf="/Users/koushiktm/Desktop/projects/dita-ot-1.8.5/ditaroot/longdescACMS/xml/About_AuDG=GUID-C57B9A6E-7471-4CDC-8F10-B8386538E31C=3.xml"
xtrc="image:1;26:133"
href="Autonomous_Data_Guard=GUID-7EA66D7E-B742-4834-A35E-46AB4D5450A7=1.png" format="png">
<longdescref keyref="GUID-03E8E371-20CA-4CD2-A7FF-6E06886F7053"
ishlabelxpath="./title | @alt | @href | @conref | self::*[@id and not(@varid)]/@id"
ishlinkxpath="@conref | @href[contains(parent::*/@class,' topic/image ') and not(parent::*/@conref)] | @href[contains(parent::*/@class,' topic/longdescref ') and not(parent::*/@conref)] | @href[contains(parent::*/@class,' topic/longquoteref ') and not(parent::*/@conref)]"
class="- topic/longdescref "
xtrf="/Users/koushiktm/Desktop/projects/dita-ot-1.8.5/ditaroot/longdescACMS/xml/About_AuDG=GUID-C57B9A6E-7471-4CDC-8F10-B8386538E31C=3.xml"
xtrc="longdescref:1;27:72"/>
</image>
Since my XSLT code for XHTML customised plugin looks for href attribute it works fine for the image tag I mentioned above since it has the href attribute for the temp Topic file generated above, it would fail for the longdescref which is again a keyref inside the image tag as mentioned above which usually contains the image descriptions usually.
'longdescrefs' are failing in this case with the below error when running the local transformations ,because XSLT code inside XHTML customised plugin is looking for href attribute and it doesn't find anything inside temp Topic file and fails eventually for longdescrefs but it's not the case with images as it has the href attribute being generated for it inside temp files.
Fatal Error! An empty sequence is not allowed as the value of variable $tempTopic
So if we are able to figure out on how to generate the href attribute for 'longdescref' keyref similar to that of image inside temp Topic file, it would resolve my issue without making any changes to the existing XSLT code from the customised XHTML plugin.
Appreciate your help!
Thanks & Regards,
Koushik