@Override public void writeNull() throws IOException { _verifyValueWrite("write null value"); if (_nextName == null) { handleMissingName(); } // !!! TODO: proper use of 'xsd:isNil' ? try { if (_nextIsAttribute) { /* With attributes, best just leave it out, right? (since there's no way * to use 'xsi:nil') */ } else if (checkNextIsUnwrapped()) { // as with above, best left unwritten? } else { if (_xmlPrettyPrinter != null) { _xmlPrettyPrinter.writeLeafNullElement(_xmlWriter, _nextName.getNamespaceURI(), _nextName.getLocalPart()); } else { _xmlWriter.writeEmptyElement(_nextName.getNamespaceURI(), _nextName.getLocalPart()); } } } catch (XMLStreamException e) { StaxUtil.throwAsGenerationException(e, this); } }
@Override public void writeNull() throws IOException { _verifyValueWrite("write null value"); if (_nextName == null) { handleMissingName(); } // !!! TODO: proper use of 'xsd:isNil' ? try { if (_nextIsAttribute) { /* With attributes, best just leave it out, right? (since there's no way * to use 'xsi:nil') */ } else if (checkNextIsUnwrapped()) { // as with above, best left unwritten? } else { if (_xmlPrettyPrinter != null) { _xmlPrettyPrinter.writeLeafNullElement(_xmlWriter, _nextName.getNamespaceURI(), _nextName.getLocalPart()); } else { _xmlWriter.writeEmptyElement(_nextName.getNamespaceURI(), _nextName.getLocalPart()); } } } catch (XMLStreamException e) { StaxUtil.throwXmlAsIOException(e); } }