JavaScript中的XML全路径解析

JavaScript中的XML全路径解析,javascript,xml,parsing,getelementsbytagname,Javascript,Xml,Parsing,Getelementsbytagname,对不起,我甚至不知道我需要的东西的正确名称。我为此道歉 在PowerShell中,我可以执行以下操作来指定要从XML提取的数据: $getParticipantListResponseXml.RESPONSE\u TRANS\u CONF.ACTION.GET.CONFERENCE.consuming\u PARTY\u LIST.consuming\u PARTY.ID中的$participantID 我不能只使用JavaScript: getElementsByTagName('ID'))

对不起,我甚至不知道我需要的东西的正确名称。我为此道歉

在PowerShell中,我可以执行以下操作来指定要从XML提取的数据:

$getParticipantListResponseXml.RESPONSE\u TRANS\u CONF.ACTION.GET.CONFERENCE.consuming\u PARTY\u LIST.consuming\u PARTY.ID中的$participantID
我不能只使用JavaScript:

getElementsByTagName('ID'))
因为“ID”出现在多个地方,我需要指定确切的路径。我该怎么做呢?

这可能会有帮助

document.evaluate( expression, document, null, XPathResult.ANY_TYPE, null );
范例

document.evaluate( '//p', document, null, XPathResult.ANY_TYPE, null );

您使用的是什么DOM库?