[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Dependencies between attributes and elements

From: Michael Kay <mike@saxonica.com>
Date: Tue, 07 Aug 2007 12:21:31 +0100
To: 'João Cruz Morais' <napalm@spiderfish.net>
Cc: xmlschema-dev@w3.org
Message-id: <011e01c7d8e5$1b640a80$313410ac@turtle>
RE: Dependencies between attributes and elements

> 
> 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>
> 


Yes, but only if the attribute has the magic name xsi:type and its value is
the QName of a complex type definition in the schema.

Michael Kay
http://www.saxonica.com/
Received on Tuesday, 7 August 2007 11:21:44 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.