Created
November 4, 2014 15:54
-
-
Save grefel/e9a333d5332ddbd3ca0a to your computer and use it in GitHub Desktop.
Add standard namespaces for using evaluateXPathExpression() on #InDesign #XML subtrees
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addStandardNameSpace(xmlContainer) { | |
if( !xmlContainer.xmlAttributes.itemByName("xmlns:xml").isValid ) { | |
xmlContainer.xmlAttributes.add( "xmlns:xml", "http://www.w3.org/XML/1998/namespace" ); | |
} | |
if( !xmlContainer.xmlAttributes.itemByName("xmlns:aid").isValid ) { | |
xmlContainer.xmlAttributes.add( "xmlns:aid", "http://ns.adobe.com/AdobeInDesign/4.0/"); | |
} | |
if( !xmlContainer.xmlAttributes.itemByName("xmlns:aid5").isValid ) { | |
xmlContainer.xmlAttributes.add( "xmlns:aid5", "http://ns.adobe.com/AdobeInDesign/5.0/"); | |
} | |
return xmlContainer; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment