Add a missing element check
diff --git a/relaxng.c b/relaxng.c
index 18f6a0b..8ac7ff7 100644
--- a/relaxng.c
+++ b/relaxng.c
@@ -39,9 +39,10 @@
static const xmlChar *xmlRelaxNGNs = (const xmlChar *)
"http://relaxng.org/ns/structure/1.0";
-#define IS_RELAXNG(node, type) \
+#define IS_RELAXNG(node, typ) \
((node != NULL) && (node->ns != NULL) && \
- (xmlStrEqual(node->name, (const xmlChar *) type)) && \
+ (node->type == XML_ELEMENT_NODE) && \
+ (xmlStrEqual(node->name, (const xmlChar *) typ)) && \
(xmlStrEqual(node->ns->href, xmlRelaxNGNs)))