added validation of QName for xsl:element and xsl:attribute (Bug 132531)
authorWilliam M. Brack <wbrack@src.gnome.org>
Thu, 29 Jan 2004 22:08:52 +0000 (22:08 +0000)
committerWilliam M. Brack <wbrack@src.gnome.org>
Thu, 29 Jan 2004 22:08:52 +0000 (22:08 +0000)
* libxslt/transform.c, libxslt/attributes.c: added
  validation of QName for xsl:element and xsl:attribute
  (Bug 132531)

ChangeLog
libxslt/attributes.c
libxslt/transform.c

index 0fd6115..4cd5743 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Jan 29 14:08:31 PST 2004 William Brack <wbrack@mmm.com.hk>
+
+       * libxslt/transform.c, libxslt/attributes.c: added
+         validation of QName for xsl:element and xsl:attribute
+         (Bug 132531)
+
 Fri Jan 23 18:52:22 HKT 2004 William Brack <wbrack@mmm.com.hk>
 
        * libxslt/pattern.c: changed priority of template patterns
index aacac9f..6931130 100644 (file)
@@ -644,6 +644,11 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt, xmlNodePtr node,
         name = comp->name;
     }
 
+    if (xmlValidateQName(name, 0)) {
+        xsltTransformError(ctxt, NULL, inst,
+                       "xsl:attribute : invalid QName\n");
+       /* we fall through to catch any further errors, if possible */
+    }
     ncname = xmlSplitQName2(name, &prefix);
     if (ncname == NULL) {
         prefix = NULL;
index c134337..5fba3e8 100644 (file)
@@ -2533,6 +2533,11 @@ xsltElement(xsltTransformContextPtr ctxt, xmlNodePtr node,
        name = comp->name;
     }
 
+    if (xmlValidateQName(name, 0)) {
+       xsltTransformError(ctxt, NULL, inst,
+               "xsl:element : invalid name\n");
+       /* we fall through to catch any other errors if possible */
+    }
     ncname = xmlSplitQName2(name, &prefix);
     if (ncname == NULL) {
        prefix = NULL;