XPath

I'm working on parsing some XML files today.  I'm learning more about XPath which is really fun.  It kind of reminds me of regex for string parsing.  You *could* write your own loops to process XML or strings, but xPath and regex are much more ... fun(?).  Plus, less is more right?  If you can get what you need with one easy to understand line of code as opposed to several lines... great!  XPath is nice and readable, but not as fast as SAX.

Here's a quick reference to XPath:
http://www.w3schools.com/xpath/xpath_syntax.asp

Comments

Popular Posts