I think the problem is that the detection does not see the filename. If you pass a InputStream to the detection method, you should also pass metadata (including the file name).
Uwe ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: [email protected] > -----Original Message----- > From: Nick Burch [mailto:[email protected]] > Sent: Tuesday, April 17, 2012 3:30 PM > To: [email protected] > Subject: Re: Problem detecting XML > > On Tue, 17 Apr 2012, Taylor, Wade wrote: > > Hi, I'm having trouble detecting a file as "application/xml". When I > > detect a URL containing XML the detection works and I get > > "application/xml" as the media type. > > Hmm, that's odd. I've taken your sample xml, popped it in a new file, and run > "java -jar tika-app-1.2-SNAPSHOT.jar --detect sample.xml" and it came back > with "application/xml" > > I'd suggest you double check with the Tika App, and also ensure there's no > whitespace or control characters at the start of your file before the xml > declaration > > Nick
