1 /* Copyright (C) 2006, Index Data ApS
2 * See the file LICENSE for details.
4 * $Id: nfaxml.c,v 1.8 2006-07-06 14:06:17 heikki Exp $
9 * \brief Routines for reading a NFA spec from an XML file
17 /* #include <libxml/parser.h> */
18 #include <libxml/tree.h>
19 #include <libxml/xinclude.h>
23 #include <yaz/yconfig.h>
25 #include <yaz/nfaxml.h>
26 #include <yaz/libxml2_error.h>
28 /** \brief Parse the NFA from a XML document
30 yaz_nfa *yaz_nfa_parse_xml_doc(xmlDocPtr doc)
32 libxml2_error_to_yazlog(YLOG_FATAL, "yaz_nfa_parse_doc");
41 /** \brief Parse the NFA from a file
43 yaz_nfa *yaz_nfa_parse_xml_file(const char *filepath) {
47 libxml2_error_to_yazlog(YLOG_FATAL, "yaz_nfa_parse_xml_file");
49 doc = xmlParseFile(filepath);
53 nSubst=xmlXIncludeProcess(doc);
57 return yaz_nfa_parse_xml_doc(doc);
60 /** \brief Parse the NFA from a memory buffer
62 yaz_nfa *yaz_nfa_parse_xml_memory(const char *xmlbuff) {
64 libxml2_error_to_yazlog(YLOG_FATAL, "yaz_nfa_parse_xml_memory");
65 doc = xmlParseMemory(xmlbuff, strlen(xmlbuff));
66 return yaz_nfa_parse_xml_doc(doc);
71 #endif /* YAZ_HAVE_XML2 */
77 * indent-tabs-mode: nil
79 * vim: shiftwidth=4 tabstop=8 expandtab