1: …… 2: // 외부로 부터 입력을 받음 3: String name = props.getProperty("name" ); 4: String passwd = props.getProperty("password" ); 5: …… 6: XPathFactory factory = XPathFactory.newInstance(); 7: XPath xpath = factory.newXPath(); 8: …… 9: // 외부 입력이 xpath의 인자로 사용 10: XPathExpression expr = xpath.compile("//users/user[login/text()='" + name 11: + "' and password/text() = '" + passwd + "']/home_dir/text()"); 12: Object result = expr.evaluate(doc, XPathConstants.NODESET); 13: NodeList nodes = (NodeList) result; 14: for (int i = 0; i < nodes.getLength(); i++) { 15: String value = nodes.item(i).getNodeValue(); 16: if (value.indexOf(">") < 0) { 17: System.out.println(value); 18: } 19: ……