Question

I need to create an XML Document with an element that requires the attribute i:nil=true. I've tried <cfset StructInsert(mydoc.employee.name.XmlAttributes, "i:nil", "true")>, but it returns the error The right hand side of the assignment is not of type XML Node. What I would like is this: <name i:nil="true"/>.

The XML is used to call a .NET web service, and the DTD specifies that i:nil="true" is the way to indicate a field is should be null in the database.

Was it helpful?

Solution

Just set it. Don't use structInsert. Example:

mydoc.employee.name.XmlAttributes["i:nil"] = true;

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top