I'm trying to extract text using the XMLParser from the following XML document with no success:
<?xml version="1.0"?> <RDF:RDF xmlns:MAF="http://maf.mozdev.org/metadata/rdf#" xmlns:NC="http://home.netscape.com/NC-rdf#" xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <RDF:Description RDF:about="urn:root"> <MAF:originalurl RDF:resource="http://news.google.com/"/> <MAF:title RDF:resource="Google News"/> <MAF:archivetime RDF:resource="Thu, 17 Nov 2011 09:12:39 -0500"/> <MAF:indexfilename RDF:resource="index.html"/> <MAF:charset RDF:resource="UTF-8"/> </RDF:Description> </RDF:RDF> Here's my source code... File file = new File("/tmp/test.rdf"); InputStream is = new FileInputStream(file); Metadata metaData = new Metadata(); AbstractParser parser = new RdfParser(); DefaultHandler handler = new ToTextContentHandler(); parser.parse(is, handler, metaData, new ParseContext()); System.out.println("handler: " + handler); System.out.println("metadata: " + metaData); And the result is no parsed text. What am I doing wrong? =======================sample code output================== handler: metadata: Content-Type=application/xml ===========================================================
