The Spanish Civil Procedure Act provides for limited disclosure of documents in the following instances:
Although the parties have an obligation to produce such documents once requested by the court, if they don't, the judge cannot force their production, for instance, by or through enforcement measures such as a search of premises. The only consequence for not producing the documents requested by the court is that the judge may consider proven those facts that the requesting party intends to prove through those documents, provided that those facts are in line with other evidence available to the court.
In Spanish criminal proceedings, discovery/disclosure is not applicable per se. However, the examining magistrate should conduct whatever enquiries they believe may lead to the clarification of the facts, as the objective of criminal proceedings is to establish the material truth. In this regard, there is an important difference between the judge requiring evidence from (i) any third party or (ii) a defendant. While the third party has the obligation to respond to the request and provide the evidence, the defendant can claim constitutional rights of defense under article 24.2 of the Spanish Constitution (principally the right of protection from self-incrimination and the right not to give a statement against oneself).
However, if the defendant refuses to respond to the request and to provide the evidence, the examining magistrate may, depending on the importance and significance of the documental evidence requested, adopt more restrictive measures such as a search of a corporate or commercial domicile or of a personal domicile.
Additionally, and although the defendant's lawyer is under no obligation to disclose confidential documents that are protected by the attorney-client privilege, under certain circumstances, especially serious crimes, reasonable and well-founded suspicions that the defendant's lawyer may be an accomplice to or co-author of a crime, etc., the judge may adopt reasonable measures to be provided with the evidence (e.g., a search of the professional domicile of the attorney, interception of telephone calls, etc.).