Page 1 of 1

Enumeration with types

Posted: Wed Mar 21, 2012 3:01 pm
by Jindra2001
Hi all,

I am facing a situation which I do not know how to solve. My customer wants to receive XML in the format below. The values in element <name> are known and can be placed into enumeration. But according to value in <name> the value of <type> changes. How this can be done? Is there any way for such a logic? Thanks a lot for any answer or hints.

Best regards,

Jindra (Czech Republic)

Wanted result
<name>Statement period</name>
<name>Percentage rate</name>

What I have now

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="" elementFormDefault="qualified">
<xs:documentation>Odchozi zprava z C4M. C4M tuto zpravu o zmene stavu hodnoceni posila jen na hodnoceni, ktera jsou svazana s kreditnim navrhem.</xs:documentation>
<xs:element name="CONTENT">
<xs:element ref="PARAMS"/>
<xs:element name="PARAMS">
<xs:element maxOccurs="unbounded" ref="PARAM"/>
<xs:element name="PARAM" type="CT_PARAM_TYPE"/>
<xs:element name="NAME">
<xs:restriction base="ST_string128">
<xs:enumeration value="CLIENT_EVAL_ID"/>
<xs:enumeration value="OLD_STATE_CODE"/>
<xs:enumeration value="NEW_STATE_CODE"/>
<xs:enumeration value="LAST_MOD_NAME"/>
<xs:enumeration value="MODIFICATION"/>
<xs:element default="VARCHAR2(128)" name="TYPE" type="ST_string128"/>
<xs:element name="VALUE" type="ST_string128"/>
<xs:complexType block="" name="CT_PARAM_TYPE">
<xs:element ref="NAME"/>
<xs:element ref="TYPE"/>
<xs:element ref="VALUE"/>
<xs:simpleType name="ST_string128">
<xs:restriction base="xs:string">
<xs:maxLength value="128"/>