begin_heading($lvl)
begin_parag([style])
enf_parag()
begin_subsection()
end_subsection()
append(text,[option])
begin_table([style,[cols,[rows]]])
end_table()
begin_tablerow([is_head])
end_tablerow()
begin_tablecell()
end_tablecell()
=head1 NAME
Xml::WordML::SimpleWrite - Write simple Ms Word XML files
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();
new()
Create a new instance of the class
default_stylesheet()
Returns the default stylesheet
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.
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.
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
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.
begin_listitem([lvl])
Starts an enumeration section.
end_listitem()
Finishes an enumeration section.
none for now, it wont last.
nothing now
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.