Home Forums General XMetaL Discussion Deafult namespace and getnodesbyXPath Reply To: Deafult namespace and getnodesbyXPath

Derek Read

Reply to: Deafult namespace and getnodesbyXPath

For getNodesByXPath to find a particular node you will need to include the prefix for that node, yes. The default namespace is not assumed (or not automatically inserted into your XPath if you want to think of it that way, or perhaps alternatively — the API doesn't try to hunt around everywhere checking element names then walk back up the node tree to see if a particular node should have a particular prefix pre-pended because that would be far too expensive and slow).

You might think of the XML node tree (in memory) as having the prefix hard-coded (really not the best term) into each node's name, and so what you see in TagsOn view is about the best representation of the tree that you can get.