Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - RE: extending validation [Thread Next] RE: extending validationTo: mike@--------.---, --------@------.--, -------------@--.--- Date: 3/19/2005 11:11:00 AM In meta-meta land, code value validation is done by run-time references to federated ebXML registry-repositories containing XSDs with all permissable enumerations so the application can pretty much just go for coffee, but until then check out this XSLT script which seems tailor-made for your example and even includes error handling: http://www-128.ibm.com/developerworks/xml/library/x-tiplook.html Jeni Tennison's book "Beginning XSLT" is a great cookbook for all aspects of referencing external data from XSLT and of course Mike wrote the bible on such matters. Cheers Jack >From: "Michael Kay" <mike@s...> >To: <tgrzej10@g...>,<xmlschema-dev@w...> >Subject: RE: extending validation >Date: Fri, 18 Mar 2005 18:04:51 -0000 > > >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@w... > > [mailto:xmlschema-dev-request@w...] On Behalf Of tgrzej10@g... > > Sent: 18 March 2005 14:59 > > To: xmlschema-dev@w... > > 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 > > > > > > > > > > > _________________________________________________________________ Designer Mail isn't just fun to send, it's fun to receive. Use special stationery, fonts and colors. http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN® Premium right now and get the first two months FREE*. From ht@i... Mon Mar 21 10:07:17 2005 Received: from bart.w3.org ([128.30.52.40]) by frink.w3.org wit | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
