This article from: http://www.gerenzhanzhang.cn/post/%E8%8E%B7%E5%8F%96xox%EF%BC%89.aspx
The original article is as follows:
The XML operations in IE and Firefox differ from those in that they were depressed for an hour or two yesterday.
The following describes how to obtain XML node values and attribute values encapsulated by colleagues.
// Obtain the text value of the node.
Function getnodetext (OBJ)
{
If (! OBJ)
{
Return "";
}
If (obj. textcontent)
{
Return obj. textcontent;
}
If (obj. firstchild)
{
OBJ = obj. firstchild;
}
If (obj. nodevalue)
{
Return obj. nodevalue;
}
If (obj. Data)
{
Return obj. Data;
}
Return "";
}
Function getnodeattribute (node, name)
{
If (! Node |! Name)
{
Return false;
}
Return getattribute (name, node. attributes );
}
// Obtain an attribute
Function getattribute (name, list)
{
If (! List)
{
Return false;
}
For (VAR I = 0; I <list. length; I ++)
{
If (list [I]. nodename. tolowercase () = Name. tolowercase ())
{
Return list [I];
}
}
Return false;
}