in reply to XML::Simple, ForceArray, ForceContent and DTD/Schema

The highly polymorphic nature of XML::Simple is definitely makes XML::Simple not so. ForceArray and ForceContent are required to produce useable returns. I see the ability to fine tune ForceArray and ForceContent as useful.

Change (1) is a simple and it has no compatibility issues, so why don't you write and submit a patch?

Change (2) could easily be implemented by a seperate module that provides an interface to XML::Simple. That might be the way the better way to go.

  • Comment on Re: XML::Simple, ForceArray, ForceContent and DTD/Schema

Replies are listed 'Best First'.
Re^2: XML::Simple, ForceArray, ForceContent and DTD/Schema
by Jenda (Abbot) on Nov 17, 2006 at 21:42 UTC

    Thanks. I will do (1), I don't think the (2) should actually be a module. It's IMHO rather a task for a script, than a module. Something you run once when developing the script or module for that particular XML format. Though I'm afraid I can only write the one for DTDs, unless I'm forced to learn Schemas which I do hope I never will.

      If I was going to do #2 for XML Schema I'd start by adding schema data to the stream produced by XML::Validator::Schema. Then I'd create a handler which uses this sweetened data to create sensible defaults for ForceArray and ForceContent in XML::Simple.

      Give XML Schema a try some time. I've found if you stay away from the nuttier features it can be a pretty reasonable, if verbose, alternative to DTDs (which I loathe). To help you keep it simple (heh) XML::Validator::Schema only supports a small subset of the standard anyway.

      -sam