Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - Qualified attributes and attribute references in schemas [Thread Next] Re: Qualified attributes and attribute references in schemasTo: 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 | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
