[xml] [PATCH] Do normalize token datatype value in RelaxNG facet checking



Signed-off-by: Jan Pokorný <jpokorny redhat com>
---
 xmlschemastypes.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/xmlschemastypes.c b/xmlschemastypes.c
index 03a55df..fed9564 100644
--- a/xmlschemastypes.c
+++ b/xmlschemastypes.c
@@ -5311,10 +5311,14 @@ xmlSchemaValidateFacetInternal(xmlSchemaFacetPtr facet,
            /*
            * NOTE that for patterns, the @value needs to be the normalized
            * value, *not* the lexical initial value or the canonical value.
+           * String from @val has the priority if available.
            */
            if (value == NULL)
                return(-1);
-           ret = xmlRegexpExec(facet->regexp, value);
+           ret = xmlRegexpExec(facet->regexp,
+                               (val && val->type == XML_SCHEMAS_TOKEN
+                                    && val->value.str) ? val->value.str
+                                                       : value);
            if (ret == 1)
                return(0);
            if (ret == 0)
-- 
1.8.1.4



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]