From: "Beginner" <[EMAIL PROTECTED]>
> On a more general point I haven't found it easy to find modules that 
> output XML or perhaps I should say, I didn't find the ones I did look 
> at to be well documented in terms of examples or show the variety of 
> different ways data structures can be represented in XML.

Well, as the author of one of the modules you may have looked at I am 
to blame. There are virtualy no examples in XML::Rules. For your 
example the code using XML::Rules would look like this:


use XML::Rules;

$ref = {
  'dermot' => '10',
  'joe' => '17',
  'rose' => '11',
  'phil' => '13',
  'brian' => '20',
  'andy' => '15',
};

my $parser = XML::Rules->new(
  rules => [],
);

print $parser->ToXML(
 users => {
  user => [
   map { {id => $ref->{$_}, _content => $_} } keys %{$ref}
  ]
 }, 0, '  '
);


Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to