Forum Discussion
URN123
12 years agoOccasional Contributor
Hello Michael,
In your groovy snippet, I did not completely understand what the following parts do.
// set default value here
def defaultVal = ""
for( item in holder.getDomNodes( "//*[. = '']" )){
holder.removeDomNodes("//"+item.nodeName)
}
1) Where is the defaultVal used?
2) I understood that in the for loop, you are getting an array of nodes into the holder and you are trying to remove the nodes. But I am not clear about what the Xpath mentioned in the for loop ( "//*[. = '']" ) is and ("//"+item.nodeName)?
In your groovy snippet, I did not completely understand what the following parts do.
// set default value here
def defaultVal = ""
for( item in holder.getDomNodes( "//*[. = '']" )){
holder.removeDomNodes("//"+item.nodeName)
}
1) Where is the defaultVal used?
2) I understood that in the for loop, you are getting an array of nodes into the holder and you are trying to remove the nodes. But I am not clear about what the Xpath mentioned in the for loop ( "//*[. = '']" ) is and ("//"+item.nodeName)?
Related Content
- 7 years ago
Recent Discussions
- 7 days ago