Be able to sort DITA Simple List Items
Are you missing a feature? Request its implementation here.
-
- Posts: 17
- Joined: Sun Mar 01, 2015 8:26 am
Be able to sort DITA Simple List Items
Post by lief.erickson »
Hello--
oXygen has to capability to sort ordered and unordered lists, but the <sl> / <sli> elements cannot be sorted. Can this functionality be added?
-Lief
oXygen has to capability to sort ordered and unordered lists, but the <sl> / <sli> elements cannot be sorted. Can this functionality be added?
-Lief
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Be able to sort DITA Simple List Items
Post by alex_jitianu »
Hello Lief,
I've added a feature request to offer the sort action for simple lists too. Until then, you could implement a sort author action based on an XSLT script, like this:
1. Create an Author action that uses the XSLTTransformOperation
2. Configuration details:
- when this XPath expression is true : ancestor-or-self::sl[1
- sourceLocation : ancestor-or-self::sl[1]
- targetLocation : ancestor-or-self::sl[1]
- invoke the operation : ro.sync.ecss.extensions.commons.operations.XSLTOperation
- script (you should change the xsl:sort from the script as needed):
3. Add this action on the toolbar.
Best regards,
Alex
I've added a feature request to offer the sort action for simple lists too. Until then, you could implement a sort author action based on an XSLT script, like this:
1. Create an Author action that uses the XSLTTransformOperation
2. Configuration details:
- when this XPath expression is true : ancestor-or-self::sl[1
- sourceLocation : ancestor-or-self::sl[1]
- targetLocation : ancestor-or-self::sl[1]
- invoke the operation : ro.sync.ecss.extensions.commons.operations.XSLTOperation
- script (you should change the xsl:sort from the script as needed):
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
version="2.0">
<xsl:template match="sl">
<xsl:copy>
<xsl:for-each select="sli">
<xsl:sort select="text()"></xsl:sort>
<xsl:copy-of select="."></xsl:copy-of>
</xsl:for-each>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Best regards,
Alex
-
- Posts: 17
- Joined: Sun Mar 01, 2015 8:26 am
Re: Be able to sort DITA Simple List Items
Post by lief.erickson »
Thanks for filing the feature request and, more immediately, the workaround, Alex. I've added an Author action as you've suggested, but when I select an <sl> element the action is not available. The action is grayed out on the toolbar (or not visible on the context menu). I've never created an Author action before. Can you confirm that I have configured the author action correctly?

-Lief

-Lief
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Be able to sort DITA Simple List Items
Post by alex_jitianu »
Hello Lief,
When you fully select an sl element the caret is positioned after it and the activation XPath doesn't work anymore. You can cover this situation with this activation XPath:
When this XPath expression is true:
Best regards,
Alex
When you fully select an sl element the caret is positioned after it and the activation XPath doesn't work anymore. You can cover this situation with this activation XPath:
When this XPath expression is true:
Code: Select all
oxy:current-selected-element()[contains(@class," topic/sl ")] or ancestor-or-self::sl[1]
Alex
-
- Posts: 17
- Joined: Sun Mar 01, 2015 8:26 am
-
- Posts: 9436
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Be able to sort DITA Simple List Items
Hi,
Just to update this thread, with Oxygen 17 you can now use the default sort operation to sort simple list items.
Regards,
Radu
Just to update this thread, with Oxygen 17 you can now use the default sort operation to sort simple list items.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
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