I am getting xml file path from browse button and trying to parse but it is not working.. here is my code below. I am new to jQuery.. please help
$(document).ready(function(){
alert("hi")
$("#uploadButton").click(function(){
var val = $("input#file").val()
alert( val ) // it is displaying...
$(val).find("CommandModule").each(function() {
alert("inside cmdModule") // it is not displaying..
$(this).find("CommandGroup").each(function() {
$(this).find("CommandExecution").each(function() {
$("#test").append($(this).attr("cmdId"));
});
}); // closing CommandGroup
}); // closing CommandModule
}); // closing Click function
}); // closing ready function
The XML in question (removed some sensitive info)
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="qToutput2html-fancy.xsl"?>
<Host host="127.0.0.1" name="freebsd-01" xmlns:xsi="w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="qToutput.xsd">
<CommandModule modAuthor="Marcus Foo <[email protected]>" modDate="2009-09-18T00:00:00" modName="modFreeBSD" modVersion="0.1">
<CommandGroup grpHeading="System Information" grpId="cmdgrp0" grpName="">
<CommandExecution cmdDiff="true" cmdFlags="" cmdHeading="NetoHostname" cmdId="cmd0" cmdName="QtReport" cmdRefText="" cmdRefUrl="" cmdReqId="" cmdSu="false">
<TimeStart>2010-03-11T11:10:42.067000</TimeStart>
<TimeStop>2010-03-12T12:20:42.114000</TimeStop>
<Command>
<Line>Neto</Line>
</Command>
<Stdout>
<Line>abc.cab.cst.com</Line>
</Stdout>
<Stderr/>
<ExitCode>5</ExitCode>
</CommandExecution>
</CommandGroup>
</CommandModule>
</Host>