The 36-year-old victim was walking on North Bridge, near The Scotsman hotel, when a man on the street asked him for a pound.
When the visitor responded that he did not have any coins on him, he was stabbed in the stomach with a used needle.
He ran into the five-star hotel immediately after the incident at around 1.50pm on Saturday, asking shocked staff to call a taxi so he could go to hospital.
An insider at The Scotsman hotel said that the man had appeared remarkably calm, however it is understood he was bleeding extensively.
The visitor, who had stayed at the hotel for several nights last week but was no longer a guest at the time of the incident, was taken to Edinburgh Royal Infirmary by taxi. He is believed to have undergone tests for HIV and hepatitis.
A 38-year-old man appeared at Edinburgh Sheriff Court in connection with the incident yesterday.
The Scotsman hotel source described how the tourist ran into the reception from the street and pleaded for help.
They said: “He had been outside and a guy asked him for a pound.
“He said he didn’t have money on him. Then he just came into the hotel and asked if they could order a taxi because he needed to go to hospital. He had a big hole in his belly.”
A police spokeswoman said: “Police received a report of an assault on North Bridge that occurred on Saturday.
“A 36-year-old man subsequently attended the Edinburgh Royal Infirmary where he received treatment.
“A 38-year-old man was traced, arrested and charged in connection with this incident and appeared at Edinburgh Sheriff Court.”
Local councillor Joanna Mowat said she was relieved that someone had been apprehended for the incident, however raised concerns about wider issues around begging in the city centre.
She said: “I think we can do better than having people begging on the street.
“We should look at ourselves and say, ‘is this appropriate?’ We can’t afford for this to happen again. We have to answer questions about how we can stop this happening.”
Cllr Mowat described the incident as tragic, and said it would “strike deep” in the heart of a city with such a popular reputation with tourists.
She added: “Can you imagine what you would think about the city if this happened to you when you were visiting?”
In February this year, police were called to the nearby five-star Balmoral Hotel in Princes Street after a man was found in the foyer in possession of a bloodstained syringe.
And in March last year, a security guard was stabbed with a used syringe after he challenged a shoplifter in the Lidl supermarket in Nicolson Street.
The man “struggled violently” with the guard and stabbed him a number of times with a syringe before running off.