XML-Checker
view release on metacpan or search on metacpan
lib/XML/Checker.pm view on Meta::CPAN
{
$self->CData ($data);
}
else
{
$self->Char ($data);
}
}
# PerlSAX API
sub start_cdata
{
$_[0]->{InCDATA} = 1;
}
# PerlSAX API
sub end_cdata
{
$_[0]->{InCDATA} = 0;
}
sub Char
{
my ($self, $text) = @_;
my $context = $self->{Context};
# NOTE: calls to isWS may set this to 1.
$INSIGNIF_WS = 0;
$context->[0]->Char ($self, $text);
}
# Treat CDATASection same as Char (Text)
sub CData
{
my ($self, $cdata) = @_;
my $context = $self->{Context};
$context->[0]->Char ($self, $cdata);
# CDATASection can never be insignificant whitespace
$INSIGNIF_WS = 0;
#?? I'm not sure if this assumption is correct
}
# PerlSAX API
sub comment
{
my ($self, $hash) = @_;
lib/XML/Checker.pm view on Meta::CPAN
=back
=head2 PerlSAX interface
XML::Checker now also supports the PerlSAX interface, so you can use XML::Checker
wherever you use PerlSAX handlers.
XML::Checker implements the following methods: start_document, end_document,
start_element, end_element, characters, processing_instruction, comment,
start_cdata, end_cdata, entity_reference, notation_decl, unparsed_entity_decl,
entity_decl, element_decl, attlist_decl, doctype_decl, xml_decl
Not implemented: set_document_locator, ignorable_whitespace
See PerlSAX.pod for details. (It is called lib/PerlSAX.pod in the libxml-perl
distribution which can be found at CPAN.)
=head1 CAVEATS
This is an alpha release. It is not actively maintained, patches are accepted and
<undefined/>
</c>
<q req_id="unreferenced_id"/>
</p>
<n nmtoken="1bad nmtoken"/>
<n nmtoken="valid_nmtoken"/>
<bad_id bad_idref="1bad ID"/>
<bad_id/>
<bad_ent bad_ent="1bad ENTITY"/>
<bad_ent/>
<![CDATA[ some cdata ]]>
</root>
( run in 0.660 second using v1.01-cache-2.11-cpan-454fe037f31 )