Re: How to let Amaya recognise new mime.types

All in all it is better if you can use HTTP to give you a content-type for
the file (and if you can specify one with new documents). Then the suffix is
not so important. The other problem with suffixes is that there are clashes -
Some RealMedia files and most RPM packages use the extension .rpm so it is
only possible to find out what they are from getting a content-type. And
beause the Macintosh OS has always included a content type (of
sorts) Macintosh users typically do not bother to use any extension since
they don't need one.

cheers
Charles McCN

On Fri, 18 Aug 2000, Catherine CHAT wrote:

  At 09:37 18/08/00 +0200, Irene VATTON wrote:
  >> Hi,
  >> 
  >> I configure an Apache server to send a special mime.types when serving
  >> files with a special extension :
  >> 	myfile.dchtml is served with "application/amaya" mime.type
  >> 
  >> myfile.dchtml are in fact generated html files.
  >> 
  >> The goal is to tell every client to launch Amaya when this type of document
  >> is requested. It works. Because Amaya does not know this special mime.type,
  >> the document is opened in text mode. Is there a way to let Amaya know that
  >> these document are in fact HTML documents ? 
  >
  >Amaya detects that the document is written in html:
  >1) when the mime-type is text/html
  >2) when the suffix is (case insensitive) .html, .html.xx, .htm, .htm.xx, 
  >shtml, jsp, xht, xhtml
  >3) when the mime-type is text/xml and the document includes the tag <html>
  >4) when the suffix is xml and the document includes the tag <html>
  >
  >You can play either on the mime-type or on the suffix.
  >
  
  Thanks Irčne. But all these extensions may already be defined and used by
  other applications. That's why I was thinking of defining a specific
  combination of mime type and extension. 
  
  So I patch Amaya code to add a new extension and tell Amaya that files
  having this extension have to be treated as HTML. To do that I :
  
  	- open AHTURLTools.c
  	- search for the IsHTMLName function 
  	- add the new extension among 
           if (!ustrcmp (nsuffix, TEXT("html")) ||
               !ustrcmp (nsuffix, TEXT("htm")) ||
               !ustrcmp (nsuffix, TEXT("shtml")) ||
               !ustrcmp (nsuffix, TEXT("jsp")) ||
               !ustrcmp (nsuffix, TEXT("xht")) ||
               !ustrcmp (nsuffix, TEXT("xhtm")) ||
               !ustrcmp (nsuffix, TEXT("xhtml")))
              return (TRUE);
  	- compile and build
  
  
  There are more and more applications which are defining their own
  extensions to treat special html files. I am thinking for example of .asp,
  .php, .dwt (dreamweaver HTML templates files)... So having a ressource file
  to define that in Amaya without recompiling would be useful.
  
  Thanks to think about it.
  Best regards,
  Catherine.
  
  >
  >> Thanks.
  >> 
  >> Best regards,
  >> Catherine.
  >> --
  >> Catherine CHAT  - Responsable Technique
  >> Catherine.Chat@via-business.fr - Tel 01 3963 5737 - Fax 01 3963 5114
  >> 
  >> VIA BUSINESS S.A.
  >> Domaine de Voluceau  - BP 105 - 78153 Le Chesnay cedex - FRANCE
  >> http://www.via-business.fr
  >> ---------------------------------------------------------------------
  >> 
  >
  >-- 
  >     Irene.
  >
  >
  >
  >
  

-- 
--
Charles McCathieNevile    mailto:charles@w3.org    phone: +61 (0) 409 134 136
W3C Web Accessibility Initiative                      http://www.w3.org/WAI
Location: I-cubed, 110 Victoria Street, Carlton VIC 3053
Postal: GPO Box 2476V, Melbourne 3001,  Australia 

Received on Sunday, 20 August 2000 05:18:03 UTC