[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] XML



On Thu, 11 Mar 1999, w e b s l a v e wrote:

> Hello, I've been off the list for a while, can someone clue me into
> where MacPerl is with regards XML? (and the XML Parser and Expat?)

There was a recent posting related to this. To summarize, however,
XML-Parser-2.20 is built as a binary and available from
<http://pudge.net/mmp>.

All other XML modules I have tested, which is basically the complete set,
work fine. This includes XML::DOM, XML::XQL, XML::Dumper, XML::Generator,
XML::Grove and CGI::XMLForm.

There are two caveats for MacPerl use - one is MacOS specific and one is
more general.

(1) MacOS specific: methods such as toString() for DOM, or str() in
XML::XQL::Debug, return (correctly) strings containing \xA characters for
line-ends. There is  decent chance that XML::Parser behaviour will be
modified to permit such methods to return \n instead, but this will have
to wait for 2.21 at the earliest. As a result, when you pull a string out
and want to print it, or compare it to original (Mac) content, translate
\xA to \n.

(2) RAM: this is a major consideration probably on all OS's, and quite
possibly a factor for other implementations of XML API's. DOM is the big
offender here. As soon as you start using XML::DOM and/or XML::XQL,
consider giving MacPerl 15-20 MB minimum.

An app I'm working on produced an XML index of the most recent 160
MkLinux-Setup mailing list digests (*index*, mind you, not the digests
themselves), which ran to 500kB of disk space using MacOS Extended FS.
MacPerl used the better part (~90%) of 30 megs of RAM to produce an
XML::DOM object out of this. This is an example.

There are obvious ways out of this, which are good XML practise anyhow.
Examine the structure of your document collection, and use indexes, and if
necessary, indexes of indexes. Make heavy use of general entity refs, and
parse XML documents on demand. Ballpark the largest XML filesize that your
system can comfortably handle as a  DOM object, and split files up as
required. Etc etc etc. A lot of this is not just Perl - if you were using
TclDOM or Java DOM implementations, you would still be facing the same
issues.

Hope this helps. I just signed on to CPAN testers last night, so I will be
uploading a batch of test reports once very week or 2 weeks. I hope to
have a formal set of test reports for the XML modules in the first batch.
NOTE: all the XML modules work fine - frequently their *tests* don't. :-)

Arved Sandstrom



===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org