Re: xmlns:XXX

Hi Holger,

Holger.Joukl@LBBW.de wrote:

> Hi there,
> Iīm just getting more and more confused :-(
>
> This is the XML Representation summary of the Rec:
>
> ---Snip-----------------------------------------------------------------------------------------
> XML Representation Summary: schema Element Information Item
>     <schema
>       attributeFormDefault = (qualified | unqualified) : unqualified
>       blockDefault = (#all | List of (extension | restriction |
> substitution))  : ''
>       elementFormDefault = (qualified | unqualified) : unqualified
>       finalDefault = (#all | List of (extension | restriction))  : ''
>       id = ID
>       targetNamespace = anyURI
>       version = token
>       xml:lang = language
>       {any attributes with non-schema namespace . . .}>
>       Content: ((include | import | redefine | annotation)*, (((simpleType
> | complexType | group | attributeGroup) | element | attribute | notation),
>     annotation*)*)
>     </schema>
> ---/Snip----------------------------------------------------------------------------------------
>
> Now what is meant by " {any attributes with non-schema namespace . . .}"?
> Are these attributes simply not interpreted?

{any attributes with non-schema namespace . . .} means that you can add any attribute to the
xs:schema element as long as it's not in the XML Schema namespace. In the schema-for-schema the
xs:schema element type (as well as most other types) is declared with:

<xs:anyAttribute namespace="##other" processContents="lax"/>

This means that you can use any attributes you want as long as they're not in the
"http://www.w3.org/2001/XMLSchema" namespace. Since processContents="lax" the schema processor will
only validate them if it can find a schema for the namespace otherwise no validation will be
performed.


> What about the "xmlns:XXX="-namespace-association-with-a-prefix
> declarations
> inside the <schema ...> tag? Why canīt they be found in the above fragment?

Believe me when I say your not the only one confused about this. As I understand it (please correct
me if I'm wrong) the xmlns and xmlns: attributes are reserved attribute names for the XML Namespace
recommendation. This means that when you use a Namespace aware XML Processor you don't have declare
these elements since the processor already know what they mean. Note that since DTDs are not
namespace aware you still have to declare the xmlns attributes if you use DTD validation.

> And can I put them into other tags, e.g. element declarations?

Yes, I think so.

Hope I didn't confuse you even more...
Cheers,
/Eddie

Received on Tuesday, 10 July 2001 20:07:45 UTC