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 unique Re: Who supports Schema validation of uniqueTo: NULL Date: 4/10/2009 7:55:00 AM On Apr 8, 12:31=A0am, "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. > > Yet I can put anything in the xpath attribute for selector, hit the F8 > > key, and and Altova gives me the green check mark saying everything is = OK. > > well I can't type in anything > > =A0 <selector xpath=3D"!@!@!"/> > > causes a validation error, but > > =A0 <selector xpath=3D"obviouslyNonExistentXpathExpressionSubset"/> > > is perfectly OK. > > You're talking nonsense. 'xpath' attribute on 'selector' element > can be arbitrarily complex. So can be the rest of your schema. > Checking whether your XPath expressions make sense in context of > a given schema simply isn't a viable option. > > > 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'. O.K. perhaps validation is the wrong word here. Maybe I should use a term like "reference following" I agree that any valid value for "A restricted XPath expression" is pretty broad. But my understanding is that a selector for an identity constraint is useful because it refers to something. And I believe that the XPath starts at the element that is the parent of the identity constraint. Now I know that XML and Schema are designed to be extensible with such constructs as xs:any. 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. > > > 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? > 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? > > Is there a software tool that does the kind of validation I am looking > > for? > > I believe the hourly rates on the 'software' tools you're > looking for are normally well above $100/hour. Although you > might be able to save some if you outsource to Asia or Eastern > Europe. Well if we can get 'em to stop developing bogus credit derivative financial instruments for AIG and Lehman Brothers, etc. and actually do something productive for society, I'm happy to see they get well compensated. But seriously - Thank you very much for your help and insights. I very much appreciate all the help you've already given me. -Chip Grandits Advanced Technology Associates | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
