public static boolean isForeign(Element target) { if (!(target instanceof IDOMElement)) return true; IDOMElement element = (IDOMElement) target; return !element.isGlobalTag(); }
/** * Checks if cleanup should modify case. Returns true case should be * preserved, false otherwise. * * @param element * @return true if element is case sensitive, false otherwise */ private boolean shouldPreserveCase(IDOMElement element) { // case option can be applied to no namespace tags return !element.isGlobalTag(); /* * ModelQueryAdapter mqadapter = (ModelQueryAdapter) * element.getAdapterFor(ModelQueryAdapter.class); ModelQuery mq = * null; CMNode nodedecl = null; if (mqadapter != null) mq = * mqadapter.getModelQuery(); if (mq != null) nodedecl = * mq.getCMNode(node); // if a Node isn't recognized as HTML or is and * cares about case, do not alter it // if (nodedecl == null || * (nodedecl instanceof HTMLCMNode && ((HTMLCMNode) * nodedecl).shouldIgnoreCase())) if (! * nodedecl.supports(HTMLCMProperties.SHOULD_IGNORE_CASE)) return * false; return * ((Boolean)cmnode.getProperty(HTMLCMProperties.SHOULD_IGNORE_CASE)).booleanValue(); */ }
/** */ protected void cleanupCSSAttrValue(IDOMNode node) { if (node == null || node.getNodeType() != Node.ELEMENT_NODE) return; IDOMElement element = (IDOMElement) node; if (!element.isGlobalTag()) return; Attr attr = element.getAttributeNode("style"); //$NON-NLS-1$ if (attr == null) return; String value = getCSSValue(attr); if (value == null) return; String oldValue = ((IDOMNode) attr).getValueSource(); if (oldValue != null && value.equals(oldValue)) return; attr.setValue(value); }
if (!xe.isJSPTag() && xe.isGlobalTag() && // global tag CMNodeUtil.getElementDeclaration(xe) != null) { String newName = tagName;
if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.HTML) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.HEAD) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.LINK) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.NOSCRIPT) || tagName.equalsIgnoreCase(JSP11Namespace.ElementName.ROOT) || element.isCommentTag() || (!element.isGlobalTag() && element.isContainer())) { childReplaced();
if (!impl.isGlobalTag()) return true; // non HTML tag IDOMElement childElement = (IDOMElement) child; return false; if (!childElement.isGlobalTag()) return true; // non HTML tag CMElementDeclaration childDec = CMNodeUtil.getElementDeclaration(childElement);
return; boolean isContainer = false; if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.HTML) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.HEAD) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.NOSCRIPT) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.BASE) || tagName.equalsIgnoreCase(JSP11Namespace.ElementName.ROOT) || (!element.isGlobalTag() && element.isContainer())) { isContainer = true;
/** */ private boolean canFormatText(IDOMText text) { if (text == null) return false; IStructuredDocumentRegion flatNode = text.getFirstStructuredDocumentRegion(); if (flatNode != null) { String type = flatNode.getType(); if (isUnparsedRegion(type)) return false; } Node parent = text.getParentNode(); if (parent != null && parent.getNodeType() == Node.ELEMENT_NODE) { IDOMElement element = (IDOMElement) parent; if (!element.isGlobalTag() && !text.isElementContentWhitespace()) return false; } return canFormatChild(parent); }
public void validate(IndexedRegion indexedNode) { Node node = (Node) indexedNode; validateChildren(node); if (node.getNodeType() != Node.ELEMENT_NODE) return; if (!(node instanceof IDOMElement)) return; ElementInfo info = new ElementInfo(); info.target = (IDOMElement) node; // gather information to validate from target at once. getInfo(info); if (info.target.isGlobalTag()) { validateTags(info); validateNames(info); if (info.decl != null && info.isXHTML) { validateTagCase(info); } } }
if (element.isGlobalTag()) { Attr attr = element.getAttributeNode("style");//$NON-NLS-1$ if (attr != null)