in reply to Re: A data structure for XML generation
in thread A data structure for XML generation

If you've defined two explicit cases for $inner (scalar or array ref), you can always differentiate it from a hash ref, so why not just make the \%attr optional and just omit the empty hashes {}?
Yes, I certainly thought of that. And you will often simply provide content without attributes, so I think that is a nice shorthand.
  • Comment on Re^2: A data structure for XML generation

Replies are listed 'Best First'.
Re^3: A data structure for XML generation
by jrey (Initiate) on Aug 12, 2009 at 00:54 UTC
    You may use something like the lol structure of the method new_from_lol in HTML::Element, I think it is very compact and easy to handle.