This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

order of attributes.....another lazy qstn!!!!

 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the order in which attributes are specified for an element matter?
Please restrict your answer to the scope of servlet/Jsp/web-app elements only.
Right now I don't care what XML does....
Thanks, Appreciate your help.
- satya..............stressed out
 
Ian B Anderson
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
It seems that the following will work either way round. I'm guessing that these are retrieved with something like a getUri() and getPrefix() call
<%@ taglib prefix="chap09" uri="/attarraytags.tld" %>
<%@ taglib uri="/attarraytags.tld" prefix="chap09" %>
I assume this is the same for all tags.
However the order of the elements does matter in the web.xml file. i.e. error-page must come before taglib etc.
Hope this helps
Ian
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This relates back to how XML files are parsed and how their structure is constrainted with the use of either a DTD or a Schema.
Neither DTD nor a Schema definition has the facility to restrict the order of attributes within an element. It only provides ways to define which attributes are valid for what element, whether the attribute is required or implied and their range of valid values.
However, as Ian said, the order of elements can be specified in the DTD/Schema and the parser will validate the xml instance to make sure the elements appear in the order expected.
Hope that helps!
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah...
i found it strange when i typed "description" tag before some other tag and it didnt work as i knew from the XML theory that order of elements doesnt matter. but i was sure that it was not working just because of the mis-order and i was also sure that i'm right about XML theory. so i concluded that it must have been imposed by the server
regards
maulin.
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
btw,
i didnt understand the reason for imposing the order or elements in web.xml.
regards
maulin.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic