This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes what is the proper term for attributes inside the <XML> tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "what is the proper term for attributes inside the <XML> tag" Watch "what is the proper term for attributes inside the <XML> tag" New topic
Author

what is the proper term for attributes inside the <XML> tag

Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4659
    
    5

Suppose I have some XML that looks like


This is well formed, and trivial to process.

Now, supposed that there is extra stuff in the initial tag "inventor" something like





What is the proper term to describe the data fields: sequence="001" app-type="applicant-inventor" designation="us-only"
g tsuji
Ranch Hand

Joined: Jan 18, 2011
Posts: 535
    
    3
[0] I am not sure what are the, possibly subtle, concerns to trigger the question.

"what is the proper term for attributes (a list of individual attribute) inside the <XML> tag"

They are called attributes, would they not?

[1] In xml recommendation, attributes can appear only within the start-tags or those self-closing empty tag. These are the productions in this regard:
ref http://www.w3.org/TR/REC-xml/#NT-AttlistDecl

[40] STag ::= '<' Name (S Attribute)* S? '>' [WFC: Unique Att Spec]
[41] Attribute ::= Name Eq AttValue [VC: Attribute Value Type] [WFC: No External Entity References] [WFC: No < in Attribute Values]
[42] ETag ::= '</' Name S? '>'

[1.1] An attribute is characterized by its name and value and value type. They should all the same satisfy some well-defined formation rules. And, for a non-validating xml parser, the value types are considered as CDATA. For any xml parser, before values are passed on to application, they should further be normalized with well-defined rules. Things can be slightly more complicated in detail as the recommendation is conceived to satisfy all sorts of concerns from different interested parties at the time as you certainly know.

[2] There isn't anywhere else in an xml instance document the notion of attribute can appear.
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4659
    
    5

g tsuji wrote: I am not sure what are the concerns to trigger the question.


Its simple, I'm writing code to parse them, and I want to use a real term rather than calling it 'extra junk in the tag'

Code is written to be read by humans, not the compiler
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3720
    
  16
Attributes is the correct term Pat. See section 3.3 of this cure for insomnia


Joanne
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what is the proper term for attributes inside the <XML> tag