jeudi 30 octobre 2014

XML Schema same attributes names but different attribute values?


Vote count:

0




I have got service with a method with request of a following format:



<soapenv:Envelope xmlns:soapenv="http://ift.tt/sVJIaE" xmlns:com="http://com.org.srv">
<soapenv:Header/>
<soapenv:Body>
<com:methodName>
<com:someParam>value</com:someParam>
<com:param name="firstPoint">
<com:param name="code">value</com:param>
</com:param>
<com:param name="firstPointDesc">
<com:param name="pName">value</com:param>
<com:param name="pLo">value</com:param>
</com:param>
<com:param name="endPoint">
<com:param name="code">value</com:param>
</com:param>
<com:param name="endPointDesc">
<com:param name="pName">value</com:param>
<com:param name="pLo">value</com:param>
</com:param>
<com:param name="bunch">
<com:param name="temperature">val</com:param>
<com:param name="humidity">val</com:param>
<com:param name="pressure">val</com:param>
</com:param>
</com:methodName>
</soapenv:Body>
</soapenv:Envelope>


This information was provided as-is and i need to describe it in xsd file in eclipse. I have tried:



<element name="methodNameRequest">
<complexType>
<sequence maxOccurs="1" minOccurs="1">
<element name="someParam" type="string" maxOccurs="1"
minOccurs="1">
</element>
<element name="deviceId" type="string"></element>
<element name="param" maxOccurs="1" minOccurs="1">
<complexType>
<sequence>
<element name="param" maxOccurs="1"
minOccurs="1">
<complexType>
<simpleContent>
<extension base="string">
<attribute name="name"
type="string" default="code" />
</extension>
</simpleContent>
</complexType>
</element>
</sequence>
<attribute name="name" type="string"
default="firstPoint" />
</complexType>
</element>
<element name="params" maxOccurs="1" minOccurs="1">
<complexType>
<sequence>
<element name="param" maxOccurs="1"
minOccurs="1">
<complexType>
<simpleContent>
<extension base="string">
<attribute name="name"
type="string" default="pName" />
</extension>
</simpleContent>
</complexType>
</element>
<element name="param" maxOccurs="1"
minOccurs="1">
<complexType>
<simpleContent>
<extension base="string">
<attribute name="name"
type="string" default="pLo" />
</extension>
</simpleContent>
</complexType>
</element>
</sequence>
<attribute name="name" type="string"
default="firstPointDesc" />
</complexType>
</element>
<element name="params" maxOccurs="1" minOccurs="1">
<complexType>
<sequence>
<element name="param" maxOccurs="1"
minOccurs="1">
<complexType>
<simpleContent>
<extension base="string">
<attribute name="name"
type="string" default="code" />
</extension>
</simpleContent>
</complexType>
</element>
</sequence>
<attribute name="name" type="string"
default="endPoint" />
</complexType>
</element>
<element name="params" maxOccurs="1" minOccurs="1">
<complexType>
<sequence>
<element name="param" maxOccurs="1"
minOccurs="1">
<complexType>
<simpleContent>
<extension base="string">
<attribute name="name"
type="string" default="pName" />
</extension>
</simpleContent>
</complexType>
</element>
<element name="param" maxOccurs="1"
minOccurs="1">
<complexType>
<simpleContent>
<extension base="string">
<attribute name="name"
type="string" default="pLo" />
</extension>
</simpleContent>
</complexType>
</element>
</sequence>
<attribute name="name" type="string"
default="endPointDesc" />
</complexType>
</element>
<element name="param" maxOccurs="1" minOccurs="1">
<complexType>
<sequence>
<element name="param" maxOccurs="1"
minOccurs="1">
<complexType>
<simpleContent>
<extension base="string">
<attribute name="name"
type="string" default="temperature" />
</extension>
</simpleContent>
</complexType>
</element>
<element name="param" maxOccurs="1"
minOccurs="1">
<complexType>
<simpleContent>
<extension base="string">
<attribute name="name"
type="string" default="humidity" />
</extension>
</simpleContent>
</complexType>
</element>
<element name="param" maxOccurs="1"
minOccurs="1">
<complexType>
<simpleContent>
<extension base="string">
<attribute name="name"
type="string" default="pressure" />
</extension>
</simpleContent>
</complexType>
</element>
</sequence>
<attribute name="name" type="string"
default="bunch" />
</complexType>
</element>
....


but with no success: Multiple elements with name 'param', with different types, appear in the model group. reported by eclipse.


Can anybody provide a valid example of xsd description for this or similar structure? I am not in common with wsdl schemas and services at all.


Many thanks.



asked 59 secs ago







XML Schema same attributes names but different attribute values?

Aucun commentaire:

Enregistrer un commentaire