Re: [SOAP] XML Schema
| From: | Al Baker | Date: | Sat, 23 Oct 2004 02:00:05 +0000 |
| Subject: | Re: [SOAP] XML Schema | ||
| References: | 1 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-1633@lists.php.net to get a copy of this message | ||
WSDL 1.1 recommends that you do not use attributes, but just elements.
On Wed, 2004-10-13 at 15:17 +0200, Stefan Reimers wrote:
> Hi folks,
>
> I need some help on a XML Schema problem that should be quite easy to solve:
>
> I am currently working on a set of identical client, that shall
> communicate with each other via NuSOAP. They share data from a
> relational database and I use a XML Schema for mapping the relational to
> XML data and back.
>
> Now I have made a schema and experienced the following problem:
>
> imagine you have an element which is of simpleType:
>
> <xs:element name="thing" type="xs:string"/>
>
> this element shall have an attribute, so I extend the element, making a
> complexType:
>
> <xs:element name="thing" type="xs:string">
> <xs:complexType mixed="true">
> <xs:attribute name="info" type="xs:string"
> use="required"/>
> </xs:complexType>
> </xs:element>
>
> My intention was to create a element like this:
>
> <thing info="foo">bla</thing>
>
> The problem is, my validator tells me, I cannot declare the type
> "string" to my "thing" anymore, which seems logical because I converted
> it to a complex type. The mixed="true" ensures that I can fill the
> element with "bla". So I skipped the type of the element thing.
> But I need to be sure, that the "bla" is a string anf e.g. no integer.
>
> Anyone's got a clue how to get sure the "thing" is a string?
>
> thx in advance
> Stefan
>