Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Module for XML output

by saberworks (Curate)
on Jan 10, 2012 at 20:19 UTC ( [id://947234]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/local/bin/perl
    
    ...
    # Note: the second argument must match the root-level element of the X
    +ML 
    # document.  I'm not quite sure why it's required here.
    warn $schema->template('PERL', 'addresses');
    
  2. or download this
    # is an unnamed complex
    { # sequence of address
    ...
          # is a xs:string
          # is optional
          street => "example", }, ], }
    
  3. or download this
    my $data = {
        address => [
    ...
            }
        ],
    };
    
  4. or download this
    my $doc    = XML::LibXML::Document->new('1.0', 'UTF-8');
    my $write  = $schema->compile(WRITER => 'addresses');
    ...
    $doc->setDocumentElement($xml);
    
    print $doc->toString(1); # 1 indicates "pretty print"
    
  5. or download this
    <?xml version="1.0" encoding="UTF-8"?>
    <addresses>
    ...
        <street>street 2</street>
      </address>
    </addresses>
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://947234]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-25 13:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found