[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-xml
Subject:    Re: totally newbie question: what should I learn?
From:       Daniel Bibbens <dbibbens () xobjex ! com>
Date:       2003-06-27 14:15:06
[Download RAW message or body]

I agree with Grant but may be able to distill it further; I have been
using XML::LibXML and XML::LibXSLT exclusively for about 6 months and
am very happy with performance, and standards compliance. The items on
your list are covered. If you want XML Schema support you will need to
wait a bit.

"Grant McLean" <grant@mclean.net.nz> writes:

> Marco Baroni wrote:
>> So, I would be very grateful if y'all could suggest a minimum set of
>> modules that somebody like me could be happy with, perhaps at the cost
>> of some leftover ad-hocness for some of the tasks.
>
> Are you familiar with the Perl-XML FAQ?  It offers advice on selecting
> the right tools.
>
>   http://perl-xml.sourceforge.net/faq/
>
>> These are the things that are important to me (I guess that these are
>> mostly very obvious things, but I suspect they rule out XML:Simple...)
>
> Bear in mind that there is no one tool that is right for all jobs.  In some
> cases even XML::Simple can be a good fit.
>
>> - validation via dtd
>
> XML::LibXML supports DTD validation.  It also give you a DOM with XPath
> support which makes it a pretty good general purpose solution.
>
>> - text-to-xml-to-text conversion
>
> Not quite sure what you mean by this.
>
>> - handling relatively large files (once in a while, hundreds of MBs)
>
> The memory requirements of DOM modules like XML::LibXML can be
> 20 or more times the size of the original XML file - that's the price of
> convenience.  SAX allows you to work with very large files but you might
> have to write more code than you would with a DOM.  XML::Twig is a
> hybrid tree/stream approach that may give you the best of both worlds.
>
>> - unicode support
>
> Pretty much everything supports Unicode.  You're more likely to
> have problems dealing with legacy encodings like Latin-1.
>
>> - xslt-like functionality (at an elementary xslt level)
>
> XML::LibXSLT or XML::Sablotron will help you here.
>
>> - batch changes to attributes and elements (e.g., copy all text from
>> the blah-children of bluh to a single new element blih, delete all
>> blahs and insert blih as the first child of blah)
>
> Could be a job for XSLT (or STX).
>
>> - fast searches (eg, find all blah elements containing the string bloh
>> in child element bluh and having value x for attribute y of element
>> blih)
>
> Sounds like XPath
>
>> - linear order of children (i.e., it is very important to control the
>> order in which siblings are printed and accessed)
>
> Anything except XML::Simple should be OK for this :-)
>
>> - links (ways of pointing from one element in a file to another element
>>  in another file)
>
> You're possibly talking at a higher level now.  XLink may help you but
> I'm not sure that there's any specific support for it from Perl modules.
>
>> - modules should work on linux, os x and cygwin (and/or active perl)
>
> This is Perl - one of the most portable programming languages the
> world has seen.  XML::LibXML, XML::Parser, XML::LibXSLT and
> XML::Sablotron are all wrappers around compiled C libraries.  Binary
> distributions are available for most platforms.  The pure Perl modules
> that sit on top of these are very portable.
>
>> At this point, you could probably tell me that I am basically asking to
>>  be able to do everything that xml and perl can do and I need to learn
>> about hundreds of modules, but I would like to know if there is a
>> reasonably small subset of easy-to-learn modules that would be enough
>> to achieve most of these things, while not making the others completely
>>  impossible.
>
> A DOM module with XPath support (eg: XML::LibXML).
> XML::SAX for dealing with really big files and/or modular filtering pipelines
> (or XML::Twig for a more 'Perlish' approach).
> XML::LibXSLT for XSLT stuff.
> XML::Simple for the quick and dirty hacks.
>
>> Please let me know if my question is too vague... As you can probably
>> see, I am confused.
>
> Hopefully I haven't added to that confusion too much.
>
> Grant
>
>
>
> _______________________________________________
> Perl-XML mailing list
> Perl-XML@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-XML mailing list
Perl-XML@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic