Actions
Bug #2481
closedNPE in XMLIndenter.java writing attribute with null value
Start date:
2015-10-22
Due date:
% Done:
100%
Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:
Description
saxon-version="9.6.0.7"
saxon-edition="HE"
java-version="1.8.0_40"
java-name="Java HotSpot(TM) 64-Bit Server VM"
Using the saxon Serializer, StreamWriterToReciever, with INDENT option which loads tehe XMLIndenter class.
This method throws an NPE
public void attribute(NodeName attName, SimpleType typeCode, CharSequence value, int locationId, int properties)
throws XPathException {
if (value.equals("preserve") && // --->>> if value is null here, does not need to be xml:space, NPE
attName.hasURI(NamespaceConstant.XML) &&
attName.getLocalPart().equals("space") &&
suppressedAtLevel < 0) {
// Note, we are suppressing indentation within an xml:space="preserve" region even if a descendant
// specifies xml:space="default
suppressedAtLevel = level;
}
bufferedAttributes.addAttribute(attName, typeCode, value.toString(), locationId, properties);
//nextReceiver.attribute(nameCode, typeCode, value, locationId, properties);
}
Without using the INDENT option then no NPE.
Details on request
Please register to edit this issue
Actions