Good old cycle: new release, new bug reports, new fixes ...
- HTMLtree.c HTMLtree.h : closing #53402 i.e. output of
  PIs when using xsl:output
- valid.c: closing #53537 some case generate segfaults if there
  is validity errors
Daniel
diff --git a/valid.c b/valid.c
index fe13778..f6590cc 100644
--- a/valid.c
+++ b/valid.c
@@ -3286,7 +3286,7 @@
 	return(1);
     }
     if (CONT == NULL) return(-1);
-    if (NODE->type == XML_ENTITY_REF_NODE)
+    if ((NODE != NULL) && (NODE->type == XML_ENTITY_REF_NODE))
 	return(-2);
 
     /*
@@ -3643,7 +3643,7 @@
 
 static int
 xmlValidateElementContent(xmlValidCtxtPtr ctxt, xmlNodePtr child,
-		   xmlElementContentPtr cont, int warn) {
+		   xmlElementContentPtr cont, int warn, const xmlChar *name) {
     int ret;
     xmlNodePtr repl = NULL, last = NULL, cur, tmp;
 
@@ -3757,10 +3757,10 @@
 	else
 	    xmlSprintfElements(list, child, 1);
 
-	if ((child->parent != NULL) && (child->parent->name != NULL)) {
+	if (name != NULL) {
 	    VERROR(ctxt->userData,
    "Element %s content doesn't follow the Dtd\nExpecting %s, got %s\n",
-	       child->parent->name, expr, list);
+	       name, expr, list);
 	} else {
 	    VERROR(ctxt->userData,
        "Element content doesn't follow the Dtd\nExpecting %s, got %s\n",
@@ -3996,7 +3996,7 @@
         case XML_ELEMENT_TYPE_ELEMENT:
 	    child = elem->children;
 	    cont = elemDecl->content;
-	    ret = xmlValidateElementContent(ctxt, child, cont, 1);
+	    ret = xmlValidateElementContent(ctxt, child, cont, 1, elem->name);
 	    break;
     }