From 4372c60500d95c1517b4ddc7a980cab2777106d8 Mon Sep 17 00:00:00 2001 From: sebd <> Date: Fri, 21 Jan 2005 15:02:51 +0000 Subject: [PATCH] Validates elements against their schemas while in debug mode. --- src/modules/xforms/xforms.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/xforms/xforms.py b/src/modules/xforms/xforms.py index efa9b68..cb0f419 100644 --- a/src/modules/xforms/xforms.py +++ b/src/modules/xforms/xforms.py @@ -1109,6 +1109,11 @@ class Model(WidgetElement): logs.debug('Missing schema file "%s".' % schemaLocation) continue schema = schemaHolder.getRootElement() + if environs.getVar("debug"): + if schema.validateElement(context.specimen.node): + logs.debug("%s is valid against %s." % (context.specimen, schema)) + else: + logs.warning("%s is NOT valid against %s." % (context.specimen, schema)) if modelContext.schemas is None: modelContext.schemas = xmlschemas.SchemasContext( modelContext.specimen, previous = modelContext, uriPathFragment = "schemas")