in reply to OO Design -- Separating Data from Presentation

The best way to seperate data from presentation is provided to you for free: XML.

XSLT can be easily used to report your data in HTML.

I am not sure whether there is any tool or standard way to take XML and present in Excel or PDF. If not, you can do it yourself, or rescope of what you are trying to do.

Try to utilize and follow industrial standard is always a good idea.

  • Comment on Re: OO Design -- Separating Data from Presentation

Replies are listed 'Best First'.
Re: Re: OO Design -- Separating Data from Presentation
by dragonchild (Archbishop) on Dec 13, 2003 at 05:19 UTC
    PDF::Template and Excel::Template, combined with XML::Parser (which they already use cause the layout/template files are in XML) and some code anyone can write should be able to do this. I didn't extend the param() method for those modules beyond what HTML::Template's does because that wasn't in my initial scope. But, there's no reason I couldn't accept an XML document (either filename, filehandle, or scalarref) as the parameter list ... unless I'm missing something obvious (which is always a distinct possibility).

    ------
    We are the carpenters and bricklayers of the Information Age.

    Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

Re: Re: OO Design -- Separating Data from Presentation
by xenchu (Friar) on Dec 13, 2003 at 02:54 UTC

    Perhaps the Spreadsheet::WriteExcel would serve or perhaps XML::Excel? I haven't read the documentation but their purpose seems to be to read and write Excel spreadsheets.

    xenchu

    ****sigfilesigfilesigfilesigfilesigfilesigfilesigfilesigfile*****

    Perl has one Great Advantage and one Great Disadvantage:

    It is very easy to write a complex and powerful program in three lines of code.

    ********************************************

    The Needs of the World and my Talents run parallel to infinity.