Help for this page
#!/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');
# is an unnamed complex { # sequence of address ... # is a xs:string # is optional street => "example", }, ], }
my $data = { address => [ ... } ], };
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"
<?xml version="1.0" encoding="UTF-8"?> <addresses> ... <street>street 2</street> </address> </addresses>
www.com | www.net | www.org
No recent polls found