Chapter 32 Controlling Mapping to XML Schema - %ListOfObjects

Chapter 32 Controlling Mapping to XML Schema - %ListOfObjects

This section shows a portion of the schema generated from a class that supports XML with a class defined as properties. For example, consider the following property definition:XML%ListOfObjects

Property PropName As list Of %Integer(XMLITEMNAME = "MyXmlItemName");

If this property is in an enabled class named Test.DemoObjList1, then the class's schema contains The following:XMLXML

<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:s="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" 
targetNamespace="mytypes">
  <complexType name="DemoObjList1">
    <sequence>
      <element minOccurs="0" name="PropName" type="s01:ArrayOfMyXmlItemNameRegisteredObject" xmlns:s01="mytypes"/>
    </sequence>
  </complexType>
  <complexType name="ArrayOfMyXmlItemNameRegisteredObject">
    <sequence>
      <element maxOccurs="unbounded" minOccurs="0" name="MyXmlItemName" nillable="true" type="s01:RegisteredObject" xmlns:s01="mytypes"/>
    </sequence>
  </complexType>
...
</schema>

For the naming rules of the type, please refer to the class name list. Note that the collection item type is RegisteredObject, which is not defined:

<element maxOccurs="unbounded" minOccurs="0" name="MyXmlItemName" nillable="true" type="s01:RegisteredObject" xmlns:s01="mytypes"/>

Therefore, this architecture cannot be used.

%ArrayOfObjects

This section shows a portion of the schema generated from a class that supports XML with a class defined as properties. For example, consider the following property definition:XML%ArrayOfObjects

Property PropName As %ArrayOfObjects(XMLITEMNAME = "MyXmlItemName", XMLKEYNAME = "MyXmlKeyName");

If this property is in an enabled class named Test.DemoObjArray1, then the class's schema contains The following:XMLXML

<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:s="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="mytypes">
  <complexType name="DemoObjArray1">
    <sequence>
      <element minOccurs="0" name="PropName" type="s01:ArrayOfMyXmlItemNamePairOfMyXmlKeyNameRegisteredObject" xmlns:s01="mytypes"/>
    </sequence>
  </complexType>
  <complexType name="ArrayOfMyXmlItemNamePairOfMyXmlKeyNameRegisteredObject">
    <sequence>
      <element maxOccurs="unbounded" minOccurs="0" name="MyXmlItemName" nillable="true" type="s01:PairOfMyXmlKeyNameRegisteredObject" xmlns:s01="mytypes"/>
    </sequence>
  </complexType>
  <complexType name="PairOfMyXmlKeyNameRegisteredObject">
    <complexContent>
      <extension base="s01:RegisteredObject" xmlns:s01="mytypes">
        <attribute name="MyXmlKeyName" type="s:string" use="required"/>
      </extension>
    </complexContent>
  </complexType>
...
</schema>

For the naming rules of the type, please refer to the class name list. Note that the collection item type is based on RegisteredObject and is not defined:

  <complexType name="PairOfMyXmlKeyNameRegisteredObject">
    <complexContent>
      <extension base="s01:RegisteredObject" xmlns:s01="mytypes">
        <attribute name="MyXmlKeyName" type="s:string" use="required"/>
      </extension>
    </complexContent>
  </complexType>

Therefore, this architecture cannot be used.

Guess you like

Origin blog.csdn.net/yaoxin521123/article/details/134940152