
The early sages (the Tana’aim) ruled that one of the activities forbidden on the Sabbath is the removal of items from the private to the public domain or the opposite. Therefore they forbade a person from standing in a private domain and urinating into a public domain or vice versa, or standing in a private domain and spitting into a public domain or vice versa, for urine and spit are considered to be items which one is forbidden from transporting from domain to domain.The matter is so grave that one who urinates or spits from domain to domain is liable to the death penalty, and if he did so without intent, he is liable to bring a sacrifice to atone for his error. One of the sages, Rava, asked about a case in which a man stands on the edge of a roof, with his body in a private domain but his sex organ over the edge of the roof, in the public domain — is he permitted to urinate into the public domain or not? What is under debate? On one hand, it may be permitted because the urine exits from the meatus, at the head of the penis, which is already in the public domain; there is no removal from the private to the public domains, only from a public domain t a public domain, which is permitted. On the other hand, it may be forbidden as the urine emanated from his body — from his bladder — and his body is in a private domain, so he moved it from a private domain to a public. [This issue was not resolved in the Talmud.]
Babylonian Talmud, Tractate Eruvin 98b-99a