- From: apollo <apollo135@gmail.com>
- Date: Mon, 15 Feb 2010 04:23:52 +0100
- To: xmlschema-dev@w3.org
Hi,
I am a new user of gSOAP and I need to write an XSD following certain
specifications (see table below). So, Could someone please help and
correct the XSD I described below?
Here is an example of the table as the XSD should be:
------------------------------------
| table_1 |
|-----------------------------------
| mandatory | var_1: string |
| // | var_2: string |
| // | var_3: real |
| // | var_4: string |
| // | var_5: string |
|---------------|-------------------|
| optional | var_6: integer |
| // | var_7: integer |
| // | var_8: real |
-----------------------------------
Here is the XSD file I wrote:
----------------
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:tns="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
elementFormDefault="qualified" blockDefault="#all" >
<xsd:import
namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
schemaLocation="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
/>
<xsd:import
namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
schemaLocation="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
/>
<complexType name="table_1">
<sequence>
<element name="var_1" type="xsd:string" />
<element name="var_2" type="xsd:string" />
<element name="var_3" type="xsd:decimal" />
<element name="var_4" type="xsd:string" />
<element name="var_5" type="xsd:string" />
<element name="var_6" type="xsd:integer" minOccurs="0" maxOccurs="1" />
<element name="var_7" type="xsd:integer" minOccurs="0" maxOccurs="1" />
<element name="var_8" type="xsd:string" minOccurs="0" maxOccurs="1" />
</sequence>
</complexType>
</xs:schema>
----------------
Actually I have got several tables and all are similar in terms of
variables but different in terms of contents. So is there any way to let
a C++ program to choose a table that is corresponding to the name of the
variable 1.
Thanks for your help and replies,
Received on Monday, 15 February 2010 03:32:37 UTC