Shlomi Fish


XML::Grammar::ProductsSyndication - an XML Grammar for ProductsSyndication.


Version 0.0404


    use XML::Grammar::ProductsSyndication;

    my $synd =
                'source' =>
                    'file' => "products.xml",

    # A LibXML compatible XHTML DOM
    my $xhtml = $synd->transform_into_html({ 'output' => "xml" });

    # Not implemented yet!
            'dir' => "mydir/",


XML::Grammar::ProductsSyndication->new({ arg1 => "value"...})

The constructor - accepts a single hash reference with the following keys:


A reference to a hash that contains the information for the source XML for the file. Currently supported is a 'file' key that contains a path to the file.


Points to the data directory where the DTD files, the XSLT stylesheet, etc. are stored. Should not be generally over-ridden.


Checks if the filename validates according to the DTD.

$processor->transform_into_html({ 'output' => $output, })

Transforms the output into HTML, and returns the results. If 'output' is 'xml' returns the XML::LibXML XML DOM. If 'output' is 'string' returns the XML as a monolithic string. Other 'output' formats are undefined.


Updates the cover images from Amazon. Receives one hash ref being the arguments. Valid keys are:

  • size

    The request size of the image - 's', 'm', 'l',

  • resize_to

    An optional hash ref containing width and height maximal dimensions of the image to clip to.

  • name_cb

    A callback to determine the fully qualified path of the file. Receives the following information:

    • xml_node

    • id

    • isbn

  • amazon_token

    An web services token. See XML::Amazon.

  • amazon_associate

    An optional associate ID. See XML::Amazon.

  • amazon_sak

    An optional Secret Access Key (sak). See XML::Amazon.

  • overwrite

    If true, instructs to overwrite the files in case they exist.


Shlomi Fish, <shlomif at>


Please report any bugs or feature requests to bug-xml-grammar-productssyndication at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


  • Automatically Download Preview Images from


You can find documentation for this module with the perldoc command.

    perldoc XML::Grammar::ProductsSyndication

You can also look for information at:


* for their excellent XSLT Tutorial.

* for squashing some XML::LibXML bugs I reported to him.


  • Trace the progress of the progress.

  • More XSLT customisation.

  • Generate a table-of-contents.


Copyright 2006 Shlomi Fish, all rights reserved.

This program is released under the following license: MIT X11.