Police arrested the man yesterday morning and charged him with intentionally causing grievous bodily harm.
His case was adjourned by a Dunedin District Court registrar yesterday, when the man was remanded in custody by consent to appear in court on Friday.
His name and the identity of the victim are suppressed.
Police have yet to interview the 26-year-old victim, who underwent surgery at Dunedin Hospital for stab wounds to her neck and face.
A hospital spokeswoman said last night the victim was progressing. She was in a surgical ward with restricted visitation.
Police said she was extremely lucky to survive the random act of violence at her Duncan St flat on Monday.
They believed she opened her front door to a man she did not know, about 8.30am, and was stabbed in the throat area and punched in the face.
She managed to fend off her attacker and left the flat with her 3-year-old daughter, who was unhurt.
A passing motorist saw the woman in a distressed state and took her and her daughter to the hospital.
Police would not say what the woman was stabbed with.
Detective Inspector Kevin Hooper said no-one else was being sought in relation to the attack and further serious charges were likely.
The woman's daughter was being looked after.
Det Insp Hooper thanked members of the public who provided information about the incident and said inquiries were continuing.
Examination of the woman's flat by police and Environmental Science and Research (ESR) staff would continue today and most likely tomorrow, he said.
The site remained under a police cordon yesterday as evidence was gathered.
Det Insp Hooper said no further comment would be made, as the matter was before the court.
Dan Hutchinson, who lived in the flat above the victim, said she was a hard-working "salt of the earth" type, who moved in with her daughter about nine months ago.
"She's not the sort of person who would attract trouble like that. It is just so random," he said.
Mr Hutchinson left his flat for work about 8.50am on Monday but did not see or hear anything unusual.
He returned home about 10.30am to get his cellphone and was confronted with a police cordon.
"That was the first I knew about it. Cops were everywhere and I couldn't get in," he said.
Forensic staff "cleared a path" for Mr Hutchinson to access stairs to his flat by 6pm but he chose to stay at a friend's house overnight, so as not to disturb the police investigation.
Mr Hutchinson had lived in the flat for almost a year and said he had never felt threatened or in danger.
Duncan St residents were a mixed bunch, he said.
"There are some quite nice homes and nice people up and down there. All sorts of people come and go from a nearby backpackers, but you don't expect things like this to happen so close to home," he said.