else if ("data".equals(localName))
attr = new Attribute("data", pi.getData());
else
attr = new Attribute(localName, pi.getValue(localName));
} else if (node instanceof DocType) {
DocType doctype = (DocType)node;
if ("publicId".equals(localName))
attr = new Attribute("publicId", doctype.getPublicID());
else if ("systemId".equals(localName))
attr = new Attribute("systemId", doctype.getSystemID());
else if ("elementName".equals(localName))
attr = new Attribute("elementName", doctype.getElementName());
}
// With 2.1 semantics it makes more sense to just return a null and let the core
// throw an InvalidReferenceException and the template writer can use ?exists etcetera. (JR)
else {
return null;