[Esip-discovery] Datacasting custom elements proposal

Mattmann, Chris A (388J) chris.a.mattmann at jpl.nasa.gov
Fri Mar 25 07:25:27 EDT 2011


Hey Bob,

Thanks for your reply. Comments below:

> I'm far from an expert on schema (and I mean *far*), but it looks like 
> if we wanted to describe additional m-a-m, say for example 
> conforms-to-standard, the only option is to put it in an 
> annotation/appInfo group.  So it might look something like this:
> 
> <xsd:element name="windSpeed" type="xsd:decimal">
>   <xsd:annotation>
>     <xsd:appInfo>
>       <dc:conforms-to-standard>ISO-whatever</dc:conforms-to-standard>
>     </xsd:appInfo>
>   </xsd:annotation>
> </xsd:element>
> 
> The important point here is that the standard we're conforming to is 
> specified in the *schema* - i.e. it applies to all instances of this 
> element being used, just like the name or data type - rather than 
> something that's put in the actual XML document being described.

Yep that's one way to do it. You could also put the above inline in the XML document itself. Check out that link I sent you on inlining schema in XML document instances:

http://msdn.microsoft.com/en-us/library/aa302288.aspx

> 
> What confuses me about this is that it seems like the contents of 
> appInfo are not defined - any well-formed XML is okay.  So can you 
> impose a schema on the schema, that would define what the m-a-m items in 
> appInfo are, so the schema itself could validate?  Or is appInfo simply 
> not validateable?

You could also use e.g., an xsd:annotation too. But you'd also reference the dc: namespace in your XML schema which would reference back to the definition for conforms-to-standard.

> 
> Also, pardon my schema ignorance.  But if you have a well-defined 
> schema, say for datacasting, can that be augmented via additional 
> schemas (namespaces?) *without* changing the datacasting schema itself 
> and still be validateable?  (which is really the same as the question 
> above, about having a schema just for the additions to the schema's 
> schema (did I really just write that sentence??))

LOL. I think James G's answer is what I would say too -- it's possible to do, especially with inline schemas, and with the ability to override definitions. 

> 
> In other words if I have a document like this:
> 
> <a:foo>test
>   <a:date>today</a:date>
> </a:foo>
> 
> which is described by a schema, is it possible to create a schema that 
> defines an additional element, one which drops in to the middle of the 
> above, *without* modifying the original schema?  When the original 
> schema was not designed with such in mind?  e.g.
> 
> <a:foo>test
>   <a:date>today</a:date>
>   <b:time>now</b:time>
> </a:foo>
> 
> Put another way, are schemas subclassable in an object-oriented sense? 
> The goal is for the above to still be a valid a, with additions 
> specified by b, without modifying or duplicating a's schema, yet still 
> be fully validateable.

Yep, they are able to do that. The guru I know for XML schemas is Paul Ramirez on the PDS Engineering Node. He's been doing most of the design implementation of stuff like this at JPL. I've been trying to get him to join the discussion...if anyone else knows Paul, help me encourage him :)

Cheers,
Chris

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: chris.a.mattmann at nasa.gov
WWW:   http://sunset.usc.edu/~mattmann/
Phone: +1 (818) 354-8810
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



More information about the Esip-discovery mailing list