file: README G. Moody 2 July 2010 Last revised: 6 October 2010 This directory contains software for interchange between WFDB native formats and XML formats. It includes: wfdb.dtd a DTD for WFDB-XML, an XML schema for expressing the contents of WFDB header and annotation files wfdb.xsl an XSLT style sheet that a web browser (or other XSLT engine) can use to transform a WFDB-XML header or annotation file into a human-readable representation of its contents heaxml.c a C program that converts a native WFDB .hea file into a WFDB-XML file annxml.c a C program that converts a native WFDB annotation file into a WFDB-XML file xmlhea.c a C program that converts a WFDB-XML header file into a native WFDB .hea file xmlann.c a C program that converts a WFDB-XML annotation file into a native WFDB annotation file xmlproc.h generic functions for processing XML files, shared by xmlhea and xmlann Makefile a 'make' description file for automating the process of compiling and installing this software A copy of the most recent version of wfdb.dtd is posted on PhysioNet at http://physionet.org/physiobank/database/XML/wfdb.dtd This on-line copy is referenced in WFDB-XML files generated by heaxml and annxml. Note that these programs require the WFDB library version 10.5.4 or later, and that those that read WFDB-XML files also require libexpat (http://expat.sourceforge.net/). To compile them, install gcc, make, the WFDB software package, and libexpat if you have not already done so, then run 'make' from within this directory. If you don't have 'make', you can compile these programs manually; see 'Makefile' for the commands needed to do so. It is not necessary to download the native WFDB files in order to use heaxml and annxml, since they can obtain their inputs directly from the PhysioNet web server via HTTP. For example, these commands: heaxml mitdb/200 annxml mitdb/200 atr produce the WFDB-XML files mitdb-200.hea.xml mitdb-200.atr.xml in the current directory. If you put a copy of wfdb.xsl in the same directory with these output files, you should be able to view the HTML generated from them via wfdb.xsl by opening them with Firefox or another web browser that incorporates an XSLT engine. Try running heaxml on a mimicdb or mimic2db record, for example like this: heaxml mimic2db/a40006/a40006 This command produces mimic2db-a40006-a40006.hea.xml which includes information about each segment in the multi-segment record as well as a summary of the entire record. The inverse operation, which can be performed by reading the .xml file using xmlhea, generates a complete set of segment headers together with the master header in this case. Warning: the XML outputs generated by these commands are huge. There is a good reason that I don't keep these data in XML format on PhysioBank! There are no 'datxml' or 'xmldat' applications to convert signal files to and from WFDB-XML format, because the standard 'rdsamp' and 'wrsamp' can perform these conversions. Use rdsamp's '-X' option to generate WFDB-XML output; wrsamp can recognize WFDB-XML input automatically, so no special option is required. WFDB-XML signal format is the CSV format that can be produced by rdsamp's '-c' option, wrapped within an XML header and trailer.