<div>Hi,</div>
<div> </div>
<div>I am a newbie to JDom. </div>
<div> </div>
<div>I am trying a parse a wsdl file named CalculatorService to get the value of the <strong>message</strong> attribute of <strong>input</strong> element which happens to be the child of <strong>operation </strong>element.
</div>
<div>i created a Xpath instance for <strong>/definitions/portType/operation[@name ="add"] </strong></div>
<div>but when i say <strong>xpath.selectNodes() </strong>it returns empty list even though it has element with the given value</div>
<div> </div>
<div> </div>
<div>please find the code snippet i used </div>
<div> </div>
<div>StringBuffer sb = new StringBuffer();<br>sb.append("/definitions/portType/operation[@name = \"");<br>sb.append("add").append("\"]");<br>Document doc = builder.build(new File("
CalculatorService.wsdl"));<br>Namespace ns = Namespace.getNamespace("wsdl", "<a href="http://schemas.xmlsoap.org/wsdl/">http://schemas.xmlsoap.org/wsdl/</a>");<br>XPath xp = XPath.newInstance(sb.toString
());<br>xp.addNamespace(ns);<br>List ele = xp.selectNodes(doc);<br>System.out.println(" the list is "+ele);</div>
<div> </div>
<div>any help please in getting the correct values </div>
<div> </div>
<div> </div>
<div>Awaiting ur response<br clear="all"><br>-- <br>Regards<br>Madhu Raj<br><a href="mailto:svmadhuraj@gmail.com">svmadhuraj@gmail.com</a> </div>