Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm currently working on an open-source project. Currently, we put our copyright notice at the top of every Java source file.

I was wondering whether it was advisable or common practice to put copyright notices in CSS or XML files.

share|improve this question
If a document contains copyrightable expression, it's never a bad idea. – apsillers Feb 1 '13 at 14:44
I think it depends on what you're storing. XML is a document format, it could contain a whole copyrighted book (in which case it should contain a copyright imho), or <a>1</a> (in which case it probably shouldn't) – Benjamin Gruenbaum Feb 1 '13 at 14:59
Sure both file formats support comments. Its up to you as the author of the project to decide if the copyright notice should be placed in these types of files. – Ramhound Feb 1 '13 at 18:28
In any nation that subscribes to the Berne Convention, you have a copyright in every copyrightable thing you produce, automatically, whether you claim it or not. Copyright notices just put others on notice of that, and increase your ability to enforce your rights. – Ross Patterson Feb 2 '13 at 3:18
up vote 5 down vote accepted

CSS yes, XML not so much

The purpose of a copyright notice is to inform readers that the material has a certain level of protection against unauthorised reuse. For creative works, such as CSS styling or source code, this makes sense.

In the case of XML it seems redundant because the XML should be acting as a data carrier rather than a creative work in and of itself. Of course, as Benjamin Gruenbaum has noted in the comments, if the XML is carrying a copyrighted work then that should carry a copyright notice within it.

On the whole, try to keep your copyright notice as small and unobtrusive as possible since people on tight bandwidth limits don't want to download more data than is necessary.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.