Enumeration with types

This should cover W3C XML Schema, Relax NG and DTD related problems.
Posts: 1

Enumeration with types

Wed Mar 21, 2012 3:01 pm

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="http://www.w3.org/2001/XMLSchema" 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"/>

Return to “XML Schemas”

Who is online

Users browsing this forum: No registered users and 0 guests