Home Forums General XMetaL Discussion node list issues/questions Reply To: node list issues/questions

russurquhart1

Reply to: node list issues/questions

Not to beat a dead horse, but trying to get my mind around this. In a previous script i wrote something like:

var nodelist = ActiveDocument.getNodesByXPath(“//entry[@role='hdr']/ancestor::GenTable[1]”);

      var current = 0;
      var number_corrected = 0;
      while (current < nodelist.length)
      {
        var current_node = nodelist.item(current);
          current_node.setAttribute(“role”, “Register”);
          current_node.setAttribute(“columns”, “1”);
          number_corrected = number_corrected + 1;
          current = current + 1;
      }

I iterate through the nodelist, and this works. (From what you said previously, i would think it wouldn't.) Is this list not affected because the nodes that were the basis for the selection, their attribute values, remain unchanged and only attribute values for their ancestors are changed?

Sorry still a little confused.

Thanks,

Russ

Reply

Products
Downloads
Support