Map Information with XHTML
Posted: Thu Mar 14, 2024 7:30 pm
Hello guys!
I have spent some time on this one and I don't think it is directly related to DITA-OT but rather a way to gather info from a map during an XHTML transformation.
For the info, the same principles described below worked well in html5.
My XSLT uses a param defined in an external xml file:
During the transformation, my xslt needs to output info about the map:
However, I don't retrieve any relevant info in the logs, as if the map url wouldn't be retrieved.
Any suggestion or pointers would be highly appreciated. Would you have a plugin example to share with me that would be able to provide info from a map? Thanks a lot for your support!
I have spent some time on this one and I don't think it is directly related to DITA-OT but rather a way to gather info from a map during an XHTML transformation.
For the info, the same principles described below worked well in html5.
My XSLT uses a param defined in an external xml file:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<params xmlns:if="ant:if">
<param name="input.map.url" expression="${xhtml.map.url}" if:set="xhtml.map.url"/>
</params>
Code: Select all
<!-- map URL -->
<xsl:param name="input.map.url" as="xs:string?"/>
<!-- map document -->
<xsl:variable name="mapDoc" as="document-node()?">
<xsl:apply-templates select="document($input.map.url)" mode="normalize-map"/>
</xsl:variable>
<!-- Root template -->
<xsl:template match="/">
<xsl:message>Value of input.map.url: <xsl:value-of select="$input.map.url"/></xsl:message>
<xsl:if test="$input.map.url">
<xsl:if test="$mapDoc">
<xsl:message>Document loaded successfully.</xsl:message>
</xsl:if>
<xsl:if test="not($mapDoc)">
<xsl:message>Error loading the document at <xsl:value-of select="$input.map.url"/>.</xsl:message>
</xsl:if>
</xsl:if>
<xsl:if test="not($input.map.url)">
<xsl:message>Error: input.map.url parameter is not set.</xsl:message>
</xsl:if>
<xsl:apply-templates/>
</xsl:template>
However, I don't retrieve any relevant info in the logs, as if the map url wouldn't be retrieved.
Any suggestion or pointers would be highly appreciated. Would you have a plugin example to share with me that would be able to provide info from a map? Thanks a lot for your support!