in src/main/java/org/apache/sling/scripting/sightly/impl/plugin/AttributePlugin.java [97:113]
private SingleAttributeInvoke(String attributeName, Expression expression, CompilerContext compilerContext) {
this.attributeName = attributeName;
this.attrValue = compilerContext.generateVariable("attrValue_" + attributeName);
this.escapedAttrValue = compilerContext.generateVariable("attrValueEscaped_" + attributeName);
this.isTrueValue = compilerContext.generateVariable("isTrueValue_" + attributeName);
this.shouldDisplayAttribute = compilerContext.generateVariable("shouldDisplayAttr_" + attributeName);
this.node = expression.getRoot();
if (!expression.containsOption(Syntax.CONTEXT_OPTION)) {
this.contentNode = escapeNodeWithHint(
compilerContext,
new Identifier(attrValue),
MarkupContext.ATTRIBUTE,
new StringConstant(attributeName));
} else {
this.contentNode = new Identifier(attrValue);
}
}