Re: generating attributes and content for an element
"Jenda Krynicky" <[email protected]>
| Newsgroups | gmane.comp.lang.perl.xml |
|---|---|
| Message-ID | <[email protected]> |
From: Manuel Souto Pico <[email protected]> > If you have any idea about isntalling XML::LibXML with PPM it would be > great to know. !post top not do ,Please I have it installed and I know I did not compile it, but I can't find where did I install it from. Sorry. > By the way, in case you are interested, what I'm doing is > converting a dictionary that I have in XML to Martif format. With > XMLin I captured the original dictionary and now I'm trying to > transfer the contents to the new structure. I don't know the Martif format but especially if the dictionary is big you may want to process it in parts without loading everything into memory first. XML::Twig or XML::Rules somes to mind. Unlike some others I would not recommend wasting time with XSLT. First, programming in XML is simply silly. XSTL has the main problem of Lisp (lots of irritating silly parenthesis) with none of its strengths. Some XML tags are instructions, some are examples of the intended output, some are god know what else AND EVERYTHING LOOKS EXACTLY THE SAME. And as soon as you need to transform not just the packaing, but also the data, you are prettymuch lost. The list of things you actually can do in XSLT is pretty limited. > Shlomi Fish escribió: > > On Monday 24 November 2008, Manuel Souto Pico wrote: > > > >> By the way, I forgot to mention that I'm using XML::Simple > >> > >> > > > > Yes, I figured it out. I suggest you don't use XML::Simple. I don't use it and > > have a policy against helping people who do. Try using XML::Writer or > > XML::LibXML or whatever instead. XML::Simple is philosophically bad, and when > > done half-properly, is no longer simple. The fact that you do not understand something doesn't mean it's "philosophically bad". Using XML::Simple to produce XML that's supposed to be read by something else than XML::Simple is often harder than necessary, expecially if the other party is picky enough, using XML::Simple for document oriented XML is plain impossible, but to get the data out of a fairly simple, fairly small XML, XML::Simple with the right options is the simplest way. (Except for XML::Rules with the use of inferRulesFromExample or inferRulesFromDTD.) Especially if you do not have time to learn the long lists of methods of the maze-of-objects producing XML parsers and fiddle with the syntax details of XPath or get your head around the stream based ones. I'd take a complex datastructure rather than a maze of generic objects anytime, thank you very much. Most "heavyweight" XML modules assume the developer doesn't have anything better to do with his time than to learn them and several related standards inside out. LibXML is a perfect example. Jenda ===== [email protected] === http://Jenda.Krynicky.cz ===== When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. -- Terry Pratchett in Sourcery _______________________________________________ Perl-XML mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs