• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

ID and #REQUIRED or #IMPLIED

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I have one question. When attribute_type is ID then #REQUIRED or #IMPLIED can be used as default. If suppose I have an element which appears more than once but without the ID value explicitly supplied (since IMPLIED will work here )then how could I refer to a particular element instance as there is no mean (ID value) with me to distinguish.
Can anyone explain me what XML do in this kind of situation.
Anup Batra
 
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have to refer to this element by some attribute value. Otherwise, it will be treated equally as all other elements with the same name.
 
Anup Batra
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
“You have to refer to this element by some attribute value. Otherwise, it will be treated equally as all other elements with the same name.”
Actually I want to ask about the uniqueness of the Attribute_Type ID here. What will be the value of att ID.
Anup Batra
 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anup,
In this case if you want to refer to a particular element, then it is not possible. You can either loop through and handle the element you want to treat or compare with the element's content.
It's rather a design issue. You need to have an ID attribute in case you want to refer to an element specifically. It is like database referential integrity (PK).
Hope this helps,
Rakesh.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic