Notice that you pass a single flat list, even though there are two semantic elements being passed - the tag name and the tag's attributes.$writer->startTag('doc', 'version' => '1.0', 'status' => 'draft', 'topic' => 'AT&T');
In XML::Writer::Nest, I decided to break with this convention (even though the current CPAN version honors it). The reason why
instead of{ my $nest = XML::Writer::Nest->(tag => 'level1'); { $nest->nest(newlevel => [attr1 => 1, attr2 => 2]); ... } }
{ my $nest = XML::Writer::Nest->(tag => 'level1'); { $nest->nest(newlevel , attr1 => 1, attr2 => 2); ... } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: API design - if you're expecting a scalar and an array ....
by LanX (Saint) on May 22, 2009 at 20:12 UTC | |
|
Re: API design - if you're expecting a scalar and an array ....
by eyepopslikeamosquito (Archbishop) on May 23, 2009 at 00:35 UTC | |
by Porculus (Hermit) on May 23, 2009 at 23:32 UTC | |
|
Re: API design - if you're expecting a scalar and an array ....
by John M. Dlugosz (Monsignor) on May 22, 2009 at 16:22 UTC | |
|
Re: API design - if you're expecting a scalar and an array ....
by metaperl (Curate) on May 22, 2009 at 15:15 UTC | |
|
Re: API design - if you're expecting a scalar and an array ....
by JavaFan (Canon) on Jun 01, 2009 at 23:53 UTC |