aboutsummaryrefslogtreecommitdiffstats
path: root/xmllint.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2010-07-26 14:02:42 +0200
committerDaniel Veillard <veillard@redhat.com>2010-07-26 14:02:42 +0200
commitf1121c48afd5ff8fb9cfc2ea8b33a77586bc370e (patch)
tree8c9520f157039fbd74774e24eb7c778e3a32af1c /xmllint.c
parent2ee91eb6587191de876dbcf147d99bc9b8c7799d (diff)
downloadandroid_external_libxml2-f1121c48afd5ff8fb9cfc2ea8b33a77586bc370e.tar.gz
android_external_libxml2-f1121c48afd5ff8fb9cfc2ea8b33a77586bc370e.tar.bz2
android_external_libxml2-f1121c48afd5ff8fb9cfc2ea8b33a77586bc370e.zip
Add an HTML parser option to avoid a default doctype
- include/libxml/HTMLparser.h: defines the new HTML parser option HTML_PARSE_NODEFDTD - HTMLparser.c: if option is set don't add a default DTD - xmllint.c: add the corresponding --nodefdtd option in xmllint
Diffstat (limited to 'xmllint.c')
-rw-r--r--xmllint.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/xmllint.c b/xmllint.c
index 2a75e3bd..88c4a6b9 100644
--- a/xmllint.c
+++ b/xmllint.c
@@ -162,6 +162,9 @@ static int html = 0;
static int xmlout = 0;
#endif
static int htmlout = 0;
+#if defined(LIBXML_HTML_ENABLED)
+static int nodefdtd = 0;
+#endif
#ifdef LIBXML_PUSH_ENABLED
static int push = 0;
#endif /* LIBXML_PUSH_ENABLED */
@@ -2995,6 +2998,7 @@ static void usage(const char *name) {
#ifdef LIBXML_HTML_ENABLED
printf("\t--html : use the HTML parser\n");
printf("\t--xmlout : force to use the XML serializer when using --html\n");
+ printf("\t--nodefdtd : do not default HTML doctype\n");
#endif
#ifdef LIBXML_PUSH_ENABLED
printf("\t--push : use the push mode of the parser\n");
@@ -3157,6 +3161,10 @@ main(int argc, char **argv) {
else if ((!strcmp(argv[i], "-xmlout")) ||
(!strcmp(argv[i], "--xmlout"))) {
xmlout++;
+ } else if ((!strcmp(argv[i], "-nodefdtd")) ||
+ (!strcmp(argv[i], "--nodefdtd"))) {
+ nodefdtd++;
+ options |= HTML_PARSE_NODEFDTD;
}
#endif /* LIBXML_HTML_ENABLED */
else if ((!strcmp(argv[i], "-loaddtd")) ||