Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: How to reference a value in the xml instance document from schema?

From: noah_mendelsohn@--.---.---
To: Daniel Einspanjer <deinspanjer@-----.--->
Date: 11/16/2004 5:32:00 PM
>> I am so happy to hear that my research 
>> turned up nothing because it is not possible as
>> opposed to my just not "getting it" or "looking 
>> in the wrong place".

Nope, you're doing fine.  You might want to look into Schematron[1]. It's 
not ubquitously deployed as a standard, but there is fairly widespread use 
in some communities.  It can function as an adjunct to XML Schema and I 
believe it can within limits capture constraints of the sort you seek.  I 
say within limits because, though I'm not a Schematron expert,  I >think< 
it's based on XSL 1.0 and the related XPath 1.0 and I suspect  that means 
that its knowledge of XML Schema types is limited.  Still, my guess is 
that it can do arithmetic sufficient to capture the sorts of integer tests 
you have below.   If you were doing this with real xsd:dates I'd be a bit 
more worried. A Schematron expert can probably verify my speculations.

Noah

[1] http://www.schematron.com/

--------------------------------------
Noah Mendelsohn 
IBM Corporation
One Rogers Street
Cambridge, MA 02142
1-617-693-4036
--------------------------------------








Daniel Einspanjer <deinspanjer@g...>
11/16/04 05:33 PM
Please respond to Daniel Einspanjer

 
        To:     "noah_mendelsohn@u..." <noah_mendelsohn@u...>
        cc:     xmlschema-dev@w...
        Subject:        Re: How to reference a value in the xml instance document from schema?


Thank you very much for your prompt response.  I am so happy to hear
that my research turned up nothing because it is not possible as
opposed to my just not "getting it" or "looking in the wrong place".


On Tue, 16 Nov 2004 16:40:34 -0500, noah_mendelsohn@u...
<noah_mendelsohn@u...> wrote:
> These are an example of so-called co-occurrence constraints.  Schema 1.0
> has very limited support for these and cannot in any obvious way handle
> your use case.  We are looking at enhancements for Schema 1.1.  I should
> note that your example, simple as it is, rates as one of the more
> aggressive, as you are doing comparisons of >values< in the document; 
many
> other use cases involve primarily occurrence constraints such as "either
> this attribute or that element, but not both, may appear".   We're
> considering a variety of mechanisms and options.  No guarantee that
> anything will happen, but we are working on it.  This is a very common
> request.
> 
> --------------------------------------
> Noah Mendelsohn
> IBM Corporation
> One Rogers Street
> Cambridge, MA 02142
> 1-617-693-4036
> --------------------------------------
> 
> Daniel Einspanjer <deinspanjer@g...>
> Sent by: xmlschema-dev-request@w...
> 11/16/04 02:03 PM
> Please respond to Daniel Einspanjer
> 
>         To:     xmlschema-dev@w...
>         cc:     (bcc: Noah Mendelsohn/Cambridge/IBM)
>         Subject:        How to reference a value in the xml instance 
document from schema?
> 
> 
> 
> 
> Hi folks, I hope that this question makes sense and that it isn't
> trivial. I've searched the web and this list's archive before asking
> it but I cannot find any leads. :/
> 
> In XML Schema, is it possible to refer to a value in the XML document
> for purposes of schema validation?  I know that you could use an
> appdata node to call out to some other type of schema validator such
> as schematron, but I'm hoping this is possible in pure XML Schema.
> 
> An example might be easiest.
> 
> good xml doc
> <person birthYear="1973" deathYear="2004"/>
> 
> bad xml doc
> <person birthYear="2004" deathYear="1999"/>
> 
> can I write a minInclusive restriction in an XML Schema such that the
> schema validates that deathYear is greater than or equal to birthYear?
> 
> Thanks for your time,
> 
> Daniel Einspanjer
> 
>




From suderman@c... Wed Nov 17 23:30:38 2004
Received: from lisa.w3.org ([128.30.52.41])
	by frink.w3.org with esmtp (Exim 4.34)
	id 1CUZ


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent