SPANISH CIVIL CODE
On legal rules, their application and effectiveness
Sources of law
The sources of the Spanish legal system are statutes, customs and general legal principles.
Any provisions which contradict another of higher rank shall be invalid.
Customs shall only apply in the absence of applicable statutes, provided that they are not contrary to moralsor public policy, and that it isproven. Legal uses which are not merely for the interpretation of a declaration of will shall be considered customs.
General legal principles shall apply in the absence of applicable statute or custom, without prejudice to thefact that they contribute to shape the legal system.
Legal rules contained in international treaties shall have no direct application in Spain until they have becomepart of the domestic legal system by full publication thereof in the Spanish Official State Gazette.
Case law shall complement the legal system by means of the doctrine repeatedly upheld by the SupremeCourt in its interpretation and application of statutes, customs and general legal principles.
Judges and Courts shall have the inexcusable duty to resolve in any event on the issues brought beforethem, abiding by system of sources set forth herein.
Statutes shall enter into force twenty days after their full publication in the Official State Gazette, unlessotherwise provided therein.
Statutes may only be repealed by subsequent statutes. Such repeal shall have the scope expressly providedtherein, and shall always extend to any provisionsof the new statute on the same matter which are incompatiblewith the prior statute. Mere abrogation of a statute shall not entail recovery of the force and effect of anyprovisions repealed thereby.
Statutes shall not have retroactive effect, unless otherwise provided therein.CHAPTER 2º
Application of legal rules
Rules shall be construed according to the proper meaning of their wording and in connection with thecontext, with their historical and legislative background and with the social reality of the time in which they areto be applied, mainly attending to their spirit and purpose.
Equity must be taken into account in applying rules, but the resolutions of the Courts may only be basedexclusively on equity when the law expressly allows this.
Where the relevant rules fail to contemplate a specific case, but do regulate another similar one in which thesame
is perceived, the latter rule shall be applied by analogy.