Home › Forums › XMetaL Tips and Tricks › Script Example: Sort Lowercase CALS Tables (DITA, DocBook, etc) › Reply To: Script Example: Sort Lowercase CALS Tables (DITA, DocBook, etc)
Reply to: Script Example: Sort Lowercase CALS Tables (DITA, DocBook, etc)September 22, 2009 at 8:44 pm
Interesting find. I didn't even think about entities and because MSXML is involved here that adds to the complexity. Your logic on the workarounds seem doable in script, but I'm not sure I will try yet.
At this point I think the script is useful for the majority of people (the 80/20 rule probably applies, or maybe even 90/10 as the majority of our DITA clients are not specializing yet, though there are quite a few). A large portion of the population also doesn't use entities so I guess they'd be fine too.
However, I suppose I should at least try to stop the table from being deleted. I assume Undo works to restore the table?
There are other completely different approaches I've tried, one of which was a pure JScript string manipulation. It was about 1/2 done maybe when I had what I thought at the time was a flash of genius to use XSLT instead. I might go back to that other code and see if it might work better or be easier to implement (and ultimately it would be nice to have this type of functionality right inside the product in the form of some new APIs, though I don't see that happening anytime soon).
One nice thing about the XSLT version is that it would likely be fairly easy to extend it to sort on more than one column at a time (because the MSXML support for XSLT has such a thing built-in).