Here is the solution to my problem in both Mozzila and IE with the help of tsuji and BillyRayPreachersSon ....
In IE simply use:
xmlDoc.getElementsByTagName("SvcId")[0].text="some text here";
In Mozzila:
1- create a text node using document object
var TextNode =...
BillyRayPreachersSon,
If I use document.createCreateTextNode('abc') and try to append it to my xmlDoc, it will generate an error "Type mismatch".
Thanks,
J
tsuji,
Thanks for your first post "xmlDoc.getElementsByTagName("SvcId")[0].text="abc";" it works. However, on the second post, there is no misleading. Try it in your IE or Mozzila browser. You can create a text node using document.createTextNode but you ca not use your loaded xml document to...
Thank you for the info and sorry about the typo. it is xmlDoc not xmlDoct and I have tried the code that you provided and it gives me error "Object does not support this property or method". The code works with document.createTextNode('some text here'), but it does not work with XMLDOM object...
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.