<contact>
<name>
<firstname>saurabh
<mr> mr </mr>
</firstname>
<mname> kumar </mname>
<lastname> mal </lastname>
</name>
<address> d 32 </address>
<street> old </street>
<city> delhi </city>
<state> ND </state>
<telephone> 33333 </telephone>
<email> in@in.com </email>
</contact>
This my sample XML.....
This is my sample XML. Now the problem i am facing is that i want to print the name and value for every tag (incl of child tags).
1. Now if i find out the length of the address tag (which has no child nodes) then the length returned is 1....but if check the length of tag which has 1 child tag then also the length returned is 1...i am checking length of tag using (haschildnodes.length). So how do i check the number of child nodes present in case of above XML sample.
2. What is the difference between (nodevalue) and (text) methods of XMLDOM. eg. In case of <name> tag i want to print name and value of every tag but if i use (text) it prints the value - saurabh mr kumar mal ---- and nodevalue returns null. How should i do it.
Thanks
<name>
<firstname>saurabh
<mr> mr </mr>
</firstname>
<mname> kumar </mname>
<lastname> mal </lastname>
</name>
<address> d 32 </address>
<street> old </street>
<city> delhi </city>
<state> ND </state>
<telephone> 33333 </telephone>
<email> in@in.com </email>
</contact>
This my sample XML.....
This is my sample XML. Now the problem i am facing is that i want to print the name and value for every tag (incl of child tags).
1. Now if i find out the length of the address tag (which has no child nodes) then the length returned is 1....but if check the length of tag which has 1 child tag then also the length returned is 1...i am checking length of tag using (haschildnodes.length). So how do i check the number of child nodes present in case of above XML sample.
2. What is the difference between (nodevalue) and (text) methods of XMLDOM. eg. In case of <name> tag i want to print name and value of every tag but if i use (text) it prints the value - saurabh mr kumar mal ---- and nodevalue returns null. How should i do it.
Thanks