List<NameValuePair> keyvals)
throws JDOMException {
String selectName = select.getAttributeValue("name");
String expr = String.format("//xhtml:option[@value='%s']",chosenValue);
XPath optionPath = XhtmlParser.getXPath("xhtml", expr);
if (optionPath.selectSingleNode(select) == null) {
String msg = String.format("value '%s' was not one of the available options for select '%s'",
chosenValue, selectName);
throw new IllegalArgumentException(msg);
}
keyvals.add(new BasicNameValuePair(selectName, chosenValue));