Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


referencing anonymous types

From: Mark Hansen <mark@----------.--->
To: xmlschema-dev@--.---
Date: 7/9/2008 11:20:00 AM
Is there a standard syntax for generating references to anonymous 
types?  I know that XML Schema 1.0 does not provide such a standard.  
Will there be one in XML Schema 1.1 - or in some other, related, standard?

If the answer is "No", can anyone provide a link to a proprietary schema 
type naming syntax that is commonly used?  The validating parsers, like 
Xerces, must use some internal mechanism to generate names.  I'm 
wondering if there is any general consensus on how to do it.

The reason that I'm asking is that I am developing a flexible binding 
tool (named "AdaptiveBindings") for associating XML Schema components 
with programming language defined data structures.  AdaptiveBindings 
allows users to declaratively specify mappings from XML to the 
programming language - kind of like Castor mappings.  The declarative 
mapping syntax works recursively.  An XML type is mapped to a data 
structure by recursively mapping its components to the data structures 
components.  Such a mapping requires a standard mechanism for naming 
anonymous types so that they can be referenced.

Further Elaboration and Example
----------------------------------
The anonymous type naming problem that I'm talking about results when 
anonymous types are nested inside another type definition or element 
declaration.  When use in a global element definition, the anonymous 
type can be referenced by the element name.  Here is an example:

Suppose that you have the following XML 'bar' and complex type 
definition 'bar'.  I can reference the type of 'bar' using the name 
'foo'.  I can reference the type of the child element 'quantity' using 
the name 'xs:int'.  However, I cannot reference the type of child 
element 'item' using any standard syntax that I'm aware of.

<bar>
  <item>Milk</item>
  <quantity>6</quantity>
</bar>

<xs:complexType name="foo">
  <xs:sequence>
    <xs:element name="bar">
      <xs:complexType>
        <xs:sequence>
          <xs:element name="item" type="xs:string/>
        </xs:sequence>
      <xs:complexType>
    <xs:element>
    <xs:element name="quantity" type="xs:int"/>
  <xs:sequence>
<xs:complexType>

XMLBeans provides a proprietary "Schema Type Signature" that is 
described here: 
http://xmlbeans.apache.org/docs/2.0.0/guide/conIntroToTheSchemaTypeSystem.html

Using the XMLBeans approach, the 'item' element's type would be named 
E=item|T=foo

Thanks in advance for any suggestions.

-- Mark



From mike@s... Fri Jul 11 22:35:15 2008
Received: from maggie.w3.org ([193.51.208.68])
	by frink.w3.org wi


transparent
Print
Mail
Digg
delicious
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