public void modify(TemplateDocument doc, String value, TagNode t) { ArrayList<Tag> tags = t.getElementsByTagName("img"); for (Tag tag : tags) { if (!tag.hasAttribute("alt")) { tag.addAttribute(new SimpleAttribute("alt", "", line, col)); } } if (t.getTagName().equalsIgnoreCase("img")) { if (!t.hasAttribute("alt")) { t.addAttribute(new SimpleAttribute("alt", "", line, col)); } } }
public void modify(ExpressionContext context, ModifyableTag tag) throws ExpressionEvaluationException { if (expression.asBoolean(context)) { tag.getTagParts().add(new SimpleAttribute("selected", "selected", getLine(), getCol())); } }
element = new SimpleAttribute(currentToken.getLineNo(), currentToken.getColumn()); ((SimpleAttribute) element).setValue(currentToken.value); } else { element = new SimpleAttribute(tok.getAttributeName(), tok.getNameSpace(), tok.getLineNo(), tok.getLineNo()); } else { throw new TemplateParsingException("Error parsing template file. Unterminated tag?", currentToken.getLineNo(), currentToken.getColumn());