- From: <bugzilla@wiggum.w3.org>
- Date: Tue, 04 Aug 2009 04:32:11 +0000
- To: www-xml-schema-comments@w3.org
http://www.w3.org/Bugs/Public/show_bug.cgi?id=7198 --- Comment #4 from Mukul Gandhi <gandhi.mukul@gmail.com> 2009-08-04 04:32:11 --- (In reply to comment #2) > Here's a use case: a document has an outermost element of <product-data> with a > version attribute whose value is version="1" or version="2". Deep within the > document, element size has two alternative types: if version="1" the type is > string with a pattern facet [0-9]+(in|cm); if version="2" the type is a complex > type with simple content allowing instances such as <size units="cm">5</size>. > > To make this work with conditional type assignment, you make > product-data/@version an inherited attribute, and you make the type of the size > element have two alternatives, one being a simple type, the other a complex > type with simple content. You can refer to @version as an inherited attribute > in the test expression of the xs:alternative elements, even though the version > attribute can't actually appear on the size element. > > Now, it might have been clearer to the reader if the XPath expression had been > ../@version rather than ./@version. We're trying to have our cake and eat it > here: to disallow context-dependent validation while also allowing it in a > limited number of cases where we think it makes sense. There might be better > ways we could have done it, but we were trying to compromise between these two > objectives and that's what we did. Thanks, Mike for the explanation. It's quite helpful. Regards, Mukul -- Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug.
Received on Tuesday, 4 August 2009 04:32:21 UTC