I'm writing some code that retrieves a shipping rate quote in XML format. All I need from this XML tree ( 10-20KB in size ) is a single value from a node in the middle of it. The two approaches I've considered is parsing the tree with XML::LibXML, or running a very simple regex, along the lines of
/<specificParentNode>.*<nodeINeed>(\d+)</nodeINeed>/Is there any reason why I should do the XML parser over the regex approach? My main reason for wanting to use the regex approach is ease of writing it.
In reply to XML parsing vs regex by derekstucki
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |