// is
// an element of foreign markup languages, just ignore it.
if (CMUtil.isForeign(childElem))
return;
CMElementDeclaration ced = CMUtil.getDeclaration((Element) child);
// Defect 186774: If a child is not one of HTML elements,
// it should be regarded as a valid child regardless the
// type of the parent content model. -- 10/12/2001
if (ced == null || CMUtil.isSSI(ced) || (!CMUtil.isHTML(ced)))
return;
if (CMUtil.isObsolete(ced)){
error = ErrorState.OBSOLETE_TAG_NAME_ERROR;
break;
}
switch (contentType) {
case CMElementDeclaration.ANY :
// Keep going.
return;
case CMElementDeclaration.ELEMENT :
case CMElementDeclaration.MIXED :
if (ced == null)
return;
if (CMUtil.isValidChild(edec, ced))
return;
// Now, it is the time to check inclusion, unless the
// target
// document is not a XHTML.
if (!CMUtil.isXHTML(edec)) {
// pure HTML
if (CMUtil.isValidInclusion(ced, target))
return;
}
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=218143 -
* ModelQuery use not pervasive enough
*/
if (extendedContent[0] == null) {
extendedContent[0] = ModelQueryUtil.getModelQuery(target.getOwnerDocument()).getAvailableContent(target, edec, ModelQuery.INCLUDE_CHILD_NODES);
}
List availableChildElementDeclarations = extendedContent[0];
/*
* Retrieve and set aside just the element names for faster checking
* later.
*/
int availableChildCount = availableChildElementDeclarations.size();
String elementName = ced.getElementName().toLowerCase(Locale.US);
for (int i = 0; i < availableChildCount; i++) {
CMNode cmnode = (CMNode) availableChildElementDeclarations.get(i);
if (cmnode.getNodeType() == CMNode.ELEMENT_DECLARATION && cmnode.getNodeName().toLowerCase(Locale.US).equals(elementName)) {
return;
}