Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Qualified attributes and attribute references in schemas

From: Jeni Tennison <jeni@------------.--->
To: Adam van den Hoven <avandenhoven@-----.--->
Date: 7/21/2004 11:53:00 PM
Hi Adam,

> As far as I can read in Eric Meyer's book the form should follow the
> default set in the root xs:schema element.

That's correct: the default for the "form" should follow the default
set on the <xs:schema> element. *However*, "form" only applies to
locally declared elements and attributes. If you declare an element or
attribute at the top level of your schema (as you have with foo), then
it is always in the target namespace for the schema. Attributes that
have a namespace must be qualified within the instance document, hence
you must refer to the attribute as 'b:foo' rather than just 'foo'.

If you want to made the foo attribute reusable, declare it within an
attribute group:

<xs:attributeGroup name="foo">
  <xs:attribute name="foo" type="xs:string" />
</xs:attributeGroup>

and then refer to it with:

  <xs:attributeGroup ref="b:foo" />

This way, the declaration is local, and the form determines whether or
not the attribute is in the target namespace of the schema or not.
With attributeFormDefault set to "unqualified" (the default) and no
overriding form attribute on the <xs:attribute> declaration, the
attribute will be in no namespace.
  
Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/

From illyric@t...  Fri Jul 23 03:41:05 2004
Return-Path: <illyric@t


transparent
Print
Mail
Like It
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