XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Marc FeickertSubject: XSD: Restricting an attribute so that it must contain text
Author: Marc Feickert
Date: 26 Dec 2007 05:38 PM
I am trying to validate some xml that I am manipulating after finding out that having "" as the value of a necessray attribute causes our tool to crash.

Here is the current snippet of code from my XSD:

<xs:element name="Term">
<xs:complexType>
<xs:attribute name="term" use="required"/>
</xs:complexType>
</xs:element>

An example of the code to be checked is:

<Term term="access"/>

What I want to do is make the following illegal:

<Term term=""/>

As it is right now, my XSD will call such a line valid.

Posttop
Minollo I.Subject: XSD: Restricting an attribute so that it must contain text
Author: Minollo I.
Date: 26 Dec 2007 06:27 PM
<xs:element name="Term">
<xs:complexType>
<xs:attribute name="term" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.