Project

Profile

Help

Bug #2481

closed

NPE in XMLIndenter.java writing attribute with null value

Added by David Lee about 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
s9api API
Sprint/Milestone:
-
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

Also available in: Atom PDF