in reply to Re: The best way to handle different type of XML files
in thread The best way to handle different type of XML files
XML::Simple can't even handle elements that can repeat a variable number of times without making a mess. You need to hold it's hand or you won'tbe able to predict the structure you'll get. It's much less trouble to get a consistent tree every time. That's why I use (the much faster) XML::LibXML.
As for the variations between the document formats, it becomes a question of using the right XPath for the document in question. You can use a lookup table for that.
my $xpath = $xpath_by_doctype{$doctype};
Other solutions based on XPath (like XML::Twig) should do fine too.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: The best way to handle different type of XML files
by mpeever (Friar) on Nov 21, 2009 at 20:22 UTC | |
by ikegami (Patriarch) on Nov 21, 2009 at 23:14 UTC | |
by mpeever (Friar) on Nov 22, 2009 at 22:02 UTC |