Quantcast
Channel: PTC Community : All Content - Arbortext
Viewing all articles
Browse latest Browse all 1645

How to: Swap two child nodes of element by using Styler APP

$
0
0

I have two div elements in section element. I would like to change order of those two div elements depending is element in even or odd pages. When I run PDF publish I don't get any errors. Any ideas or workarounds how to do this?

 

 

var currentNode = formatting.currentXMLNode;

 

if (formatting.currentPage.pageNumber % 2 == 0) {

//note! first element in section is title

  if (currentNode.childNodes[2]!=null && currentNode.childNodes[1] != null){

    currentNode.insertBefore(currentNode.childNodes[2],currentNode.childNodes[1]);

    formatting.write(currentNode.nodeName + " Child node1:" + currentNode.childNodes[1].nodeName + " Child node2:" + currentNode.childNodes[2].nodeName);

  }

 

}


Viewing all articles
Browse latest Browse all 1645

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>