[Home] [By Thread] [By Date] [Recent Entries]

  • From: Rick Jelliffe <rjelliffe@a...>
  • To: "xml-dev@l..." <xml-dev@l...>
  • Date: Thu, 04 Dec 2008 19:59:51 +1100

Readers who are following this thread and are interested in some 
guidance about "what kinds of XSD structures are commonly found in 
data-binding tools"  should look at the W3C document  


  Basic XML Schema Patterns for Databinding Version 1.0


http://www.w3.org/TR/xmlschema-patterns/

The gist is in Appendix F:


    Supported XML Schema elements, attributes and simple types

Now of course, most people will in fact be asking the dual question: 
"what kinds of XSD structures are unwise or unsafe?"  For that, if your 
structure uses an element marked  N/A or does imatch one of the patterns 
linked to, then there is the kind of structure that data-binding tools 
may not implement (well, minimally or at all).

That does not mean you should necessarily avoid them, of course. In most 
cases you could derive a simpler schema and just use that. For example, 
if your schema was    (a, b|c, d[2-32])  you would have to remodel it 
(a, b?, c?, b?,  d*) 

The allowed paths are modeled using XPaths, so I guess it would be 
possible to convert this document into a Schematron schema with each 
XPath (with the initial "." removed) being a rule context with <assert 
test="true()"/> so swallow the element and default rule at the end like
  <rule context="*">
       <report  test="true()">Declaration found which did not match an 
expected Databinding pattern</report>
  </rule>

Validation would then give a list of elements that didn't match those 
patterns. If these included any significant parts declarations, you 
might have to prepare some workaround, I guess.

Cheers
Rick Jelliffe




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member