<div>Hi paul,</div>
<div> thanks for the reply.</div>
<div>But can u please give an example of how to add namespace prefix to the Xpath.</div>
<div>An example would be of great help.</div>
<div> </div>
<div>Awaiting ur response<br><br> </div>
<div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>Aren't you missing namespace prefixes in your XPath expression ?<br><br>paul<br><br><br>Le 8 août 05, à 14:56, Madhuraj S V a écrit :
<br><br>> Hi,<br>> <br>> Iam a newbie to JDom.<br>> <br>> Iam trying a parse a wsdl file named CalculatorService to get the<br>> value of the message attribute of input element which happens to be<br>> the child of operation element.
<br>> i created a Xpath instance for /definitions/portType/operation[@name<br>> ="add"]<br>> but when i say xpath.selectNodes() it returns empty list even though<br>> it has element with the given value
<br>> <br>> <br>> please find the code snippet i used<br>> <br>> 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",<br>> "<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);<br>> <br>> anyhelp please in getting the correct values
<br>> <br>> <br>> Awaiting ur response<br>><br>> --<br><br>-- <br>Regards<br>Madhu Raj<br><a href="mailto:svmadhuraj@gmail.com">svmadhuraj@gmail.com</a> </blockquote></div>