public void attribute(int nameCode, CharSequence value)
throws XPathException {
String localName = namePool.getLocalName(nameCode);
String uri = namePool.getURI(nameCode);
String val = value.toString();
Element element = (Element)currentNode;
// must be HTML write mode
if (mode != WriteMode.XML && NamespaceConstant.HTML_PROP.equals(uri)) {
element.setPropertyString(localName, val);
} else if (mode != WriteMode.XML && NamespaceConstant.HTML_STYLE_PROP.equals(uri)) {
// if localName starts with '_-' then remove the underscore e.g _-webkit-transition
if(localName.length() > 1 && localName.charAt(0) == '_' && localName.charAt(1) == '-') {
localName = localName.substring(1);
}
localName = HTMLWriter.getCamelCaseName(localName);
element.getStyle().setProperty(localName, val);
} else if (uri != null && !uri.isEmpty()){
String fullname = namePool.getDisplayName(nameCode);
setAttribute(document, element, fullname, uri, val, mode);
} else {
localName = tableAttributeFix(localName, mode);
element.setAttribute(localName, val);
setAttributeProps(element, localName, val);
}
}