[WF-Protocols] re: first attempt with xml schema (quick comments)
Frank O'Connor
frank at oconnors.org
Sun Jul 6 20:45:03 PDT 2003
I have a few comments.
1. Matze, none of your XSD's appear to be valid XML :) You may want to throw them in IE or Mozilla and let the XML parsers warn you where you have mistakes (for example: <xsd:documentation>The name of the model</documentation> in omf.xsd [lack of namespace prefix on closing tag]).
2. With regards to how to represent array data (vector3, matrix3, ...etc) the XML Schema Working group explicitly did not put in complex array data types. A quote form the WG Mailing Lists regarding this and how such types (vectors) should be handled follows:
---- BEGIN QUOTE ----
"'Lists' were included in XML Schema as a minimal generalization of legacy constructions for NMTOKENS and IDREFS, etc. The general view of the WG was that simple datatypes (suitable for describing attributes) should ideally be restricted to atomic values. More complex constructions (lists of lists, lists of tuples or vectors) should be constructed as "complex datatypes", i.e., using nested element markup constructions in XML
Minor points:
As noted the WG generally frowns on compound simple datatypes,
hence:
<dimensions>
<dim> 2 </dim>
<dim> 4 </dim>
</dimensions>
would be preferred to the syntax:
<dim> 2 4 </dim>
Similarly, proposals to flatten arrays would be discouraged
because they implicitly specify markup (structure).
Thus detailed mark up syntax:
<array>
<arrayElement> 1.0 </arrayElement>
<arrayElement> 2.0 </arrayElement>
<arrayElement> 3.0 </arrayElement>
<arrayElement> 4.0 </arrayElement>
</array>
would be preferred to the flattened syntax :
<array> 1.0 2.0 3.0 4.0 </array>
The flattened syntax is similar to the array syntax of XSIL.
Observe that the detailed mark up syntax is easier to extend
to nested arrays. It is also easier to process in XSLT."
---- END QUOTE ----
I've had to deal with data that uses the flattened syntax and it is Not Fun (tm) in my opinion. Specifically I was trying to transform such data using XSLT. While possible, it's obfuscates your transforms dramatically. Also, if you want to use XPATH to get to a specific value in a tuplet, it would be much faster and easier if you don't have to include XPATH string manipulation functions. Actually I'm not certain if you could use a single XPATH statement to get say the 3rd value of a flattened float list. I think you would have to apply a template to it and recurse to split on the spaces (this is what i recall having to do).
-frank (malakai on irc)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /archive/attachments/20030706/6c352294/attachment.htm
More information about the Protocols
mailing list