Aristotle Pagaltzis has mentioned XML::Genx. Yay, it needs all the publicity that it can get. He highlighted some issues in XML::Genx::SAXWriter, which I need to address, although getting some consensus from the list first would be good.
He also mentions a problem with default namespaces a little further on. I’ll have to look into that one. I’m not sure if it’s a bug or Genx is supposed to work that way.
But it has made me realise that I need to upgrade the documentation that comes with Genx. The API usage is not always as clear as it could be, particularly when it comes to namespaces and optional function arguments. So a very good EXAMPLES section would do well I think.
Not only that, it’s also made realise that there’s some bad behaviour in there.
- Passing in a namespace object to
StartElementLiteral()doesn’t work properly. It assumes that the stringification of the namespace object is the URL.
- The manner for using
StartElementLiteral()to declare a default namespace sucks, badly. You have to declare the namespace object with the default prefix (ie: ””). Then, you have to call
StartElementLiteral()passing in the URI yourself. And then you have to call
AddNamespace()on the namespace object to switch from the genx created prefix back to the default. Very weird, but fixing the bug above would render this much simpler.
It’s really important to get this sort of thing fixed up so that the API is easy to use and works as expected.
Finally, I’ve also noticed that the last release had an unexpected failure (the Win32 stuff is at least expected failure). What’s irritating is that it’s nothing to do with my code. For some reason, version.xs is being picked up and mingled into my module. I blame the person submitting the CPAN tester report (for now, anyway). I’m sure I saw something about this on a use.perl.org journal recently…