Re: Who supports Schema validation of unique



On Apr 8, 12:31 am, "P. Lepin" <p.le...@xxxxxxxxxxx> 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
  <selector xpath="!@!@!"/>
causes a validation error, but
  <selector xpath="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
.



Relevant Pages

  • Re: Implementing IODEF XML Schema in SQL 2005
    ... The XML Schema has a DTD at the top. ... Note that if the DTD performs the function of constraining the XML data, ... "Pro SQL Server 2008 XML" ...
    (microsoft.public.sqlserver.xml)
  • Re: Microsoft & Ada (and also a remark on DTDs prohibiting
    ... DTDs have a horrible syntax. ... Schema definitions can be more specific about a mapping of XML ... String in Ada?). ... data representation 1:1 onto an external XML Schema. ...
    (comp.lang.ada)
  • Re: Yet another XML and Ada issue
    ... What would happen if I suggested to this news group that Ada be ... replaced by "a more compact notation" "useful for writing programs ... I admit that schema import statements are overly verbose. ... > A note on XML Schema types, they are far away from abstraction. ...
    (comp.lang.ada)
  • Re: Target namespace - Schema - Instances
    ... I tried find public-ready version of the best practice document, ... And one other thing is that Microsoft and IBM ... discussing best practice for XML schema design. ...
    (microsoft.public.biztalk.general)
  • Re: Inheritance in XSD?
    ... There are probably errors in your schema. ... What you want to do is generally not possible with W3C XML Schema. ... > approach is to define an abstract tableType, then define derived types ... > derivation by restriction to express this sort of thing. ...
    (microsoft.public.dotnet.xml)