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)

dcramer

Reply to: Script Example: Sort Lowercase CALS Tables (DITA, DocBook, etc)

Here's a fix to hide entity references:

[code]
244a245,259
>
> // HACK ALERT!!
> // Here we replace any ampersands in the source
> // XML with a placeholder value, “@@[email protected]@”
> // to keep MSXML from trying to resolve the entity.
> // We'll change it back later. However we first
> // make sure that the string @@[email protected]@ does
> // not already exist in the table.
> if(tableStr.match(/@@[email protected]@/)){
> Application.Alert(“This table already contains the string @@[email protected]@.nThis macro reserves the [email protected]@[email protected]@ to hide entity references.”);
> return;
> }else{
> tableStr = tableStr.replace(/&/g,'@@[email protected]@');
> }
>
269c284
< rngWork.TypeText(sortedTable);

> rngWork.TypeText(sortedTable.replace(/@@[email protected]@/g,'&'));
[/code]

Reply

Products
Downloads
Support