inXInclude--;
} // end if
} // end if
CElement elem = null;
if (parser.htmlDocument) {
elem = document.createElementInternal(name, indexSep);
if (currentElement != document && elem instanceof IHtmlValidChild) {
while (!isValidChild(name, currentElement)) {
parseEndTag(currentElement.name, -1);
if (currentElement == document)
break;
}
}
} else {
elem = new CElement(name, document, indexSep);
}
elem.listChild = new CNodeList(false);
if (firstTag) {
if (parser.htmlDocument) {
document.setHTMLDocument(true);
} // end if
firstTag = false;
document.loadXSD(elem);
if (isAutodoctype() && document.getDoctype() == null) {
CDocType dt = (CDocType) CXmlParser.dtTr.cloneNode(true);
document.appendChildInternal(dt);
document.setDocumentType(dt);
}
} // end if
if (count > 0) {
if (elem.listAttributes == null) {
elem.listAttributes = new CNamedNodeMap(elem);
elem.listAttributes.list = attributes;
elem.listAttributes.count = count;
for (int i = 0; i < count; i++) {
CAttr attr = attributes[i];
attr.parentNode = elem;
attr.ownerDocument = document;
if (attr.name == "xmlns" || attr.prefix == "xmlns") {
elem.notifyNSChange(attr.localName);
}
}
} else {
for (int i = 0; i < count; i++) {
CAttr attr = attributes[i];
attr.parentNode = elem;
attr.ownerDocument = document;
if (attr.name == "xmlns" || attr.prefix == "xmlns") {
elem.notifyNSChange(attr.localName);
}
if (elem.listAttributes == null) {
elem.listAttributes = new CNamedNodeMap(elem);
}
elem.listAttributes.setNamedItemForce(attr);
} // end for
}
}
if (currentElement == document) {
document.appendChildInternal(elem);
} else {
elem.parentNode = currentElement;
currentElement.listChild.addItem(elem);
}
if (XIncludeAware
&& "http://www.w3.org/2001/XInclude".equals(elem
.getNamespaceURI())) {
handleXInclude(elem);
} // end if
else {
if (parser.htmlDocument && elem instanceof IHtmlValidChild) {