Map Information with XHTML
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 105
- Joined: Thu Jan 20, 2022 12:36 pm
Map Information with XHTML
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!
------
Gaspard
Gaspard
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Map Information with XHTML
Hi Gaspard,
You did not give enough information about how your XSLT is called from the build files.
Is your XSLT stylesheet getting called at all? If you make it not wellformed XML, maybe remove a "<" from it and publish do you get an error reported that the XSLT is invalid?
If it is used, looking inside the XSLT you seem to attempt to load the document early on, before you attempt to debug the problem using xsl:messages:
Regards,
Radu
You did not give enough information about how your XSLT is called from the build files.
Is your XSLT stylesheet getting called at all? If you make it not wellformed XML, maybe remove a "<" from it and publish do you get an error reported that the XSLT is invalid?
If it is used, looking inside the XSLT you seem to attempt to load the document early on, before you attempt to debug the problem using xsl:messages:
Code: Select all
<xsl:variable name="mapDoc" as="document-node()?">
<xsl:apply-templates select="document($input.map.url)" mode="normalize-map"/>
</xsl:variable>
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 105
- Joined: Thu Jan 20, 2022 12:36 pm
Re: Map Information with XHTML
Hi Radu,
Yes, my XSLT is called in the plugin.xml as well as the param used to retrieve the map url:
Basically, I have the same plugin used for an HTML5 transtype and it worked well.
The difference lies in the map.url for the XHTML transtype which doesn't seem to be retrieved.
Yes, my XSLT is called in the plugin.xml as well as the param used to retrieve the map url:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<plugin id="com.antidot.othermeta.xhtml">
<feature extension="dita.conductor.xhtml.param" file="buildXhtmlParam.xml"/>
<feature extension="dita.xsl.xhtml" file="./xsl/get-move-othermeta.xsl"/>
</plugin>
The difference lies in the map.url for the XHTML transtype which doesn't seem to be retrieved.
------
Gaspard
Gaspard
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Map Information with XHTML
Linking here to your post on the DITA OT discussions list:
https://github.com/orgs/dita-ot/discussions/4438
If time allows I will try to look into this later on and reply there in order not to have two duplicate threads.
Regards,
Radu
https://github.com/orgs/dita-ot/discussions/4438
If time allows I will try to look into this later on and reply there in order not to have two duplicate threads.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Map Information with XHTML
In general, you can try to debug this further. If you have run the DITA OT "-install" to integrate the plugin you can use for example Oxygen's "Find/Replace in Files" to see where in the DITA OT XSLTs your "get-move-othermeta.xsl" is now referenced, it should now be referenced somewhere in this XSLT stylesheet "DITA-OT/plugins/org.dita.xhtml/xsl/dita2html-base.xsl". Maybe there are other stylesheets with higher priority which override the same xsl template match as yours.
Regards,
Radu
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service