Image-Shoehorn-Gallery

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

	      ($[ >= 5.005) ?
	      (AUTHOR   => 'Aaron Straup Cope (cpan@aaronland.net)',
	       ABSTRACT => '') : (),
	      'VERSION_FROM' => 'lib/Image/Shoehorn/Gallery.pm',
	      'PREREQ_PM'    => {
				 Image::Shoehorn                   => '1.41',
				 Image::Size                       => '2.99',
				 Image::Info                       => '1.11',
				 Image::IPTCInfo                   => '1.6',
				 XML::SAX::Machines                => '0.34',
				 XML::Filter::XML_Directory_2XHTML => '1.3.1',
				 XML::Filter::XSLT                 => '0.03',
				 File::Basename                    => 0,
				 File::Copy                        => 0,
				 File::Path                        => 0,
				 DirHandle                         => 0,
				 IO::File                          => 0,
				 Carp                              => 0,
				 Digest::MD5                       => 0,

				 # for testing

lib/Image/Shoehorn/Gallery.pm  view on Meta::CPAN

    <!-- lots of foofy design stuff -->

   </body>
  </html>
  </xsl:template>

 </xsl:stylesheet>

=item *

Generates valid XHTML (strict) and CSS!

=back

=cut

use strict;
package Image::Shoehorn::Gallery;

$Image::Shoehorn::Gallery::VERSION = '0.22';

lib/Image/Shoehorn/Gallery.pm  view on Meta::CPAN

  my $machine = Pipeline(
			 "LocalSAX_FloatingThumbs",
			 "LocalSAX_Breadcrumbs",
			 ((scalar(@{$filters})) ? @{$filters} : ()),
			 $writer);

  #

  # This is broken, I know.
  # There appears to be some degree of funkiness going
  # on with the inheritance chain for 2XHTML that is 
  # preventing the SAX::Machine from getting the output
  # of 2XHTML and passing it on to $writer. I think, anyway.

  my $xhtml = XML::Filter::XML_Directory_2XHTML->new(Handler=>$machine);

  $xhtml->debug(0);

  if ($encoding) {
    $xhtml->set_encoding($encoding);
  }

  if ($lang) {

lib/Image/Shoehorn/Gallery.pm  view on Meta::CPAN

package LocalSAX_Image;
use base qw (XML::SAX::Base);

use File::Basename;
use Image::Size qw (imgsize);
use Image::Info;

my $possible_views;

use constant DTD_HTML_ROOT     => "html";
use constant DTD_HTML_PUBLICID => "-//W3C//DTD XHTML 1.0 Strict//EN";
use constant DTD_HTML_SYSTEMID => "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";

sub xml_decl {
  my $self = shift;
  $self->SUPER::xml_decl({
			  Version  => "1.0",
			  Encoding => (Image::Shoehorn::Gallery->encoding() || "UTF-8")
			 });

  # If you're wondering what is going on here,

lib/Image/Shoehorn/Gallery.pm  view on Meta::CPAN

sub data {
  if ($data) { return $data; }
  while (<DATA>) { $data .= $_;  }
  return $data;
}

return 1;

# NOTE : we are not setting the public and system doctypes here
# because they cause even more weirdness with XML::LibXML and it's
# seeming inability to deal with XHTML files. I really don't get
# what's going on so we play a little game and set them event the 
# xml_decl event in the LocalSAX_Image filter is called next. Gah!

# NOTE ALSO : that this is also where we happen to set the encoding

__DATA__
<?xml version="1.0" encoding='iso-8859-1'?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version = "1.0" >



( run in 0.346 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )