Re: Help in writing XSD for gSOAP

Apollo,

We have a simple introduction to XSD that might help.  It is at:

http://www.codalogic.com/lmx/xsd-overview.html

As a note, you don't need your xsd:import statements and you need to sort 
out your use of namespaces and namespace prefixes.

HTH,

Pete Cordell
Codalogic Ltd
Interface XML to C++ the easy way using XML C++
data binding to convert XSD schemas to C++ classes.
Visit http://codalogic.com/lmx/ or http://www.xml2cpp.com
for more info
----- Original Message ----- 
From: "apollo" <apollo135@gmail.com>
To: <xmlschema-dev@w3.org>
Sent: Monday, February 15, 2010 3:23 AM
Subject: Help in writing XSD for gSOAP


>
> 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 16:10:01 UTC