Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - xml dom char 1 object required??? [Thread Next] Re: xml dom char 1 object required???To: NULL Date: 4/6/2008 4:48:00 AM On Apr 6, 12:38=A0pm, Ivan <ivanfernande...@gmail.com> wrote:
> Hi i am usign teh following loop to go find a note vdn and get its
> attribut value but i am getting "char 1 object required" what's wrong
> with that piece of code???
>
> Thanks
>
> var m=3DxmlDoc.documentElement.childNodes;
>
> for (i=3D0;i<m.length;i++)
> {
>
> Line 277: m=3DxmlDoc.getElementsByTagName("VDN")[i].attributes;
> var vdnarxio=3Dm.getNamedItem("id").nodeValue;
>
>
>
> }- Hide quoted text -
>
> - Show quoted text -
Hmm it seems to work because by putting an alert i can see the
attribute values.. however the problem seems to be that this
particular piece of code prevents normal execution of the lines below
it(not sure if it is because of the error).. for example the
following :alert (xmlDoc.xml); doesnt do anything anymore .. before it
use to output the contents of the xml file., it works ok though if i
uncomment the code that i forst posted,...
any ideas??
xmlDoc.async=3Dfalse;
xmlDoc.load("Config.xml");
y=3DxmlDoc.getElementsByTagName('Global_Emergency');
alert ("Modifying code");
for(i=3D0;i<y.length;i++)
{
alert (i);
y.item(i).setAttribute("activated",document.getElementById("GE").value);
}
var m=3DxmlDoc.documentElement.childNodes;
for (i=3D0;i<m.length;i++)
{
m=3DxmlDoc.getElementsByTagName("VDN")[i].attributes;
var vdnarxio=3Dm.getNamedItem("id").nodeValue;
alert (vdnarxio);
}
/*
var m=3DxmlDoc.documentElement.childNodes;
alert ("y=3D"+m.length);
for (i=3D0;i<m.length;i++)
{
var m=3DxmlDoc.getElementsByTagName("VDN")[i].attributes;
var vdnarxio=3Dm.getNamedItem("id").nodeValue;
var vdnedit=3Ddocument.getElementById("vdnfield").value;
//document.getElementById("vdnfield").focus();
if (vdnarxio=3D=3Dvdnedit) // if vdn is found
{
//alert ("vdn was found");
found=3D1;
m=3DxmlDoc.getElementsByTagName("Training_Emergency")
[i].childNodes[0].nodeValue;
m.nodeValue=3D"hi";
}
}
*/
//alert ("found is"+found);
alert (xmlDoc.xml);
//for (i=3D0;i<y.length;i++)
//{
//document.write(y[i].getAttribute('activated'));
//document.write("<br />");
//}
//xmlDoc.documentElement.setAttribute('activated','newvalue');
alert (xmlDoc.url);
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
