XML schema for parameters needed

D

dmecir

Hi,

I need a XML schema type (or maybe types) for the following XML:

Both should be valid:

<param name="someName">someValue</param>

or

<param name="someName" value="someValue" />

Any hints?

Thanks!

D.
 
M

Martin Honnen

dmecir said:
I need a XML schema type (or maybe types) for the following XML:

Both should be valid:

<param name="someName">someValue</param>

or

<param name="someName" value="someValue" />

<xs:element name="param">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>

is as close as it gets with W3C XML schemas. It will however also allow
<param name="foo" value="bar">foobar</param.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top