XQuery/Employee Search

This example shows JavaScript and XQuery combining to provide a directly updated Web page. AJAX is used in a form sometimes referred to as AHAH in which the server-side XQuery script returns an XHTML node (in this case a table containing the information about an employee) which is updated into the DOM using innerHTML.

The get script
}; let $empNo := request:get-parameter("empNo",) let $emp := //Emp[EmpNo=$empNo] return if (exists($emp)) then local:element-to-table($emp) else Employee Number {$empNo} not found.