Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 656
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[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
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Attributes is the correct term Pat. See section 3.3 of this cure for insomnia
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic