P
pal.saurabh
I've an XML file as follows.
<?xml version="1.0"?>
<packet>
<proto name="bootp" size="272" pos="46">
<field name="bootp.type" size="1" pos="46" show="1" value="01"/></
field>
<field show="Agent Circuit ID: 3031323334" size="7" pos="310"
value="01053031323334"/></field>
</proto>
<packet>
I want to select a node in this tree where node field[show] has a
string that contains string "Agent Circuit ID". How can I do it using
javascript and xmlDoc.selectSingleNode function?
I tried using //field[@show=~"Agent Circuit ID"] and //
field[contains(@show,'Agent Circuit ID')], but '=~' and
'contains' are not recognised within javascript.
thanks in advance.
Saurabh
<?xml version="1.0"?>
<packet>
<proto name="bootp" size="272" pos="46">
<field name="bootp.type" size="1" pos="46" show="1" value="01"/></
field>
<field show="Agent Circuit ID: 3031323334" size="7" pos="310"
value="01053031323334"/></field>
</proto>
<packet>
I want to select a node in this tree where node field[show] has a
string that contains string "Agent Circuit ID". How can I do it using
javascript and xmlDoc.selectSingleNode function?
I tried using //field[@show=~"Agent Circuit ID"] and //
field[contains(@show,'Agent Circuit ID')], but '=~' and
'contains' are not recognised within javascript.
thanks in advance.
Saurabh