reading XML attributes in javascript

后端 未结 2 1457
囚心锁ツ
囚心锁ツ 2021-01-24 16:22

Guess it\'s a simple question for a javascript guru, but i\'m learning and got a problem I can\'t guess out.

I\'m interested in reading an XML file using javascript. He

2条回答
  •  情歌与酒
    2021-01-24 16:32

    The problem you are running into is that technically "attributes" of subobject are also children of object. Remember that any element is a Node object, and on that Node you can get all childNodes. You can do that and process each "Element" node and determine if it is an "attribute" Node.

    See http://www.w3schools.com/jsref/dom_obj_node.asp for more information on this.

提交回复
热议问题