1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-23 01:52:48 +03:00

build: Add separate configuration option for RELAX NG

Support for RELAX NG used to be enabled together with XML Schema support
(--with-schemas). Now there's a separate option and a new feature macro
LIBXML_RELAXNG_ENABLED.
This commit is contained in:
Nick Wellnhofer
2025-02-25 23:07:19 +01:00
parent ce1b704e33
commit e50d314a27
26 changed files with 370 additions and 196 deletions

12
shell.c
View File

@@ -31,7 +31,7 @@
#include <libxml/uri.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
#ifdef LIBXML_SCHEMAS_ENABLED
#ifdef LIBXML_RELAXNG_ENABLED
#include <libxml/relaxng.h>
#endif
@@ -599,7 +599,7 @@ xmllintShellSetContent(xmllintShellCtxtPtr ctxt ATTRIBUTE_UNUSED,
return (0);
}
#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_RELAXNG_ENABLED)
static void
xmllintShellPrintf(void *ctx, const char *msg, ...) {
xmllintShellCtxtPtr sctxt = ctx;
@@ -609,9 +609,9 @@ xmllintShellPrintf(void *ctx, const char *msg, ...) {
vfprintf(sctxt->output, msg, ap);
va_end(ap);
}
#endif /* defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */
#endif /* defined(LIBXML_VALID_ENABLED) || defined(LIBXML_RELAXNG_ENABLED) */
#ifdef LIBXML_SCHEMAS_ENABLED
#ifdef LIBXML_RELAXNG_ENABLED
/**
* xmllintShellRNGValidate:
* @ctxt: the shell context
@@ -1227,7 +1227,7 @@ xmllintShell(xmlDocPtr doc, const char *filename, FILE * output)
#ifdef LIBXML_VALID_ENABLED
fprintf(ctxt->output, "\tvalidate check the document for errors\n");
#endif /* LIBXML_VALID_ENABLED */
#ifdef LIBXML_SCHEMAS_ENABLED
#ifdef LIBXML_RELAXNG_ENABLED
fprintf(ctxt->output, "\trelaxng rng validate the document against the Relax-NG schemas\n");
#endif
fprintf(ctxt->output, "\tgrep string search for a string in the subtree\n");
@@ -1237,7 +1237,7 @@ xmllintShell(xmlDocPtr doc, const char *filename, FILE * output)
#endif /* LIBXML_VALID_ENABLED */
} else if (!strcmp(command, "load")) {
xmllintShellLoad(ctxt, arg, NULL, NULL);
#ifdef LIBXML_SCHEMAS_ENABLED
#ifdef LIBXML_RELAXNG_ENABLED
} else if (!strcmp(command, "relaxng")) {
xmllintShellRNGValidate(ctxt, arg, NULL, NULL);
#endif