xsi:nil and pub.xml:xmlNodeToDocument

The documentation for pub.xml:xmlNodeToDocument states that any XML elements containing an attribute will be converted to an IS document with the attribute (with @ prefix) and *body as children. For an element such as the resulting document will be

document
…myField
@xsi:nil = true

Reviewing various posts it is inferred that xmlNodeToDocument, when used with documentTypeName input specified and the document type defines the field as a string to allow nulls, that it would convert the element to a null object instead of an IS document.

document
…myField = $null

I’ve tried a number of things but it always converts the element to an IS document. Having it behave this way would be helpful in a variety of ways. :slight_smile:

Pertinent info:

  • xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” is present in the root element of the document
  • Other needed namespaces are present in the rool element of the document
  • The document type defines elements with the namespaces
  • nsDecls is set with the desired namespaces and prefixes
  • preserveUndeclaredNS is not set (default is false)
  • IS 9.7, fix 8

If anyone has info that would enable this behavior it would be very appreciated. Or if someone has info that indicates xmlNodeToDocument cannot be made to do this, that would be good too.

Thanks!

Rob

You can try this:
“watt.server.SOAP.treatNilAsNull”

https://empower.softwareag.com/sl24sec/SecuredServices/KCFullTextASP/viewing/view.asp?prdfamily=Integration&KEY=116657-10297981&DSN=PIVOTAL&DST=TCD

Thanks!