More canon law on witnesses:
Can. 1548 §1. When the judge questions witnesses legitimately, they must tell the truth.
Can. 1572 In evaluating testimony, the judge, after having requested testimonial letters if necessary, is to consider the following:
1/ what the condition or reputation of the person is;
2/ whether the testimony derives from personal knowledge, especially from what has been seen or heard personally, or whether from opinion, rumor, or hearsay;
3/ whether the witness is reliable and firmly consistent or inconsistent, uncertain, or vacillating;
4/ whether the witness has co-witnesses to the testimony or is supported or not by other elements of proof.
Can. 1559 The parties cannot be present at the examination of the witnesses unless the judge has decided to admit them, especially when the matter concerns a private good. Their advocates or procurators, however, can be present unless the judge has decided that the examination must proceed in secret due to the circumstances of the matters and persons.
Can. 1562 §1. The judge is to call to the attention of the witness the grave obligation to speak the whole truth and only the truth.
§2. The judge is to administer an oath to the witness according to ⇒ can. 1532; a witness who refuses to take it, however, is to be heard without the oath.