Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: Who supports Schema validation of unique [Thread Next] Re: Who supports Schema validation of uniqueTo: NULL Date: 4/14/2009 10:31:00 AM Chip Grandits wrote: > On Apr 8, 12:31 am, "P. Lepin" <p.le...@ctncorp.com> wrote: >> W3C's XML Schema Part 0: Primer SE is a decent reading, if a bit >> on the chewy side. > > Yes, I was afraid of going to the reference, but I must admit for a > standards committee document, its reasonably accessible and > does have good example code. Well, it's a primer and clearly written as such. Good thing W3C bothered to come up with it, too, since I know of no other online introductory materials of even comparable quality. >>> Maybe I don't understand what validation means. >> I think you don't. 'Validation' means testing whether a certain >> XML document complies with an XML Schema (or DTD) you provide. >> Determining whether your schema makes sense at all is a task >> best left for humans, since there are some hard problems in the >> area of formally defining 'makes sense'. [...] > But still it seems both possible and useful for a validating tool to > "evaluate" an xpath value of a selector in an identity constraint > (unique,key or keyref) and then follow that Xpath down from the > parent of the identity constraint and see if such a node currently > exists. If it doesn't, the validating tool would say something like > "your selector does not refer to anything that currently exists > in your schema definition" > > By the way, after much playing around I found that Altova WILL > check the references for you. But you have to hit the validate > button when you are looking at your XSD document in Schema > view. I don't know if I'd call it a "bug", but I'd say it is a > confusing > interface "issue". But that's an issue for Altova support and I > have contacted them. Good feature I suppose, but I'd warn you not to rely on it. This *is* a hard problem, and I wouldn't trust a tool to get it right (especially Altova's tool -- but I'm prejudiced, their XMLSpy">XMLSpy has horrible track record where it comes to standard compliance). >>> I'm having a hard time learning XML, because I learn by example. >> ...which is not a valid learning methodology, unless accompanied >> by attempting to solve problems you come across. >> >> Reading solid introductory materials is a good idea, too. > > Agreed. O'Reilly has always seemed like a solid publisher. > Their book on XML Schema (Eric van der Vlist) is from 2002. > Is that too old? Or has the technology been stable for the last > 7 years? Haven't read it myself, but you should be fine with it. XML Schema 1.0 is from 2001, and 1.1 is still a WD. >> Otherwise you're bound to come back in a couple of weeks asking, >> 'Why the hell can't I express a certain class of constraints >> using XML schemata?' (The answer is, 'Because XML schemata are >> not designed for expressing arbitrary constraints: design from >> mock-up just doesn't work in this case.') > > Now that's an interesting and valuable insight! > How 'bout RELAX NG, is that any better? I haven't touched RELAX NG in a really long while, but from what I recall it's *different*, not better. There are some things RELAX NG schemata can do that W3C XML schemata can't, and vice versa. Another thing for you to consider would be Schematron constraint checker. You can slap Schematron constraints on top of RELAX NG or W3C schema, and it helps some for sure. But if you want in-depth info on either RELAX NG or Schematron, you'd have to ask someone else on the group or do your own research, since I'm very rusty with both of those. -- Waterfall: One Process To Rule Them All | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
