Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

ID and #REQUIRED or #IMPLIED

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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.
 
I am going down to the lab. Do NOT let anyone in. Not even this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic