Buffer

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

class LibXML::Writer::Buffer

In-memory buffer construction

Synopsis

use LibXML::Writer::Buffer; # String or buffer output
my LibXML::Writer::Buffer:D $writer .= new;

$writer.startElement('Test');
$writer.writeAttribute('id', 'abc123');
$writer.writeText('Hello world!');
$writer.endElement();
say $writer.Str;  # <Test id="abc123">Hello world!</Test>
say $writer.Blob; # Buf[uint8]:0x<3C 54 65 ...>

# XML::Writer compatibility
say LibXML::Writer::Buffer.serialize: 'elem' => ['text'];
# <elem>text</elem>

Description

This class writes to an in-memory buffer. The final XML document can then be rendered using the Str or Blob methods.

A class-level `serialize method is also provided for compatibility with XML::Writer.

LibXML::Writer v0.0.5

Raku bindings to the libxml2 streaming writer

Authors

  • David Warring

License

Artistic-2.0

Dependencies

LibXML:ver<0.11.0+>

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.

Built with Podlite — the markup and publishing tools behind this site.