From 08ad377e80f3295cd02ae1c7719833ff0c9f8f43 Mon Sep 17 00:00:00 2001 From: bor8 Date: Wed, 27 Jul 2016 19:16:37 +0200 Subject: [PATCH 1/2] [base.py] Insert more Namespaces. Insert more Namespaces to avoid the error UnknownNamespace ("Use of unknown namespace: ..."). Also add some standard attributes to avoid the error UnexpectedAttribute ("Unexpected ... attribute on ... element"). --- src/feedvalidator/base.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/feedvalidator/base.py b/src/feedvalidator/base.py index d913ede9..ae48e64b 100644 --- a/src/feedvalidator/base.py +++ b/src/feedvalidator/base.py @@ -38,6 +38,7 @@ "http://postneo.com/icbm": "icbm", "http://purl.org/rss/1.0/modules/image/": "image", "urn:atom-extension:indexing": "indexing", + "http://inspire.ec.europa.eu/schemas/inspire_dls/1.0": "inspire_dls", "http://www.itunes.com/dtds/podcast-1.0.dtd": "itunes", "http://rssnamespace.org/feedburner/ext/1.0": "feedburner", "http://xmlns.com/foaf/0.1/": "foaf", @@ -82,6 +83,7 @@ "http://www.w3.org/1999/xlink": "xlink", "xri://$xrd*($v*2.0)": "xrd", "xri://$xrds": "xrds", + "http://www.w3.org/2001/XMLSchema-instance": "xsi", } unsupported_namespaces = { @@ -100,7 +102,11 @@ def near_miss(ns): stdattrs = [(u'http://www.w3.org/XML/1998/namespace', u'base'), (u'http://www.w3.org/XML/1998/namespace', u'id'), (u'http://www.w3.org/XML/1998/namespace', u'lang'), - (u'http://www.w3.org/XML/1998/namespace', u'space')] + (u'http://www.w3.org/XML/1998/namespace', u'space'), + (u'http://www.w3.org/2001/XMLSchema-instance', u'schemaLocation'), + (u'http://inspire.ec.europa.eu/schemas/inspire_dls/1.0', u'spatial_dataset_identifier_code'), + (u'http://inspire.ec.europa.eu/schemas/inspire_dls/1.0', u'spatial_dataset_identifier_namespace'), + (u'http://inspire.ec.europa.eu/schemas/inspire_dls/1.0', u'crs')] # # From the SAX parser's point of view, this class is the one responsible for From b4eeab890c907c9d0810530b44c0198f90272c6f Mon Sep 17 00:00:00 2001 From: bor8 Date: Wed, 27 Jul 2016 19:28:46 +0200 Subject: [PATCH 2/2] Update entry.py Avoid the error UndefinedElement: "Undefined entry element: inspire:dls_spatial_dataset_identifier_code". --- src/feedvalidator/entry.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/feedvalidator/entry.py b/src/feedvalidator/entry.py index 7f299aa2..b4d1b5df 100644 --- a/src/feedvalidator/entry.py +++ b/src/feedvalidator/entry.py @@ -110,6 +110,12 @@ def do_app_edited(self): def do_app_control(self): return app_control(), noduplicates() + def do_inspire_dls_spatial_dataset_identifier_code(self): + return nows(), noduplicates() + + def do_inspire_dls_spatial_dataset_identifier_namespace(self): + return rfc3987(), nows(), noduplicates() + class app_control(validatorBase): def do_app_draft(self): return yesno(), noduplicates()