XML-Bare reviews

cpanratings
 

RSS | Module Info | Add a review of XML-Bare

XML-Bare (0.53) *****

Parses faux XML that other parsers refuse to and actual XML too. Sets up simple and consistent data structures regardless of quality of the XML.

XML-Bare (0.45) **

Well thought out module, however I have to give it a 2. It leaks memory like a sieve when using the simple() method. There is a patch for it in the bug tracker, I haven't tested it, but if you're hell bent on using this module with the simple() method, I'd suggest applying it.

XML-Bare (0.45) *****

I needed a module to read an xml data file into a perl data structure, then make some minor modifications to that data structure, then write it back out. XML::Bare does that very well and quickly, and for that task it is easier to use than a full xml parser, or one that operates via callbacks during parsing.

IMHO, the user interface could use some improvements though -- for example, I wanted to add nodes, and the "add_node" method insisted on adding its own extra bits named like <multi_elementname/> in some cases. Plus at times I wanted to add nodes with attributes, and I had to set the _att=>1 in the node hash manually, not via the regular "add_node" method. Furthermore I had to manually set $obj->{file} when I wanted to do a "save as" instead of a "save."

But despite the fact that I had to work around a few minor things like this, I still rate the module a 5, because I was able to get what I needed to get done quickly and easily.

XML-Bare (0.45) *****

XML::Bare may not be a "real parser" (see the docs) but that's exactly what I needed - something to replace XML::Simple that was very fast. I was ready to simply rip out XML::Simple and use some regexps (as I didn't need much info extracted), but Bare saved the day. It was a ~10 minute upgrade, the main pain being dealing with some array-versus-hash differences.

XML-Bare (0.30) *****

At work, I need to parse several huge XML files (~50MB) every day to get just about 1-2 MB of data. With XML::Simple it used to take a very long time to parse each file. I was so desperate that I started doing some regexp on the XML files before sending them to XML:Simple!

I got a great speedup by switching to XML::Bare: between 5x and 25x depending on the size of the XML file!

In short, XML::Bare is great if you just want to quickly parse big XML files.

XML-Bare (0.27)

In response to mirod:

The module is not meant to adhere to any standard. It is specifically and purposefully coded to be fast and practical. I purposefully allow very loose xml to allow it to be more useful.

Note that I intend to add full mixed content support in a future release; it is just going to require a fair amount of rewrite to ensure no parsing speed is lost.

If you have any questions please feel free to ask and I will respond and attempt to add the answer into the documentation for the next release.

In response to Peter Edwards:

If you find some xml files you think are good tests and not private information, please pass them along. I had difficulty finding non-mixed xml files to test that were large enough to be fair tests.
( using a mixed xml file would give my parser an obvious unfair advantage )

As for invalid XML, the parser is pretty blind. I would like to address that in future releases. For now, closing tags are not checked against the last opened xml tag; results in an incorrect tree. Note that parsing will only fail in rare cases, which I can list in the docs if desired. Parsing is meant to complete with pretty much any sequence of text, valid or invalid. Whether the resulting tree is useful to you is what I think is important.

I agree more tests need to be added to ensure the behavior is consistent in future versions. I've already noticed certain perl versions store hashes in a different order... which caused a fail in 0.26.

To all wondering about the consistency and reliability of the module, I am attempting to make it as stable as possible while continuing to make a lot of changes to it. It is beta, but I am trying to make each release fully usable.

Once version 1.0 rolls around I am going to break away from some of the defaults, and add an option for 0.X compatibility mode. That will be a while though. No version 1.0 till the module is rock solid.

XML-Bare (0.27) *

This module uses the XML namespace but it is NOT an XML parser:

- it doesn't support mixed content
- it allows unquoted attributes
- it supports only 1 comment per node

There seem to be more restrictions to what the parser supports, but it is hard to figure them out. As it is, it obviously both supports non-well-formed XML, and doesn't support properly some well-formed XML. Further tests would be needed to figure out exactly how the format it supports overlaps with the official XML spec.

It is quite easy to write a fast quasi-XML parser. It is a LOT more difficult, but a lot more useful, to write a real, spec-compliant parser.

I hope one day this module becomes a real XML module. As of version 0.27 it seems to bit a bit far from that goal.

This is not it at the moment.

XML-Bare (0.27)

Thanks very much for XML::Bare 0.27. When I first saw this module I thought:

"another XML:: module, why?"
Then I read the docs (5*) and was interested to see just how fast it is. It does not disappoint, it is "extremely fast". I had to race it against a few other XML modules (RT#30915) and also check it was actually doing what it said it was (it is).

The docs have a section on "Parsing Limitations / Features" make sure you read it.

I'm not sure when/if I'll use this but it's nice to know it's
available. I've held off on rating anything but the docs as I've not run it on anything other than the tests it comes with. If I end up using it I'll try and remember to come back to rate the other areas. If there was a 'speed' rating it would get 5*.
I'd be more inclined to use it if it had more tests, in particular some tests on boundary cases and invalid XML - just so the current behaviour is tested - and if it changes in the future - noticed/documented.

The kwalitee page shows the Kwalitee going up:

cpants.perl.org/dist/kwalitee/XML-Bare

All in all, it's a very impressive contribution to CPAN and I look forward to future releases.