Help for this page

Select Code to Download


  1. or download this
    <root>
      <parent>p1 p2 <ch1>c1_1</ch1> p3 <ch2>c2</ch2> p4 <ch1>c1_2</ch1> p5
    +</parent>
    </root>
    
  2. or download this
    'root' => {
              'parent' => [
    ...
                          }
                          ]
              }
    
  3. or download this
    my $parser =  XML::Rules->new (
      rules => [
    ...
        ]
    );
    my $result = $parser->parsestring($xml);
    
  4. or download this
    # different Rule for "parent"
      parent => sub {$_[0]->{text} => $_[1]->{_content}},