Canon 1258 1917 Code of Canon Law states: §1No one is allowed to believe in any way assist or actively take part in non-Catholic rites.
§2 Passive or merely material presence can be tolerated, the civil service or a mark of respect for the serious nature of the bishop in case of doubt prove the non-Catholic funerals, weddings and similar festivals, provided that the risk of scandal and perversion is absent.
Can 1258 §1. Haud licitum est fidelibus quovis modo active assistere seu partem habere in sacris acatholicorum.
§2. Tolerari potest praesentia passiva seu mere materialis, civilis officii vel honoris causa, ob gravem rationem ab Episcopo in casu dubii probandam, in acatholicorum funeribus, nuptiis similibusque sollemniis, dummodo perversionis et scandali periculum absit.
Canon 2316 §1. Those who of their own accord, and the propagation of heresy in any way knowingly helps or who communicates with heretics in God contrary to the provision of can. 1258, is suspected of heresy.
Can 2316. Qui quoquo modo haeresis propagationem sponte et scienter iuvat, aut qui communicat in divinis cuм haereticis contra praescriptum can. 1258, suspectus de haeresi est.
The new code doesn't include this, BUT Mortalium Animos is still an infallible encyclical, and Pius XI explicitly forbids it.
http://www.vatican.va/holy_father/pius_xi/encyclicals/docuмents/hf_p-xi_enc_19280106_mortalium-animos_en.html