Oops! Submitted before finished editing the code part. Here's the correct one:
var instNode = xml.selectSingleNode("//IN
var opcode = instNode.selectSingleNode(
var basicBlock = instNode.parentNode.select
var functionName = instNodes.parentNode.paren
If you have multiple INST with type int
var instNodes = xml.selectNodes("//INST[./
Main Topics
Browse All Topics





by: sathishvPosted on 2004-12-20 at 00:05:51ID: 12864777
I assume you are using DOM. Following is a brief example:
MLDOM")
ST[./TYPE= 'int']");
TYPE='int' ]");
es.item(0) .text; de.selectS ingleNode( "NAME").te xt; de.parentN ode.select SingleNode ("NAME").t ext;
var xml = new ActiveXObject("Microsoft.X
xml.async = false
xml.loadXML("test.xml")
To select the INST with type 'int'
var instNode = xml.selectSingleNode("//IN
// if you have multiple INST elements with type int you can usevar instNodes = xml.selectnodes("//INST[./
To get the OPCODE, BASICBLOCK and FUNCTION values
var opcode = instNodes.item(0).childNod
var basicBlock = instNodes.item(0).parentNo
var functionName = instNodes.item(0).parentNo
Hope this helps.
Cheers,
Sathish