Author image Johan Van den Brande


XML::Handler::Pdb - Generate a Palm PDB from XML data


Using SAX::Machines:

 use XML::SAX::Machines qw(Pipeline);
 use XML::Handler::Pdb;
 Pipeline( XML::Handler::Pdb->new( Output => $outfile )->parse_uri("pdb.xml") ); 

Using directly:

 use XML::SAX;
 use XML::Handler::Pdb;

        Handler => XML::Handler::Pdb->new(
                Verbose => 0,
                Output => $output


With this module one can generate a Palm database (.pdb file) from an XML description. The datatypes supported by this module are targetted towards NSBasic. The NSBasic IDE is a superb way of creating PalmOS applications, more can be found on Supported datatypes are: int, short, byte, float, double, date, time and text.



This is the root element and must always be present. The element also has 3 mandatory attributes. The type attribute must alwas be DATA, because this module can only generate data oriented databases and no resource databases like a prc file. The name attribute contains the name of the database, used to open the database from PalmOS. The creator attribute must match the creator id of the Palm application that uses this database.


A record is a row in a Palm database. The only attribute a record can have is the category it belongs to. The attribute category can accepts a vlaue from 0 to 15. A record in a Palm database can contain an arbitrary amount of fields.


The field is a data item in the Palm database. It can be one of the next types: int, date, time, byte, float, double, short and text. One record can have as many fields as necessary. Records can also have different types and a different number of fields. Offcourse, your application will need to deal with this.

The next section talks about the defined datatypes and how to apply them.

 <field type="int" value="42" />

An integer occupies 4 bytes when serialized.

 <field type="short" value="7" />

A short occupies 2 bytes on IO.

 <field type="byte" value="1" />

A byte occupies 1 byte on IO.

float, double
 <field type="float" value="3.14" />
 <field type="double" value="2.7" />

A float and double occupy 8 bytes when serialized.

 <field type="text">Blah Blah blah </field>

When serialized, a text string is closed by a /0 character.

 <field type="time" value"13:20:01" />

NSBasic uses the next formula to represent a time:


This is serialized as a float, occupying 8 bytes of IO.

 <field type="date" value="2003-02-19" />

NSBasic uses the next formula to represent a date:


This is serialized as a float, occupying 8 bytes of IO.


Please use for reporting bugs.


Johan Van den Brande <>


This is free software, distributed underthe same terms as Perl itself.