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

RE: extending validation

From: Michael Kay <mike@saxonica.com>
Date: Fri, 18 Mar 2005 18:04:51 -0000
To: <tgrzej10@gazeta.pl>, <xmlschema-dev@w3.org>
Message-ID: <E1DCLqE-0006mo-Ut@frink.w3.org>
RE: extending validation

You could try generating a schema with the required values, but I'm not sure
why you would want to. There is always going to be some application-level
logic (including error checking) that you can't put in the schema. Why not
put the data through a stylesheet after putting it through the schema?

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: xmlschema-dev-request@w3.org 
> [mailto:xmlschema-dev-request@w3.org] On Behalf Of tgrzej10@gazeta.pl
> Sent: 18 March 2005 14:59
> To: xmlschema-dev@w3.org
> Subject: extending validation
> 
> 
> Hi,
> My question is about technology that would allow to validate
> element's value against (let's say) database content. For example
> I'd like to make a validation rule like this:
> 
> <xsd:simpleType name="USState">
>   <xsd:restriction base="xsd:string">
>     <xsd:enumeration value="AK"/>
>     <xsd:enumeration value="AL"/>
>     <xsd:enumeration value="AR"/>
>     <!-- and so on ... -->
>   </xsd:restriction>
> </xsd:simpleType>
> 
> but with enumeration values taken from external resource (like
> database).
> One way to achive this seems to be to dynamically generate required
> schema based on database content. On the other hand maybe there are
> existing schema validators that allow to call custom functions (that
> would perform neccessary checks) while validating a document. Or
> maybe in XML Schmema itself there is some construct that would allow
> to tell "call external procedure foo to validate this element".
> 
> 
> I'd be gratefull for any hints and comments,
> -- 
> Tomek Grzejszczyk
> 
> 
> 
> 
Received on Friday, 18 March 2005 18:04:59 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.