I have tested a lot and found finally how to override custom types.

But I do not understand why it can't return the good Content-Type with my code.

If I let a glob pattern like this : <glob pattern="*.dda"/> and rename my 
Vast3.xml to Vast3.dda it's working due to file extension, but I want to read 
Vast3.xml file, that always return application/xml.

If you can take a look at my little gist example 
https://gist.github.com/anonymous/3506db4367040ea8f381c5b7b435b3f9 it will be 
very helpful.

Maybe I'm bad with the xml root but I've tested a lot of things and always same 
results.

Thank you for your time I appreciate it.

Yoyoma.


----- Mail original -----
De: "Nick Burch" <[email protected]>
À: [email protected]
Envoyé: Mercredi 11 Mai 2016 19:19:03
Objet: Re: XML Parser with type recognition

On Wed, 11 May 2016, [email protected] wrote:
> Ok if I understand I can create a specific mime type into 
> tika-mimetypes.xml resource file like this:
>
> <mime-type type="application/xml-vast">
>  <sub-class-of type="application/xml"/>
>  <root-XML localName="vast" 
> namespaceURI="http://www.w3.org/2001/XMLSchema-instance"/>
>  <glob pattern="*.xml"/>
> </mime-type>

Almost - you can't set that glob as it's already claimed. Otherwise, 
assuming that is the right namespace and name for your files, that's it. 
The xml root match will cause that mimetype to win over the default xml 
one

Nick

Reply via email to