Sporadic Chinese migration into Vietnam continued between the 9th to 15th century AD. The Vietnamese court during the Lý Dynasty and the Trần Dynasty welcomed ethnic Chinese scholars and officials to fill into its administrative and bureaucratic ranks, but these migrants had to renounce their Chinese identity and assimilate into Vietnamese society. The Vietnamese court also allowed Chinese refugees, which consisted of civilian and military officials with their family members to seek asylum in Vietnam. However, these Chinese settlers were not allowed to change their place of residence without the Court's permission, and were also required to adopt Vietnamese dress and culture. During the Early Lê dynasty some Chinese were captured in 995 after the Vietnamese raided the border. During the Lý Dynasty Vietnam raided Song Dynasty China to enslave Chinese, who were forced to serve in the Vietnamese army as soldiers. In 1050 the Cham dedicated some Chinese slaves to their goddess Lady Po Nagar at the Po Nagar temple complex, along with Thai, Khmer and Burmese slaves. It has been speculated by Professor Kenneth Hall that these slaves were war captives taken by the Cham from the port of Panduranga after the Cham conquered the port and enslaved all of its inhabitants, including foreigners living there. In the South, the Daoyi Zhilue also mentioned Chinese merchants who went to Cham ports in Champa, married Cham women, to whom they regularly returned to after trading voyages. One notable example of such intermarriages was Chinese merchant from Quanzhou, Wang Yuanmao, who in the 12th century traded extensively with Champa and married a Cham princess. Chinese prisoners were returned to China for captured districts in 1078 after China defeated Đại Việt and overran several of Cao Bằng Province's districts.