Schema element name selectable, attributes not

A

Alex Sab

Hi,
I have a XML structure where the element name can be chosen freely but
the element attributes must be all of the same names.

<Node>
<AnyName1 Type="Single" Unit="" Comment="">0</AnyName1>
<AnyName2 Type="Single" Unit="" Comment="">0</AnyName2>
<AnyName3 Type="Single" Unit="" Comment="">0</AnyName3>
<AnyName4 Type="Single" Unit="" Comment="">0</AnyName4>
<AnyName5 Type="Single" Unit="" Comment="">0</AnyName5>
<AnyName6 Type="Single" Unit="" Comment="">0</AnyName6>
</Node>

Is is possible to make a schema that works for any element name? The
schema should not know about AnyName1, AnyName2, ...

Regards,
Alex
 
M

Martin Honnen

Alex said:
I have a XML structure where the element name can be chosen freely but
the element attributes must be all of the same names.

<Node>
<AnyName1 Type="Single" Unit="" Comment="">0</AnyName1>
<AnyName2 Type="Single" Unit="" Comment="">0</AnyName2>
<AnyName3 Type="Single" Unit="" Comment="">0</AnyName3>
<AnyName4 Type="Single" Unit="" Comment="">0</AnyName4>
<AnyName5 Type="Single" Unit="" Comment="">0</AnyName5>
<AnyName6 Type="Single" Unit="" Comment="">0</AnyName6>
</Node>

Is is possible to make a schema that works for any element name? The
schema should not know about AnyName1, AnyName2, ...

You can use
<xs:any />
to specify that an element with any name can occur but I don't think you
can then restrict the attributes that element can have.
 

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,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top