added code in xmlSchemaBuildAContentModel to handle element reference

* xmlschemas.c: added code in xmlSchemaBuildAContentModel to handle
  element reference within the xs:all construct (bug 139897)
diff --git a/ChangeLog b/ChangeLog
index 809b63c..91f6a6d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed May 12 22:34:03 HKT 2004 William Brack <wbrack@mmm.com.hk>
+
+	* xmlschemas.c: added code in xmlSchemaBuildAContentModel to handle
+	  element reference within the xs:all construct (bug 139897)
+
 Wed May 12 17:27:18 HKT 2004 William Brack <wbrack@mmm.com.hk>
 
 	* xinclude.c: a little further fixing of fallback processing, this
diff --git a/xmlschemas.c b/xmlschemas.c
index 4aa9dc4..e9dfadb 100644
--- a/xmlschemas.c
+++ b/xmlschemas.c
@@ -4473,6 +4473,13 @@
                 start = ctxt->state;
                 while (subtypes != NULL) {
                     ctxt->state = start;
+		    /*
+		     * the following 'if' was needed to fix bug 139897
+		     * not quite sure why it only needs to be done for
+		     * elements with a 'ref', but it seems to work ok.
+		     */
+		    if (subtypes->ref != NULL)
+		        xmlSchemaBuildAContentModel(subtypes, ctxt, name);
                     elem = (xmlSchemaElementPtr) subtypes;		    
                     /* TODO : handle the namespace too */
                     if ((elem->minOccurs == 1) && (elem->maxOccurs == 1)) {