Chapter 27 Controlling Mapping to XML Schema - Compiler Keywords Affecting Schema

Chapter 27 Controlling Mapping to XML Schema - Compiler Keywords Affecting Schema

VALUELLIST

Add <enumeration> restrictions to the type. Consider the following class:

Class Schema.VALUELIST Extends (%RegisteredObject, %XML.Adaptor)
{
    
    

Parameter XMLTYPENAMESPACE = "mytypes";

Property Property1 As %String;

Property Property2 As %String (VALUELIST = ",r,g,b");

}

The architecture of this class is shown below:

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:s="http://www.w3.org/2001/XMLSchema" 
elementFormDefault="qualified" targetNamespace="mytypes">
  <complexType name="VALUELIST">
    <sequence>
      <element minOccurs="0" name="Property1" type="s:string"/>
      <element minOccurs="0" name="Property2">
        <simpleType>
          <restriction base="s:string">
            <enumeration value="r"/>
            <enumeration value="g"/>
            <enumeration value="b"/>
          </restriction>
        </simpleType>
      </element>
    </sequence>
  </complexType>
</schema>
XMLFractionDigits

applies to %Numeric. This parameter corresponds to the <fractionDigits> facet, as shown in the following fragment:

<element minOccurs="0" name="Property2">
  <simpleType>
    <restriction base="s:decimal">
      <fractionDigits value="2"/>
      <totalDigits value="5"/>
    </restriction>
  </simpleType>
</element>
XMLTotalDigits

applies to %Numeric attributes or %Integer attributes. This parameter corresponds to the <totalDigits> aspect, as shown in the following snippet:

<element minOccurs="0" name="Property2">
  <simpleType>
    <restriction base="s:decimal">
      <fractionDigits value="2"/>
      <totalDigits value="5"/>
    </restriction>
  </simpleType>
</element>
XMLLISTPARAMETER

applies to in an attribute specifying the VALUELIST parameter. Specifies a parameter name that contains a list of values ​​to be projected to rather than the values ​​contained in the object. In most cases, the standard parameter is also specified, and is set equal to "". %StringXMLDISPLAYLISTXMLLISTPARAMETERDISPLAYLIST

XMLLISTPARAMETERThe parameter controls the value attribute used in the <enumeration> restriction.

It cannot be specified as an attribute parameter.

XMLPATTERN

Control mode restrictions. Consider the following class:

Class Schema.Pattern Extends (%RegisteredObject, %XML.Adaptor)
{
    
    

Parameter XMLTYPENAMESPACE = "mytypes";

Property Property1 As %String;

Property Property2 As %String(XMLPATTERN = "[A-Z]");

}

The structure of this class is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:s="http://www.w3.org/2001/XMLSchema" 
elementFormDefault="qualified" targetNamespace="mytypes">
  <complexType name="Pattern">
    <sequence>
      <element minOccurs="0" name="Property1" type="s:string"/>
      <element minOccurs="0" name="Property2">
        <simpleType>
          <restriction base="s:string">
            <pattern value="[A-Z]"/>
          </restriction>
        </simpleType>
      </element>
    </sequence>
  </complexType>
</schema>

If multiple schemas occur in a simple type, the schemas are combined according to https://www.w3.org/TR/xmlschema-2 (see section 4.3.4.3, Schema's XML expression constraints). These patterns are combined in the XMLPATTERN parameter into separate branches within the same pattern (separated by vertical bars).

XSDTYPE

The declaration maps to the type used when mapping to XML. This parameter is set appropriately in all data type classes. The tool uses this parameter when generating the schema. This parameter does not directly affect input and output transformations, although it should be consistent with them. XSDIRISIRIS XML

Guess you like

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