Can a witness in a criminal case not appear in court?

Legal subjectivity:

You don't have to appear in court. A witness that the accused and the defense think is unnecessary may not appear in court. The defense lawyer informs the witnesses who appear in the people's court that they can decide whether to appear in court or not. The spouse, parents and children of a criminal defendant may refuse to appear in court, including court requirements. Witnesses who refuse to appear in court may be reprimanded, detained or forced to appear in court Article 187 of the Criminal Procedure Law The public prosecutor, the parties, their defenders and agents ad litem have objections to the witness testimony, which has a great influence on the conviction and sentencing of the case. If the people's court deems it necessary for the witness to testify in court, the witness shall testify in court. Article 188 If a witness fails to testify in court without justifiable reasons after being notified by the people's court, the people's court may compel him to appear in court, except the spouse, parents and children of the defendant. If a witness refuses to appear in court without justifiable reasons or refuses to testify after appearing in court, he shall be admonished. If the circumstances are serious, with the approval of the dean, he shall be detained for less than ten days.

Legal objectivity:

Article 62 of the Criminal Procedure Law: Anyone who knows the circumstances of a case has the obligation to testify. A person who is physically and mentally defective or young, can't distinguish right from wrong and can't express correctly, can't be a witness. Article 193 If a witness fails to testify in court without justifiable reasons after being notified by the people's court, the people's court may compel him to appear in court, except the defendant's spouse, parents and children.