NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
XML::Generator? (Score:1)
A friend and I had a similar discussion about generating XML in a simple way today -- we trawled CPAN and found XML::Generator [cpan.org]. Does it do (most of) what you're looking for?
Re:XML::Generator? (Score:2)
I had looked at XML::Generator and I liked it, but it had some problems. First, because of autoload, it's easy to do this:
I probably meant "field". My version forces you to map methods to tags and will die if you try to print a tag that doesn't exist (though you can add methods/tags on the fly).
Also, as far as I can tell, I would not be able to conveniently dump out data in the Yahoo! IDIF format. Here's an snippet:
Re:XML::Generator? (Score:2)
This is not XML, so really it should not be labelled as such. AFAICT it is pretty close to being SGML though. It might even be SGML, the XML declaration would be seen by an SGML parser as a regular PI, you can add a DTD when you parse the file, and unenclosed tags and &\W are valid in SGML. You just need the characters to be in latin1.
So why don't you go and pollute the SGML namespace ;--)
Seriously, I don't think you should release your module in the XML namespace. An IDIF module would be OK, it its own namespace I guess, maybe with a helper module that could be used on its own.
I think my main problem with your module is the way you seem to advertise it, which sounds a bit like "let's generate more quasi XML to p.o. real XML guys" to me. Presenting it as a module that generates XML, documenting prominently the features that let it generate proper XML, and then adding a "There be Dragons" section that adds a few non-kosher methods (Raw seems like a prime candidate), maybe only available by adding an option to the constructor, might be a better way to go about it.
Oh, and as far as tests go, if you (not you, the user in general) don't really know what is and is not XML, I am not sure about the quality of the tests that you can generate.
Does it make sense?
mirod
Reply to This
Parent
Re:XML::Generator? (Score:2)
I have decided not to put this in the XML namespace. That much I agree on.
I can see how that might appear to be what I was doing. I'll be sure to clarify that. Unfortunately, this is a real problem space that developers constantly face: legacy XML "variants" or third-party resources which require malformed XML. Since it's not always possib
Re:XML::Generator? (Score:2)
mirod