Re: [Moderator Action] Where can namespaces be declared in Schemas?

"Mark Young" <mark@kamiak.com> writes:

> Can namespaces be declared from any element within a Schema (as in
> general for XML)?  All the example schemas I've seen have only
> declared namespaces in the Schema element itself.  e.g.:

Yes, per normal namespace rules.

> Also, the following appears for many (all?) element information items, in
> their XML Representation Summaries:
>
>   {any attributes with non-schema namespace . . .}>
> 
> 1)  I suppose this implies that the attributes defined above the comment are
> in (the) schema namespace

No and Yes.  No, because unprefixed attributes are not directly in any
namespace, but as they are associated with their containing element,
which _is_ in the XML Schema namespace, so Yes, they are indirectly
associated with it.

> 2)  Does it mean that a schema writer can put their own attributes into
> element information items?

As long as you qualify them with a namespace other than the XML Schema 
namespace == use a prefix declared for such a namespace, yes.  For
example:

  <xs:element name="foo" type="my:baz" hack:extra="banana"/>

in a context where 'xs', 'my' and 'hack' are all properly declared.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/

Received on Wednesday, 3 January 2001 07:44:10 UTC