Quantcast
Channel: Creating an XML element with xsi:nil and attributes in .Net/Jaxb - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Creating an XML element with xsi:nil and attributes in .Net/Jaxb

$
0
0

I have an XML Schema that says:

<xs:element name="employerOrganization" nillable="true" minOccurs="1" maxOccurs="1">
  <xs:complexType>
    <xs:sequence>
      ...
    </xs:sequence>
    <xs:attribute name="classCode" type="EntityClassOrganization" use="required"/>
    <xs:attribute name="determinerCode" type="EntityDeterminerSpecific" use="required"/>
  </xs:complexType>
</xs:element>

That means I must be able to create an instance that looks like this:

<employerOrganization classCode="ORG" determinerCode="INSTANCE" xsi:nil="true"/>

According to the XML Schema spec I can (http://www.w3.org/TR/xmlschema-0/#Nils). According to Microsoft .Net I cannot (http://msdn.microsoft.com/en-us/library/ybce7f69(v=vs.100).aspx) and as far as others tell me Jaxb cannot either.

Are both .Net and Jaxb uncompliant? Can I override somehow to get the desired output?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images