[libxml2] Properly fold whitespace around the QName value when validating an XSD schema.



commit 2fe372a0aa2cdeb5cf518cf430defba36647c502
Author: Damjan Jovanovic <damjan jov gmail com>
Date:   Sat Aug 21 07:21:50 2021 +0200

    Properly fold whitespace around the QName value when validating an XSD schema.
    
    (May also need fixing in other places.)
    
    Issue: 239

 xmlschemas.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/xmlschemas.c b/xmlschemas.c
index 493db346..7b44bf60 100644
--- a/xmlschemas.c
+++ b/xmlschemas.c
@@ -24634,6 +24634,7 @@ xmlSchemaValidateQName(xmlSchemaValidCtxtPtr vctxt,
                       int valNeeded)
 {
     int ret;
+    xmlChar *stripped;
     const xmlChar *nsName;
     xmlChar *local, *prefix = NULL;
 
@@ -24650,7 +24651,10 @@ xmlSchemaValidateQName(xmlSchemaValidCtxtPtr vctxt,
     * NOTE: xmlSplitQName2 will always return a duplicated
     * strings.
     */
-    local = xmlSplitQName2(value, &prefix);
+    /* TODO: Export and use xmlSchemaStrip instead */
+    stripped = xmlSchemaCollapseString(value);
+    local = xmlSplitQName2(stripped ? stripped : value, &prefix);
+    xmlFree(stripped);
     if (local == NULL)
        local = xmlStrdup(value);
     /*


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