NAME

Krang::XML::Writer - XML::Writer sub-class with auto Base64 encoding


SYNOPSIS

  use Krang::ClassLoader 'XML::Writer';
  my $writer = pkg('XML::Writer')->new();
  # ... same as XML::Writer


DESCRIPTION

This module is a sub-class of XML::Writer which adds one feature. It will automatically encode XML-illegal character content as Base64 and add the !!!BASE64!!! marker. This marker is used by Krang::XML::Simple to automatically decode Base64 data.


INTERFACE

Same as XML::Writer.


CAVEAT

This sub-class won't work if you make multiple calls to characters() with binary data. For example:

  $writer->character("...");
  $writer->character("...");

Won't work. Instead, combine your character content into a single call:

  $writer->character("..." . "...");

Or just use the dataElement() helper function. This might be fixed someday if it becomes a problem.