Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - RE: Dependencies between attributes and elements >Thread Next - Why does the default namespace not apply to attributes? Re: Dependencies between attributes and elementsTo: "Michael Kay" <mike@--------.---> Date: 8/7/2007 12:07:00 PM Thanks for your answer Michael, I think I'll deal with the document structure with XSD and do the remaining validation in my java app. One more thing though: Right now I'm using an element called int-vector to specify a list of int values. Is it possible to make that element go away and replace it for a generic one, with an attribute specifying the vector type? In other words is it possible to establish a relationship between the value of an element attribute and his children? Example: <vector type="int"> <value>2</value> <!-- if not int throws a error --> </vector> Thanks a lot, Jo=E3o On 06/08/07, Michael Kay <mike@s...> wrote: > > Given this simple xml: > > > > <vector size="2"> > > <value>1</value> > > <value>3</value> > > </vector> > > > > Is there a way to validate the number of <value> elements > > according to the vector size attribute? > > I'm tempted to say no, so should I make this kind of > > validation inside my program? > > XML Schema 1.1 will add this capability using assertions: > > <xs:assert test="count(value) = @size"/> > > Meanwhile you have to resort to other approaches, e.g. your own validatio= n > code in XSLT, or Schematron. > > Michael Kay > http://www.saxonica.com/ > > -- Jo=E3o Cruz Morais From andydt@e... Tue Aug 07 10:46:40 2007 Received: from aji.w3.org ([133.27.228.225]) | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
