Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: referencing anonymous types

From: Boris Kolpackov <boris@-------------.--->
To: Mark Hansen <mark@----------.--->
Date: 7/14/2008 11:05:00 AM
Hi Mark,

Mark Hansen <mark@a...> writes:

> 
> 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?

I don't think so. An anonymous type is used when the schema author
believes that it won't be used anywhere else so there is no point
in providing a reference mechanism. If the type is used in more
that one place then it should be named.


> 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 don't think it is a requirement for an implementation to use
some generated names for anonymous types though I know Xerces-C++
does that. The naming scheme would normally depend on whether
the name is user-visible or not. If it's not then any name that
is guaranteed to be unique (e.g., UUID) will do. If the name is
expected to be used by the user then you would want to assign
some meaningful names to anonymous types. Here is what we do
in CodeSynthesis XSD:

1. Use the name of enclosing element/attribute.

2. If it conflicts with existing global types, escape it (e.g.,
   Person1, Person2).

3. Provide a regex-based mechanism for the user to transform
   anonymous type names. For example, the user can add the 'Type'
   suffix to anonymous type names (e.g., PersonType).

We have a separate pass over the schema graph that morphs all
anonymous types into named ones. This way our backends don't
have to worry about anonymous types.

Boris

-- 
Boris Kolpackov, Code Synthesis Tools   http://codesynthesis.com/~boris/blog
Open source XML data binding for C++:   http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing: http://codesynthesis.com/products/xsde

From mike@s... Mon Jul 14 08:25:17 2008
Received: from maggie.w3.org ([193.51.208.68])
	by


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