Sorting a glossary alphabetically

xephon
Posts: 98
Location: Münster/Germany

Sorting a glossary alphabetically

Fri Feb 27, 2015 4:12 pm

Hi,

it seems to me, that the DITA-OT cannot sort glossary entries (based on the map attribute xml:lang). Am I right? :shock:

I crawled the OT instance of Oxygen and it seems to me, that the glossaryProcessing.xsl of the net.sourceforge.dita4publishers.common.mapdriven plugin does what I need. Am I right? :D

If yes, I dunno understand, why this mechanism is not part of the basic XSLT set of the OT. :cry:

Best regards,
Stefan
Join the DOCTALES DITA development team :arrow: https://doctales.atlassian.net/wiki
Radu
Posts: 6050

Re: Sorting a glossary alphabetically

Mon Mar 02, 2015 10:53 am

Hi Stefan,

I'm not sure. How exactly are you referring the gloss entries in the DITA Map? Maybe I could take a look at the XSLT code.
You could also ask about this on the DITA Users List.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
xephon
Posts: 98
Location: Münster/Germany

Re: Sorting a glossary alphabetically

Tue Mar 03, 2015 11:36 am

Hi Radu,

the conversation 34193 of the mailing list elped me. Eliot clearly explained how to write a sorting mechanism. I'll write a XSLT and test it, maybe write a howto about it.

Best regards,
Stefan
Join the DOCTALES DITA development team :arrow: https://doctales.atlassian.net/wiki
Edwin
Posts: 21

Re: Sorting a glossary alphabetically

Tue Jun 14, 2016 12:44 pm

Hi in the proposed solution by Eliot Kimber he says:
Note also that for DITA 1.3 we will be adding the general <sort-as>
element to the utilities domain, which specializes from <data> and can
therefore go pretty much anywhere. The <sort-as> element contains (or
specifies in @value) text to be prepended to the base sort phase for the
element that contains it in order to construct the effective sort phrase.
For example:

Code: Select all

<glossentry id="topicid">
<glossterm>Ɗv<sort-as>delta-v</sort-as></glossterm>
<glossdef>Change in velocity, e.g., the result of acceleration
applied for a given period of time.</glossdef>
</glossentry>
As i try this <sort-as> is not accepted within a <glossterm>:

Code: Select all

Unexpected element "sort-as". The content of the parent element type must match "(boolean|keyword|apiname|option|parmname|cmdname|msgnum|varname|wintitle|ph|b|i|sup|sub|tt|u|codeph|synph|filepath|msgph|systemoutput|userinput|menucascade|uicontrol|q|term|abbreviated-form|tm|state|data|data-about|foreign|unknown|image)".
Does this mean the glossary sort-as option is still not a part of the DITA OT? I'm using oXygen 17.1
Radu
Posts: 6050

Re: Sorting a glossary alphabetically

Tue Jun 14, 2016 1:43 pm

Hi,

Oxygen 17.1 comes with both DITA Open Toolkit 1.8 and DITA Open Toolkit 2.x bundled with it.
In order to use DITA 1.3 validation you will need to also use DITA OT 2.x for publishing, in the Oxygen Preferences->"DITA" page you can change the default used DITA OT to be DITA OT 2.x.
After this your sample glossentry should be valid. This does not mean that the output will take it into account, DITA OT 2.x does not yet implement the entire DITA 1.3 specs.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Edwin
Posts: 21

Re: Sorting a glossary alphabetically

Tue Jun 14, 2016 2:38 pm

Hi,
thank you, I can sort-out the output to pdf later. When i do set the preferences to DITA OT 2x my transformation comes back with a lot of errors.

I've done a lot of customization, including my own commons.xsl. Still after setting the preferences I receive an error

Code: Select all

Description Cannot compare xs:integer to xs:untypedAtomic
Severity Fatal
System ID C:\Program Files\Oxygen XML Editor 17\frameworks\dita\DITA-OT2.x\plugins\org.dita.pdf2\xsl\fo\commons.xsl
Scenario Custom Dita to PDF
Input file Z:\en-US\Test_Map.ditamap
Engine name DITA-OT
Start location line: 1218, column: 69
Why does it refer to the standard commons file when i have created a customized file and have included this in the custom.xsl

Code: Select all

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format" version="2.0">
<xsl:import href="../layout-masters.xsl"/>
<xsl:import href="commons.xsl"/>
<xsl:import href="root-processing.xsl"/>
<xsl:import href="root-processing_axf.xsl"/>
<xsl:import href="root-processing_fop.xsl"/>
<xsl:import href="root-processing_xep.xsl"/>
<xsl:import href="static-content.xsl"/>
<xsl:import href="front-matter.xsl"/>
<xsl:import href="tables.xsl"/>
<xsl:import href="task-elements.xsl"/>
<xsl:import href="toc.xsl"/>
<xsl:import href="glossary.xsl"/>

<!--table title below-->
<xsl:template match="*[contains(@class,'topic/table')]/*[contains(@class,'topic/title')]"/>

<!--remove glosbody from pdf output-->
<xsl:template match="*[contains(@class, ' glossentry/glossBody ')]"/>

</xsl:stylesheet>
Can I solve these issues by moving to oXygen 18?
Radu
Posts: 6050

Re: Sorting a glossary alphabetically

Tue Jun 14, 2016 2:45 pm

Hi,

This means that the customizations you made for DITA OT 1.8 are no longer compatible with DITA OT 2.x.
Usually a migration involves comparing all the templates you have overwritten with the ones in DITA OT 2.x and update them.
About this particular problem you are obtaining, please read this issue report and the suggested fix:

https://github.com/dita-ot/dita-ot/issues/2238

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: No registered users and 5 guests