سؤال

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.

هل كانت مفيدة؟

المحلول

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

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top