New functions yaz_file_glob2, yaz_xml_include_glob
[yaz-moved-to-github.git] / include / yaz / xml_include.h
index 2b708c0..c0f689d 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2010 Index Data.
+ * Copyright (C) 1995-2013 Index Data.
  * All rights reserved.
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -25,7 +25,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/** \file 
+/** \file
     \brief XML Include (not to be confused with W3C XInclude)
 */
 
 
 #include <yaz/yconfig.h>
 #include <yaz/xmltypes.h>
+#include <yaz/file_glob.h>
 
 YAZ_BEGIN_CDECL
 
 #if YAZ_HAVE_XML2
 
 /** \brief substitute include nodes in a tree
-    \param n node where include is peformed
+    \param n node where include is performed
     \param base_path base_path - for relative file specs
     \retval 0 OK
     \retval -1 FAILURE
@@ -53,6 +54,21 @@ YAZ_BEGIN_CDECL
 YAZ_EXPORT
 int yaz_xml_include_simple(xmlNode *n, const char *base_path);
 
+/** \brief substitute include nodes in a tree
+    \param n node where include is performed
+    \param base_path base_path - for relative file specs
+    \param flags for yaz_file_glob2 (YAZ_FILE_GLOB_...)
+    \retval 0 OK
+    \retval -1 FAILURE
+
+    Nodes of the form <include src="glob-pattern"/> are substituted with
+    contents of files matching glob-pattern. Do not use this function
+    on XML from untrusted sources -- from the net for example -- local
+    trusted XML configuration ONLY.
+*/
+YAZ_EXPORT
+int yaz_xml_include_glob(xmlNode *n, const char *base_path, unsigned flags);
+
 #endif
 YAZ_END_CDECL