Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: xml dom char 1 object required???

From: Ivan <ivanfernandez80@-----.--->
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);


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent