Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Attribute for first element only

Status
Not open for further replies.

FredsFriend

Programmer
Dec 10, 2005
3
0
0
GB
Hi i'm not sure of how to specify in a W3C schema that the first element only has a specific attribute.
e.g.

<example>
<component firstOnly="stuff">one</component>
<component>two</component>
<component>three</component>
</example>

Or can this sort of thing only be done with RELAX NG or Schematron?
 
You can't do this via an XSD -- all "component" tags are treated the same, so specifying the attribute as optional will result in any of them potentially using it.

Chip H.


____________________________________________________________________
Donate to Katrina relief:
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top