public String generateStartTagContent(IDOMElement element) { ISourceGenerator generator = element.getModel().getGenerator(); StringBuffer buffer = new StringBuffer(); buffer.append('#'); buffer.append(element.getLocalName()); NamedNodeMap attributes = element.getAttributes(); int length = attributes.getLength(); for (int i = 0; i < length; i++) { Attr attr = (Attr) attributes.item(i); if (attr == null) { continue; } buffer.append(' '); String attrName = generator.generateAttrName(attr); if (attrName != null) { buffer.append(attrName); } String attrValue = generator.generateAttrValue(attr); if (attrValue != null) { // attr name only for HTML boolean and JSP buffer.append('='); buffer.append(attrValue); } } return buffer.toString(); }
public String generateStartTagContent(IDOMElement element) { ISourceGenerator generator = element.getModel().getGenerator(); StringBuffer buffer = new StringBuffer(); buffer.append(' '); String tagName = generator.generateTagName(element); if (tagName != null) { buffer.append(tagName); } NamedNodeMap attributes = element.getAttributes(); int length = attributes.getLength(); for (int i = 0; i < length; i++) { Attr attr = (Attr) attributes.item(i); if (attr == null) { continue; } buffer.append(' '); String attrName = generator.generateAttrName(attr); if (attrName != null) { buffer.append(attrName); } String attrValue = generator.generateAttrValue(attr); if (attrValue != null) { // attr name only for HTML boolean and JSP buffer.append('='); buffer.append(attrValue); } } buffer.append(' '); return buffer.toString(); }
NamedNodeMap attrs = _element.getAttributes(); for (int i = 0, n = attrs.getLength(); i < n; i++) { Attr a = (Attr) attrs.item(i);
private boolean checkUnknownAttributes(IDOMElement element, CMNamedNodeMap cmAttrs, IReporter reporter, IFile file, IStructuredDocument document, IStructuredDocumentRegion documentRegion) { boolean foundjspattribute = false; NamedNodeMap attrs = element.getAttributes(); for (int i = 0; i < attrs.getLength(); i++) { Attr a = (Attr) attrs.item(i); CMAttributeDeclaration adec = (CMAttributeDeclaration) cmAttrs.getNamedItem(a.getName()); if (adec == null) { // No attr declaration was found. That is, the attr name is // undefined. // but not regard it as undefined name if it includes JSP if (!hasJSPRegion(((IDOMNode) a).getNameRegion())) { String msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_6, a.getName()); LocalizedMessage message = new LocalizedMessage(fSeverityUnknownAttribute, msgText, file); int start = ((IDOMAttr) a).getNameRegionStartOffset(); int length = ((IDOMAttr) a).getNameRegionEndOffset() - start; int lineNo = document.getLineOfOffset(start); message.setLineNo(lineNo); message.setOffset(start); message.setLength(length); reporter.addMessage(fMessageOriginator, message); } else { foundjspattribute = true; } } } return foundjspattribute; }
NamedNodeMap attributes = element.getAttributes(); if (attributes != null) { IDOMNode first = (IDOMNode) attributes.item(0);
NamedNodeMap attributes = element.getAttributes(); if (attributes == null || attributes.getLength() < 2) insertBreak = false;