When writing an application that uses the fixbuf library, the XSLT file xml2fbuf.xslt helps add support for non-standard information elements (such as those defined by CERT or your own organization) by converting an XML file describing the elements to C code.

xml2fbuf.xslt provides compile-time support for adding your information elements to the information model. As of libfixbuf-2.1.0, fixbuf provides run-time support for parsing an XML registry of information records and adding them to the model via fbInfoModelReadXMLFile() and fbInfoModelReadXMLData().

Specifically, xml2fbuf.xslt converts an XML file containing a valid IPFIX registry to a set of C statements that define an fbInfoElement_t array. These C statements may then be included in your fixbuf project however you wish. Typically, the elements are added to your fixbuf information model using the fbInfoModelAddElementArray() function.

As a simple example, using the xsltproc program, you can convert the XML CERT IPFIX registry, cert_ipfix.xml to an array named cert_elements in a file named cert_elements.c using the following command:

xsltproc --stringparam array_name cert_elements \
    -o cert_elements.c xml2fixbuf.xslt cert_ipfix.xml