XML Document traversal in java -


which preferable xml document traversal method in java ? using getelementsbytagname or using treewalker .

i've 1 treemodel. dom node root of treemodel. there 2 threads adding nodes it. 1 thread adding nodes according nodes added other thread.

e.g.

one thread adding nodes named app. other thread adding nodes according name attribute of nodes named app. nodes not added correctly. treemodel shows details in elements traversing through nodes.

note: adding app node according name attribute of node.

currently second thread, nodes taken calling getelementsbytagname. there advantage changing treewalker ?

i xpath. w3schools link here, javadocs here. tedious started factories , builders, imo write own utility class save on tedium. syntax traverse around expressive , powerful, , "standard" documentation.

if brave, check out beta groovy-like xpath-like project, not propose "the preferable". :-)

added: xpath query language selecting nodes xml document. traversing (moving around in) dom structure. however, op's updated requirements manipulating / modifying dom structure. xpath not fit there.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -