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>