Node

[Raku LibXML Project] / [LibXML-Writer Module] / Writer :: Node

class LibXML::Writer::Node

LibXML document fragment/sub-tree construction

Synopsis

use LibXML::Document;
use LibXML::Element;
use LibXML::Writer::Node;
my LibXML::Document $doc .= new;
# concurrent sub-tree construction
my LibXML::Element @elems = (1.10).hyper.map: {
    my LibXML::Element $node = $doc.createElement('Bar');
    my LibXML::Writer::Node $writer .= new: :$node;

    $writer.startDocument();
    $writer.startElement('Baz');
    $writer.endElement;
    $writer.endDocument;
    $writer.node;
}
my $root = $doc.createElement('Foo');
$root.addChild($_) for @elems;
$doc.root = $root;
say $writer.Str;
say $doc.Str;
# <?xml version="1.0" encoding="UTF-8"?>
# <Foo><Bar><Baz/></Bar>...</Foo>

Description

This class is used to write sub-trees; stand-alone or within a containing document.

LibXML::Writer v0.0.1

Raku bindings to the libxml2 streaming writer

Authors

  • David Warring

License

Artistic-2.0

Dependencies

LibXML:ver<0.9.5+>

Test Dependencies

Provides

  • LibXML::Raw::TextWriter
  • LibXML::Writer
  • LibXML::Writer::Buffer
  • LibXML::Writer::Document
  • LibXML::Writer::File
  • LibXML::Writer::Node
  • LibXML::Writer::PushParser

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.