views:

51

answers:

3
+1  A: 

I'd say don't worry about it for now. If your XML files become large enough for this to matter, you probably won't end up using XPath anyways since it needs the entire document to be loaded into memory.

David
+1  A: 

I am not an expert, but relative paths and global paths which don't use the * or // operator's should have the same performance.

Andrew Keith
+2  A: 

For a trivial implementation, every step involving an element name is a string lookup; so the fewer, the better. Otherwise, it's very much implementation dependent. As well, relative paths are more idiomatic.

Pavel Minaev