A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
OCA Java SE 8 Programmer I Study Guide
this week in the
Product and Other Certifications
setting child attribute from parent attribute
Joined: Mar 11, 2008
Mar 27, 2008 22:00:00
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%)
Joined: Jan 04, 2007
Apr 14, 2008 00:52:00
NamedNodeMap parentMap = parentElement.getAttributes(); Node attributeNode = parentMap.getNamedItem("ParentAttribute"); String attribute = attributeNode.getNodeValue(); childElement.setAttribute("Attr",attribute);
I agree. Here's the link:
subject: setting child attribute from parent attribute
what is the difference?
Setting the attribute of child node by parent node attribute value
how to get child attribute in parent tag
setting the xml child attributes value from parent's attribute value
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015