XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Do attributes have scope? Are attributes metadata?

Hi Folks,

Do attributes have scope?

Consider this:

<Document classification="unclassified">
      <Para>...</Para>
      <Para>...</Para>
      <Para>...</Para>
</Document>

(1) Is it correct to say, "The scope of the classification attribute is from the Document start-tag to its end-tag" or, more casually, "The Document and its content are unclassified"

Conversely, consider the same document where the attribute is replaced with a namespace declaration:

<Document xmlns="http://www.example.org";>
      <Para>...</Para>
      <Para>...</Para>
      <Para>...</Para>
</Document>

(2) Is it correct to say, "The scope of the namespace declaration is from the Document start-tag to its end-tag"

Are attributes metadata?

Consider this:

<altitude units="feet">12000</altitude>

(3) Is it correct to say, "The units attribute provides metadata about the altitude element's value" or, more casually, "The attitude is 12000 feet"

I will attempt to answer my questions.

First, the XML specification defines attributes as:

     Attributes are used to associate name-value pairs 
     with elements.

Wow! 

That's all. It says nothing about scope or metadata.

Second, the Namespace specification *does* talk about scope:

    ... these declarations are scoped by the elements on
         which they appear ...

So, here are my answers to my questions:

(1) Attributes do not have scope.

(2) Namespace declarations *do* have scope. In the example above, the scope of the http://www.example.org namespace is from the Document start-tag to its end-tag.

(3) Attributes are not metadata. 

Do you agree?

/Roger


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS