Hi,

Got a new module, needs name. Proposing XML::XPathToXML unless objections
or better suggestions.

Excerpt from POD:

=head1 NAME

XML::XPathToXML - Generates XML document from XPath expressions

=head1 SYNOPSIS

  my %data = (
    '/project/name'         => 'The Ultimate Question',
    '/project/start'        => '2002-09-08',
    '/project/end'          => '7002002-09-08',
    '/project/@id'          => '42',
    '/project/temp/pre'     => '41',
    '/project/temp/pre[position()=6]' => '46',
    '/project/temp/pre[3]'  => '43',
  );

  my $xpx = new XML::XPathToXML( debug=>1 );

  $xpx->parse( \%data );

  $xpx->parse( '/project/temp/pre[last()]/@guess', 'tooHigh' );

  print $xpx->documentElement->toString(1)."\n";

Result:

  <project id="42">
    <name>The Ultimate Question</name>
    <start>2002-09-08</start>
    <end>7002002-09-08</end>
    <temp>
      <pre>41</pre>
      <pre/>
      <pre>43</pre>
      <pre/>
      <pre/>
      <pre guess="tooHigh">46</pre>
    </temp>
  </project>


=head1 DESCRIPTION

Generates an XML document or node tree from one or more XPath expressions.
Returnes an XML::LibXML::Document or XML::LibXML::Element.

=cut


Thanks,
-Kurt.
__________
kurt george gjerde <[EMAIL PROTECTED]>
intermedia uib, university of bergen

Working for bandwidth.

Reply via email to