No, Closer, you are wrong. Yes, you are compelled to take the stand. Yes, you can answer those questions put to you that do not incrimate you, those questions are your name, your residence, your age and those particulars that are a matter of public record. All OTHER questions you must answer in the same way - you refuse to answer and invoke you 5th amd. rights. Once you open the door, you open the door, you cannot answer questions selectively, because it would violate the defendent's right to confront witness's in a court of law.
If you would be able to answer selectively you would have this scenario -
"Yes, the defendent shot the store owner"
"Did you see him shoot the store owner?"
"I refuse to answer on the grounds that it might incriminate me."
"Then how do you know he shot the store owner?"
"Oh, I just know it."
"Did the witness give you money from the store robbery?'
"Yes he did."
"How do you know the money was from the store robbery?"
'I refuse to answer that question on the grounds that it might incriminate me."
So yes, the judge can compel the witness to take the stand, but he CANNOT compel any witness to incriminate himself. Therefore, the witness rather than testifying selectively and violating the defendent's 6th amd. right, the witness answers all questions by invoking the 5th. No one can compel anyone to incriminate himself. That is a constitutional right.
p.s. anyone can take the 5th in a deposition and people do it quite often.