Why is the attribute xs:type getting written into my XML Document?

Support FAQ > Liquid XML Data Binding
Please see the W3C standard (http://www.w3.org/TR/xmlschema-1/#xsi_type) for a description of xsi:type.

This value tells a parser which derived type the element should be interpreted as and is required if your XML Schema defines a type in a hierarchy using derivation.

Note: The W3C example use the prefix 'xsi:', the Liquid generated code uses prefix 'xs:', but any prefix can be used. This is declared as an attribute of the root element of the XML document:

xmlns:xs

=http://www.w3.org/2001/XMLSchema-instance

If you do not want to see the xsi:type written into your output XML document, you can set WriteTypeAttribute = false on the serialization context object.

 

C++
LtXmlLib10::CXmlSerializationContext::GetDefaultContext().SetWriteTypeAttribute(false);

C# / VB.NET
LiquidTechnologies.Runtime.Net40.XmlSerializationContext.Default.WriteTypeAttribute = false;

Java
com.liquid_technologies.ltxmllib10.XmlSerializationContext.Default.setWriteTypeAttribute(false);

VB6
LtXmlComLib10.DefaultXmlSerializationContext.WriteTypeAttribute = False

Note that this is a global setting so xs:type will never be written out.

Add Feedback