S
shoe
Terrible simple question i think but I'm to tired mocking around now
for 2 days with this problem !
I want to change one "name" tag value ONLY in this XML (below).
Notice that there are many "name" tags.
I can search trough this xml using a Dom parser but that will give me
a list of all name tags - using this syntax:
doc.getElementsByTagName("name");
how do I directly access and change the deepest "name" tag:
projectDescription/buildSpec/buildCommand/name ??????
I have tríed this: (does not work)!
doc.getElementsByTagName("projectDescription/buildSpec/buildCommand/name");
to get a lock on that tag and then simply change the value.
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>testc++</name>
<comment><comment>
<projects></projects>
<buildSpec>
<buildCommand>
<name>makeBuilder</name>
</buildCommand>
</buildSpec>
<natures>
<nature>cnature</nature>
<nature>makeNature</nature>
<nature>ccnature</nature>
</natures>
</projectDescription>
for 2 days with this problem !
I want to change one "name" tag value ONLY in this XML (below).
Notice that there are many "name" tags.
I can search trough this xml using a Dom parser but that will give me
a list of all name tags - using this syntax:
doc.getElementsByTagName("name");
how do I directly access and change the deepest "name" tag:
projectDescription/buildSpec/buildCommand/name ??????
I have tríed this: (does not work)!
doc.getElementsByTagName("projectDescription/buildSpec/buildCommand/name");
to get a lock on that tag and then simply change the value.
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>testc++</name>
<comment><comment>
<projects></projects>
<buildSpec>
<buildCommand>
<name>makeBuilder</name>
</buildCommand>
</buildSpec>
<natures>
<nature>cnature</nature>
<nature>makeNature</nature>
<nature>ccnature</nature>
</natures>
</projectDescription>