This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes setting the xml child attributes value from parent's attribute value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "setting the xml child attributes value from parent Watch "setting the xml child attributes value from parent New topic
Author

setting the xml child attributes value from parent's attribute value

bappa
Greenhorn

Joined: Mar 11, 2008
Posts: 15
Hi all,
I am working on xml parsing. My problem is to set the value of one attribute of child from the attribute value of parent. How to do this? Please help me in this concern. Thanks in advance.


S K B<br />SCJP 1.5 (83%)
Nickolas Case
Ranch Hand

Joined: Apr 26, 2008
Posts: 98
Just off the top of my head, try having a setter method in your child class set from the parent class. i.e:

public setThisAttribute(){
this.ThisAttribute = super.ThisAttribute;
}
I haven't tried to compile or anything. Good luck!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: setting the xml child attributes value from parent's attribute value
 
Similar Threads
Deleting child nodes from an xml
setting child attribute from parent attribute
Setting the attribute of child node by parent node attribute value
PASSED IBM 141-X ML - 76%
XPath for atrib. name and value of node