Altova Mailing List Archives>Archive Index >xml-dev Archive Home >Recent entries >Thread Prev - RE: [xml-dev] increment pattern for an attribute.. >Thread Next - key and keyref matching in xsd 1.0.. RE: [xml-dev] defining keys in XSD 1.0..To: "'dave'" <ceek63@-----.--->,<xml-dev@-----.---.---> Date: 11/14/2007 8:41:00 PM > ... > <parent a="bc" d="ef"> > <container> > <name> xx </name> > <misc> xx </misc> > </container> > </parent> > ... > > In the above xml, the "key" is composed of attributes 'a','d' > and element 'name'. How do I define a selector and fields > here to define the 'key' in this situation? > Because, the attributes and element are at different > levels/scopes. I am using w3c schema 1.0. > I think you can do <xs:unique> <xs:selector xpath="XXX/parent"/> <xs:field xpath="@a"/> <xs:field xpath="@d"/> <xs:field xpath="container/name"/> </xs:unique> Not sure what XXX is since it depends where you are selecting from. Michael Kay http://www.saxonica.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
