Link to home
Start Free TrialLog in
Avatar of manoj kumar
manoj kumarFlag for India

asked on

Href value to match content in DOM Parser in java


I have a xml  like <url href="www.google.com">www.google1.com</url>
i am using dom parser to cheak both url should match or not (www.google.com and www.google1.com)
so i am Writing The code is :
String s=""; Document doc = dBuilder.parse(inputFile); NodeList nodeList= doc.getElementsByTagName("url"); for (int i = 0; i < nodeList.getLength(); i++) { Node node = nodeList.item(i); if(node.getNodeName().equals("url")){//Reconfirm after that getting content Element element = (Element) node; s=element.getTextContent(); String s2=element.getAttribute("href"). }So can u help me how to get href content so that i can cheak both value










Avatar of manoj kumar
manoj kumar
Flag of India image

ASKER

Thanks i solved the Issue please close the Question :else write some thing i closed my question
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial