XML::WordML::SimpleWriter


=head1 NAME
        Xml::WordML::SimpleWrite - Write simple Ms Word XML files


SYNOPSIS

        use XML::WordML::SimpleWriter;
        my $wml = new XML::WordML::SimpleWriter;
        # document settings
        $wml->set_encoding('LATIN1');
        $wml->set_defaultFont('Arial');
        $wml->load_stylesheet('style.xml');

        # title 1
        $wml->begin_subsection(); # subsection begins before title
        $wml->append_heading(1,"This is a Title 1");

        # title 2
        $wml->begin_subsection();
        $wml->append_heading(2, "This is a Title 2");

        # some paragraphs
        $wml->append_parag("Lorem ipsum and so on");
        
        $wml->begin_parag();
        $wml->append("Lorem ipsum and so on .... encore");
        $wml->end_param();

        # lists
        $wml->begin_subsection();
        $wml->begin_listitem($lvl);
        $wml->append("item ");
        $wml->append("one");
        $wml->end_list_item();
        $wml->append_listitem($lvl,"item two");
        $wml->end_subsection();

        # a  4 x 3 table
        $wml->begin_table('StdTable');
        for( my $row =0; $row < 4; $row++ ) { 
            $wml->begin_tablerow('head'); 
                for( my $col =0; $col < 3; $col++ ) {
                        $wml->append_tablecell("this is cell col:$col,row:$row");
                }
            $wml->end_tablerow();
        $wml->end_table();

        $wml->end_subsection(); # closing title 2 subsection
        $wml->end_subsection(); # closing title 1 subsection
        print $wml->xml();


DESCRIPTION

Classes methods

new()

Create a new instance of the class

default_stylesheet()

Returns the default stylesheet

Document properties

properties(\%pr)

Sets the properties from a hash table

set_defaultFont($font_name)

Sets the default font to $font_name.

set_encoding($enc)

Sets the text encoding to $enc .

title($)

Sets the document title.

Styles

load_stylesheet($fname)

Loads an external spreadsheet from the $fname file

set_stylesheet($stylesheet)

Sets the current stylesheet to the content of $stylesheet

stylesheet()

Gets the current stylesheet.

Headings and paragraphes

begin_heading($lvl)

Start a title of level $lvl.

begin_parag([style])

Start a paragraph of the named style .

Default style is used if none precised.

enf_parag()

Finishes a paragraph section.

begin_subsection()

Starts a subsection (text bloc).

end_subsection()

End a subsection.

append(text,[option])

Appends text to the current paragraph.

Second parameter (optional) is a string style: i for italic, b for bold, u for underline or combination of them

Tables manipulation

begin_table([style,[cols,[rows]]])

Start a table of cols columns and rows rows with the given style.

end_table()

Finishes a table section

begin_tablerow([is_head])

Start a table row.

If is_head is true, the row is to be considered a table header

end_tablerow()

Finishes a table row.

begin_tablecell()

Starts a table cell.

end_tablecell()

Finishes a table cell.

Lists and enumerations

begin_listitem([lvl])

Starts an enumeration section.

end_listitem()

Finishes an enumeration section.


KNOWN PROBLEMS

none for now, it wont last.


SEE ALSO

nothing now


COPYRIGHT

Copyright (c) 2003 - 2006 Christophe RENARD All rights reserved

You may distribute under the terms of either the GNU Lesser General Public License or the Artistic License, as specified in the Perl README file.