PerlPoint-Generator-XML
view release on metacpan or search on metacpan
lib/PerlPoint/Generator/XML.pm view on Meta::CPAN
{
# get and check parameters
((my __PACKAGE__ $me), my ($opcode, $mode, @more))=@_;
confess "[BUG] Missing object parameter.\n" unless $me;
confess "[BUG] Object parameter is no ", __PACKAGE__, " object.\n" unless ref $me and $me->isa(__PACKAGE__);
# invoke base class method, if necessary
$me->SUPER::preFormatter() if $me->can('SUPER::preFormatter');
# embed tag?
if ($opcode==DIRECTIVE_TAG and $more[0] eq 'EMBED')
{
# get more parameters
my ($tag, $settings)=@more;
# embedded XML configuration
$me->{flags}{xml}=($mode==DIRECTIVE_START) ? 1 : 0 if $settings->{lang}=~/^xml$/i;
}
# a paragraph enforcing plain XML without formatting (newlines added for pretty printing)?
elsif (
lib/PerlPoint/Generator/XML.pm view on Meta::CPAN
$xmltag=$xmltags{A};
confess "[BUG] No tag found" unless $xmltag;
$result=$me->{$me->{xmlmode}}->$xmltag(
{
name => $item->{cfg}{data}{options}{name},
},
@{$item->{parts}},
);
}
elsif ($item->{cfg}{data}{name} eq 'EMBED')
{
# embedded XML
if ($item->{cfg}{data}{options}{lang}=~/^XML$/i)
{
# just concatenate the parts (and supply them as XML::Generator object, not as string)
my $pseudotag="embedded-$item->{cfg}{data}{options}{lang}";
$result=$me->{xmlready}->$pseudotag(@{$item->{parts}});
}
}
elsif ($item->{cfg}{data}{name} eq 'FORMAT')
( run in 0.496 second using v1.01-cache-2.11-cpan-71847e10f99 )