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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top