Next: , Previous: XML libraries, Up: XML libraries



5.2.1.1 The xmllib class

The xmllib class is derived from the library class.

     class xmllib : public library;
— Constructor: xmllib::xmllib (xmllib::file_arg_type TYPE, const string& NAME);

This constructor opens an XML library. The first argument TYPE describes what sort of resource is to be opened, and should be one of the following:

xmllib::filename
Open a file; NAME contains the name of the file.
xmllib::url
Open a URL; NAME contains the URL. To use this, Xerces must have been built with Internet access.
xmllib::default_url
Query the online method database at http://methods.ringing.org/. The argument NAME contains the query string, that is, the part of the URL after the ? character. For information on what this should contain, see the detailed information on the database's web site.

     // Query the database for all methods named Lincolnshire
     xmllib l(xmllib::default_url, "name=Lincolnshire");

An XML method collection in a file may also be opened using the library auto-detection mechanism, by simply constructing a library object. See library constructors.

— Function: static void xmllib::registerlib (void)

This function registers the XML library type with the library auto-detection mechanism.