Menu

XML file autodetection

u764
2009-04-06
2012-11-13
  • u764

    u764 - 2009-04-06

    Hello,
    As the XML language is widly used and many XML files doesn't have a ".xml" extension, it should be cool to have an option in npp that detect that a file is a xml one if it starts with "<?xml version="1.0" encoding=".*" ?>", and if its extension is not already linked to another language (I know that it's possible to link an extension to a language)

    This could be also implemented when creating a new document (useful when using ctrl+N and paste a xml document)
    Thanks

     
    • MaY

      MaY - 2009-04-06

      good idea. I would rather propose to make some custom on-first-line detection rules. For ex. I personally need to maintain some files, which have .php extension, but are in fact in JavaScript files (with some php parsings). So it would be nice to write something like /* JS here */ on the first line and editor would auto-select the language accordingly

       
MongoDB Logo MongoDB