Attributes to customize XML serialization / Customizing XML serialization |
Map a BDL RECORD type definition to an XML Schema complexType.
TYPE mycomplextype RECORD ATTRIBUTES(XSComplexType, XSTypeName="MyComplexType",XSTypeNamespace="http://tempuri.org") name DYNAMIC ARRAY ATTRIBUTES(XMLList) OF RECORD ATTRIBUTES(XMLSequence="nested") firstname STRING ATTRIBUTES(XMLName="FirstName"), lastname STRING ATTRIBUTES(XMLName="LastName") END RECORD, date DATE ATTRIBUTES(XMLAttribute,XMLName="Date") END RECORD
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://tempuri.org" elementFormDefault="qualified" > <xsd:complexType name="MyComplexType"> <xsd:sequence maxOccurs="unbounded"> <xsd:element name="FirstName" type="xsd:string" /> <xsd:element name="LastName" type="xsd:string" /> </xsd:sequence> <xsd:attribute name="Date" type="xsd:date" use="required"/> </xsd:complexType> </xsd:schema>