Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Certifications
Search Coderanch
Advance search
Google search
Register / Login
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
Liutauras Vilda
Ron McLeod
Sheriffs:
Jeanne Boyarsky
Devaka Cooray
Paul Clapham
Saloon Keepers:
Scott Selikoff
Tim Holloway
Piet Souris
Mikalai Zaikin
Frits Walraven
Bartenders:
Stephan van Hulst
Carey Brown
Forum:
Product and Other Certifications
setting child attribute from parent attribute
bappa
Greenhorn
Posts: 15
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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%)
Arjun Karthick
Ranch Hand
Posts: 77
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
NamedNodeMap parentMap = parentElement.getAttributes(); Node attributeNode = parentMap.getNamedItem("ParentAttribute"); String attribute = attributeNode.getNodeValue(); childElement.setAttribute("Attr",attribute);
Regards,
Arjun.
Well don't expect me to do the dishes! This ad has been cleaned for your convenience:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
what is the difference?
OO Design
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
More...