libxml-perl
view release on metacpan or search on metacpan
(_handle_attlist): Changed EntityName to ElementName (re 9/28
entry)
1999-09-28 Ken MacLeod <ken@jess>
* lib/XML/Parser/PerlSAX.pm (_handle_attlist): typo: was calling
entity_decl
1999-09-09 Ken MacLeod <ken@jess>
* lib/XML/Parser/PerlSAX.pm: add start_cdata, end_cdata, and
entity_reference events
1999-08-28 Ken MacLeod <ken@bitsko.slc.ut.us>
* lib/XML/PatAct/Amsterdam.pm: added Output and AsString options,
added support for attribute replacement
* t/amsterdam.t: added
1999-08-18 Ken MacLeod <ken@bitsko.slc.ut.us>
in Perl modules. Reported by Enno Derksen <enno@att.com>
- doc/modules.xml: well-formedness errors. Reported by
KangChan Lee <dolphin@ce.cnu.ac.kr>
0.06 Wed Dec 22 15:14:39 CST 1999
- all modules: add $VERSION. Suggested by Michael Koehne
<kraehe@copyleft.de>
- XML::Parser::PerlSAX: add UseAttributeOrder option and
AttributeOrder and Defaulted properties to start_element()
handler. Suggested by Enno Derksen <enno@att.com>
- XML::Parser::PerlSAX: add start_cdata, end_cdata, and
entity_reference events
- XML::PatAct::Amsterdam: added Output and AsString options,
added support for replacing attributes
- Data::Grove: add a Data::Grove::Characters class to act as a
default grove object for containing characters.
- fixes
- XML::PatAct::ToObjects: removed leftover debugging statement
- XML::ESISParser: report record end as characters if no
record_end() handler
- XML::Parser::PerlSAX: For attribute list declarations, now
doc/index.html view on Meta::CPAN
<font size=2>February 4, 2000</font><BR>
<TABLE>
<TR><TD VALIGN="TOP">-</TD><TD>all modules: add $VERSION. Suggested
by <a href="mailto:kraehe@copyleft.de">Michael Koehne</a></TD></TR>
<TR><TD VALIGN="TOP">-</TD><TD>XML::Parser::PerlSAX: add
UseAttributeOrder option and AttributeOrder and Defaulted properties
to start_element() handler. Suggested by <a
href="mailto:enno@att.com">Enno Derksen</a> </TD></TR>
<TR><TD VALIGN="TOP">-</TD><TD>XML::Parser::PerlSAX: add start_cdata,
end_cdata, and entity_reference events</TD></TR>
<TR><TD VALIGN="TOP">-</TD><TD>XML::PatAct::Amsterdam: added Output
and AsString options, added support for replacing attributes</TD></TR>
<TR><TD VALIGN="TOP">-</TD><TD>Data::Grove: add a
Data::Grove::Characters class to act as a default grove object for
containing characters.</TD></TR>
<TR><TD VALIGN="TOP">-</TD><TD>Fixes:
<TABLE>
<TR><TD VALIGN="TOP">-</TD><TD>XML::PatAct::ToObjects: removed
leftover debugging statement</TD></TR>
<TR><TD VALIGN="TOP">-</TD><TD>XML::ESISParser: report record end as
doc/sax-2.0-adv.html view on Meta::CPAN
<blockquote>
<table>
<tr><td><b><tt>Name</tt></b></td>
<td>The name of the entity that is ending.</td></tr>
</table>
</blockquote></dd>
</dl></p>
<p>
<dl><dt><b><tt class='function'>start_cdata</tt></b>(<var>cdata</var>)</dt>
<dd>
Report the start of a CDATA section.
<p>The contents of the CDATA section will be reported through the
regular characters event.</p>
<p>No properties are defined for this event (<var>cdata</var> is
empty).</p></dd></dl></p>
<p>
<dl><dt><b><tt class='function'>end_cdata</tt></b>(<var>cdata</var>)</dt>
<dd>
Report the end of a CDATA section.
<p>No properties are defined for this event (<var>cdata</var> is
empty).</p></dd></dl></p>
<p>
<dl><dt><b><tt class='function'>comment</tt></b>(<var>comment</var>)</dt>
<dd>
Report an XML comment anywhere in the document.
<p>This callback will be used for comments inside or outside the
document element, including comments in the external DTD subset (if
read).</p>
lib/XML/Parser/PerlSAX.pm view on Meta::CPAN
push (@handlers, Start => sub { $self->_handle_start(@_) } )
if (UNIVERSAL::can($doc_h, 'start_element'));
push (@handlers, End => sub { $self->_handle_end(@_) } )
if (UNIVERSAL::can($doc_h, 'end_element'));
push (@handlers, Char => sub { $self->_handle_char(@_) } )
if (UNIVERSAL::can($doc_h, 'characters'));
push (@handlers, Proc => sub { $self->_handle_proc(@_) } )
if (UNIVERSAL::can($doc_h, 'processing_instruction'));
push (@handlers, Comment => sub { $self->_handle_comment(@_) } )
if (UNIVERSAL::can($doc_h, 'comment'));
push (@handlers, CdataStart => sub { $self->_handle_cdatastart(@_) } )
if (UNIVERSAL::can($doc_h, 'start_cdata'));
push (@handlers, CdataEnd => sub { $self->_handle_cdataend(@_) } )
if (UNIVERSAL::can($doc_h, 'end_cdata'));
if (UNIVERSAL::can($doc_h, 'entity_reference')) {
push (@handlers, Default => sub { $self->_handle_default(@_) } );
$self->{UseEntRefs} = 1;
}
}
if (defined $parse_options->{DTDHandler}) {
# cache DTDHandler in self for callbacks
$self->{DTDHandler} = $parse_options->{DTDHandler};
lib/XML/Parser/PerlSAX.pm view on Meta::CPAN
}
sub _handle_comment {
my $self = shift;
my $expat = shift;
my $data = shift;
$self->{DocumentHandler}->comment( { Data => $data } );
}
sub _handle_cdatastart {
my $self = shift;
my $expat = shift;
$self->{DocumentHandler}->start_cdata( { } );
}
sub _handle_cdataend {
my $self = shift;
my $expat = shift;
$self->{DocumentHandler}->end_cdata( { } );
}
# Default receives all characters that aren't handled by some other
# handler, this means a lot of stuff goes through here. All we're
# looking for are `&NAME;' entity reference sequences
sub _handle_default {
my $self = shift;
my $expat = shift;
my $string = shift;
lib/XML/Parser/PerlSAX.pm view on Meta::CPAN
Target The processing instruction target.
Data The processing instruction data, if any.
=item comment
Receive notification of a comment.
Data The comment data, if any.
=item start_cdata
Receive notification of the start of a CDATA section.
No properties defined.
=item end_cdata
Receive notification of the end of a CDATA section.
No properties defined.
=item entity_reference
Receive notification of an internal entity reference. If this handler
is defined, internal entities will not be expanded and not passed to
the `C<characters()>' handler. If this handler is not defined,
lib/XML/PatAct/ToObjects.pm view on Meta::CPAN
push @{$self->{ActionStack}}, $action;
my $state = $self->{States}[-1];
push @{$self->{States}}, $state;
if (($state eq 'as-grove') and !$self->{SourceIsGrove}) {
$self->{GroveBuilder}->start_element($element);
}
return if (($state ne 'normal') && ($state ne 'pcdata'));
if (defined($action) and defined($action->{PCData})) {
$self->{States}[-1] = 'pcdata';
}
if (!defined($action) or $action->{Holder}) {
# ignore this element but continue processing below
return;
}
if ($action->{Ignore} or $action->{FieldValue}) {
# ignore (discard) this element and it's children
$self->{States}[-1] = 'discarding';
lib/XML/PatAct/ToObjects.pm view on Meta::CPAN
}
sub characters {
my ($self, $characters) = @_;
my $state = $self->{States}[-1];
if ($state eq 'as-string') {
push @{$self->{Data}}, $characters->{Data};
} elsif ($state eq 'as-grove' and !$self->{SourceIsGrove}) {
$self->{GroveBuilder}->characters($characters);
} elsif ($state eq 'pcdata') {
push (@{$self->{Parents}[-1]{Contents}},
$self->{CharacterDataType}->new(%$characters));
}
}
# we ignore processing instructions and ignorable whitespace by not
# defining those functions
###
### private functions
lib/XML/PatAct/ToObjects.pm view on Meta::CPAN
} elsif ($option eq '-value') {
$action->{FieldValue} = shift @$source;
} elsif ($option eq '-grove') {
$self->{GroveBuilder} = 1;
$action->{AsGrove} = 1;
} elsif ($option eq '-grove-contents') {
$self->{GroveBuilder} = 1;
$action->{ContentsAsGrove} = 1;
} elsif ($option eq '-ignore') {
$action->{Ignore} = 1;
} elsif ($option eq '-pcdata') {
$action->{PCData} = 1;
} else {
die "$option: undefined option\n";
}
}
return $action;
}
1;
lib/XML/PatAct/ToObjects.pm view on Meta::CPAN
code then simple then some simple substitutions are made as described
further below.
Options that can be used in an action item containing an option-list:
=over 4
=item B<-holder>
Ignore this element, but continue processing it's children (compare to
B<-ignore>). C<-pcdata> may be used with this option.
=item B<-ignore>
Ignore (discard) this element and it's children (compare to B<-holder>).
=item B<-pcdata>
Character data in this element should be copied to the C<Contents>
field.
=item B<-make> I<PACKAGE>
Create an object blessed into I<PACKAGE>, and continue processing this
element and it's children. I<PACKAGE> may be the type `C<HASH>' to
simply create an anonyous hash.
sub notation_decl {
my $self = shift;
$self->{Tests}[8] ++;
}
sub unparsed_entity_decl {
my $self = shift;
$self->{Tests}[9] ++;
}
sub start_cdata {
my $self = shift;
$self->{Tests}[12] ++;
}
sub end_cdata {
my $self = shift;
$self->{Tests}[13] ++;
}
sub resolve_entity {
my $self = shift;
my $entity = shift;
if ($entity->{SystemId} eq 'fran-def') {
$self->{Tests}[10] ++;
( run in 0.372 second using v1.01-cache-2.11-cpan-454fe037f31 )