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

Schema restriction between attributes

Subject: Schema restriction between attributes
From: "Eran Hammer-Lahav" <xalan@xxxxxxxxx>
Date: Fri, 30 May 2003 16:33:54 -0400
schema restriction attribute
Is there a way in a schema to specify restrictions on one attribute if
another has a certain value? Here is an example:

<?xml version="1.0" ?>
<xs:schema id="x" targetNamespace="x" xmlns:x="x"
xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
 <xs:element name="structure">
  <xs:complexType>
   <xs:sequence>
    <xs:element name="field" minOccurs="0" maxOccurs="unbounded">
     <xs:complexType>
      <xs:attribute name="name" type="xs:string" use="required" />
      <xs:attribute name="type" type="omm:memberType" use="required" />
	<xs:attribute name="typeName" type="xs:string" use="optional" />
     </xs:complexType>
    </xs:element>
   </xs:sequence>
   <xs:attribute name="class" type="xs:string" use="required" />
   <xs:attribute name="dbTable" type="xs:string" use="required" />
  </xs:complexType>
 </xs:element>
</xs:schema>

I want that if structure/@type = 'enum', structure/@typeName will not be
empty. Is there a way to achieve this in the schema? I know I can do this in
the xslt script, by check each value and using the <xsl:message> message to
end execution, but I would like to have the schema control this.

Thanks.

EL



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
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-2013 All Rights Reserved.