Archive

Archive for January 25, 2010

Java XPath

January 25, 2010 Leave a comment

Quick way to extract data from XML is XPath.

http://www.whitebeam.org/library/guide/TechNotes/xpathtestbed.rhtm

http://www.whitebeam.org/library/guide/TechNotes/xpath.rhtm

import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathFactory;
import java.io.*;

String xmlData = "place the XML Data here.";
XPath xpath = XPathFactory.newInstance().newXPath();
InputStream inStream = new ByteArrayInputStream(xmlData.getBytes());
InputSource inputSource = new InputSource(inStream);
String nodeValue = xpath.evaluate("//nodeName", inputSource);
System.out.println("nodeValue==>" + nodeValue);

Categories: XML Tags: ,

Restlet API

January 25, 2010 Leave a comment

Working on Restlet API for now….

http://www.restlet.org/

Test Restlet with http://code.google.com/p/rest-client/

Now Spring 3.0 is having support for Restlets, but I didn’t get a chance to look into it.

-o-

Categories: Restlet Tags:
Follow

Get every new post delivered to your Inbox.