PleaseHelp1
Technical User
I need to modify a xml document...
Using Javascript, I have loaded a xml file:
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = SyncType;
xmlDoc.load(xmlfile.xml);
Lets say the xmlfile looks like this:
<?xml version="1.0" ?>
<Service>
<SvcId/>
<SvcName>Service Name</SvcName>
</Service>
I can change the service name to "whatever" by:
xmlDoct.getElementsByTagName("SvcName")[0].firstChild.nodeValue = "whatever";
but I CAN NOT add any value to SvcId since xmlDoct.getElementsByTagName("SvcId")[0].firstChild does not exist.
Your help is really appreciated.
Thanks,
J
Using Javascript, I have loaded a xml file:
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = SyncType;
xmlDoc.load(xmlfile.xml);
Lets say the xmlfile looks like this:
<?xml version="1.0" ?>
<Service>
<SvcId/>
<SvcName>Service Name</SvcName>
</Service>
I can change the service name to "whatever" by:
xmlDoct.getElementsByTagName("SvcName")[0].firstChild.nodeValue = "whatever";
but I CAN NOT add any value to SvcId since xmlDoct.getElementsByTagName("SvcId")[0].firstChild does not exist.
Your help is really appreciated.
Thanks,
J