how to formulize <object id="10">door</object> in XSD?

E

easy.lin

....
<object id="10">door</object>
....

I try to write this in clipse XSD editor
<element name="object" type="string">
<attribute name="id" type="int"></attribute>
</element>

but get wrong message....
 
M

Martin Honnen

...
<object id="10">door</object>
...

I try to write this in clipse XSD editor
<element name="object" type="string">
<attribute name="id" type="int"></attribute>
</element>

If an element has an attribute then in terms of the W3C XSD schema
language it has a complex type so you need e.g.
<xs:element name="object">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="id" type="xs:string" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
 

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,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top