r61903 - in /trunk/libxml-sax-writer-perl/lib/XML/SAX: Writer.pm Writer/XML.pm
periapt-guest at users.alioth.debian.org
periapt-guest at users.alioth.debian.org
Sun Aug 22 18:37:29 UTC 2010
Author: periapt-guest
Date: Sun Aug 22 18:37:22 2010
New Revision: 61903
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=61903
Log:
Whoops popping quilt patches
Modified:
trunk/libxml-sax-writer-perl/lib/XML/SAX/Writer.pm
trunk/libxml-sax-writer-perl/lib/XML/SAX/Writer/XML.pm
Modified: trunk/libxml-sax-writer-perl/lib/XML/SAX/Writer.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-sax-writer-perl/lib/XML/SAX/Writer.pm?rev=61903&op=diff
==============================================================================
--- trunk/libxml-sax-writer-perl/lib/XML/SAX/Writer.pm (original)
+++ trunk/libxml-sax-writer-perl/lib/XML/SAX/Writer.pm Sun Aug 22 18:37:22 2010
@@ -330,10 +330,7 @@
# new
#-------------------------------------------------------------------#
sub new {
- my ( $proto, $file, $opt ) = @_;
- my $enc_to = (defined $opt and ref $opt eq 'HASH'
- and defined $opt->{EncodeTo}) ? $opt->{EncodeTo}
- : 'utf-8';
+ my ( $proto, $file ) = ( shift, shift );
XML::SAX::Writer::Exception->throw(
Message => "No filename provided to " . ref( $proto || $proto )
@@ -341,10 +338,9 @@
local *XFH;
- open XFH, ">:encoding($enc_to)", $file
- or XML::SAX::Writer::Exception->throw(
+ open XFH, ">$file" or XML::SAX::Writer::Exception->throw(
Message => "Error opening file $file: $!"
- );
+ );
return $proto->SUPER::new( *{XFH}{IO}, @_ );
}
@@ -441,16 +437,16 @@
=item * new(%hash)
-This is the constructor for this object. It takes a number of
+This is the constructor for this object. Â It takes a number of
parameters, all of which are optional.
-=item * -- Output
-
-This parameter can be one of several things. If it is a simple
+=item -- Output
+
+This parameter can be one of several things. Â If it is a simple
scalar, it is interpreted as a filename which will be opened for
-writing. If it is a scalar reference, output will be appended to this
-scalar. If it is an array reference, output will be pushed onto this
-array as it is generated. If it is a filehandle, then output will be
+writing. Â If it is a scalar reference, output will be appended to this
+scalar. Â If it is an array reference, output will be pushed onto this
+array as it is generated. Â If it is a filehandle, then output will be
sent to this filehandle.
Finally, it is possible to pass an object for this parameter, in which
@@ -460,11 +456,11 @@
If this parameter is not provided, then output is sent to STDOUT.
-=item * -- Escape
+=item -- Escape
This should be a hash reference where the keys are characters
sequences that should be escaped and the values are the escaped form
-of the sequence. By default, this module will escape the ampersand
+of the sequence. Â By default, this module will escape the ampersand
(&), less than (<), greater than (>), double quote ("), and apostrophe
('). Note that some browsers don't support the ' escape used for
apostrophes so that you should be careful when outputting XHTML.
@@ -472,24 +468,24 @@
If you only want to add entries to the Escape hash, you can first
copy the contents of %XML::SAX::Writer::DEFAULT_ESCAPE.
-=item * -- CommentEscape
+=item -- CommentEscape
Comment content often needs to be escaped differently from other
content. This option works exactly as the previous one except that
by default it only escapes the double dash (--) and that the contents
can be copied from %XML::SAX::Writer::COMMENT_ESCAPE.
-=item * -- EncodeFrom
+=item -- EncodeFrom
The character set encoding in which incoming data will be provided.
This defaults to UTF-8, which works for US-ASCII as well.
-=item * -- EncodeTo
-
-The character set encoding in which output should be encoded. Again,
+=item -- EncodeTo
+
+The character set encoding in which output should be encoded. Â Again,
this defaults to UTF-8.
-=item * -- QuoteCharacter
+=item -- QuoteCharacter
Set the character used to quote attributes. This defaults to single quotes (')
for backwards compatiblity.
@@ -592,9 +588,10 @@
=head1 THE ENCODER INTERFACE
Encoders can be plugged in to allow one to use one's favourite encoder
-object. Presently there are two encoders: Encode and NullEncoder. They
-need to implement two methods, and may inherit from
-XML::SAX::Writer::NullConverter if they wish to
+object. Presently there are two encoders: Iconv and NullEncoder, and
+one based on C<Encode> ought to be out soon. They need to implement
+two methods, and may inherit from XML::SAX::Writer::NullConverter if
+they wish to
=over 4
@@ -607,11 +604,6 @@
Converts that string and returns it.
=back
-
-Note that the return value of the convert method is B<not> checked. Output may
-be truncated if a character couldn't be converted correctly. To avoid problems
-the encoder should take care encoding errors itself, for example by raising an
-exception.
=head1 CUSTOM OUTPUT
@@ -635,17 +627,17 @@
This is used to set the proper converter for character encodings. The
default implementation should suffice but you can override it. It must
-set C<< $self->{Encoder} >> to an Encoder object. Subclasses *should* call
+set C<$self->{Encoder}> to an Encoder object. Subclasses *should* call
it.
=item setConsumer
Same as above, except that it is for the Consumer object, and that it
-must set C<< $self->{Consumer} >>.
+must set C<$self->{Consumer}>.
=item setEscaperRegex
-Will initialise the escaping regex C<< $self->{EscaperRegex} >> based on
+Will initialise the escaping regex C<$self->{EscaperRegex}> based on
what is needed.
=item escape STRING
Modified: trunk/libxml-sax-writer-perl/lib/XML/SAX/Writer/XML.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-sax-writer-perl/lib/XML/SAX/Writer/XML.pm?rev=61903&op=diff
==============================================================================
--- trunk/libxml-sax-writer-perl/lib/XML/SAX/Writer/XML.pm (original)
+++ trunk/libxml-sax-writer-perl/lib/XML/SAX/Writer/XML.pm Sun Aug 22 18:37:22 2010
@@ -481,14 +481,14 @@
# also, there's order in the pseudo-attr
my $xd = '';
if ($data->{Version}) {
- $xd .= "<?xml version=\"$data->{Version}\"";
+ $xd .= "<?xml version='$data->{Version}'";
if ($data->{Encoding}) {
- $xd .= " encoding=\"$data->{Encoding}\"";
+ $xd .= " encoding='$data->{Encoding}'";
}
if ($data->{Standalone}) {
- $xd .= " standalone=\"$data->{Standalone}\"";
- }
- $xd .= "?>\n";
+ $xd .= " standalone='$data->{Standalone}'";
+ }
+ $xd .= '?>';
}
#$xd = $self->{Encoder}->convert($xd); # this may blow up
More information about the Pkg-perl-cvs-commits
mailing list