XML, the Perl Way




  perl wtr2_pyx_simple


This example uses the XML::PYX manpage in a kinda devious way: it reimplements a simplified version of the XML::Simple manpage's XMLin that will work for the class of documents we are processing. The code is then exactly the same as the one for wtr2_simple.

Note that this version of XMLin does not offer any option besides a limited version of forcearray. It will not for exemple use keyattr.

I guess this was pretty easy to write as it worked the first time I run it, much to my surprise I should say ;--)

Generally It illustrates the fact that it often pays to write a layer on top of generic modules to adapt them to your specific needs (please, just don't release it on CPAN! Chances are that it is really specific to your problem or to the way you like to code, and it will only add to the already considerable confusion in the XML namespace).


Michel Rodriguez <mirod@xmltwig.com>


This code is Copyright (c) 2003 Michel Rodriguez. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Comments can be sent to mirod@xmltwig.com


the XML::PYX manpage, the XML::Simple manpage, wtr2_simple

Ways to Rome 2 - Kourallinen Dollareita: http://www.xmltwig.com/article/ways_to_rome_2/