Zhang Wenwei

His grandfather Zhang Junqing (張君卿) was a copyeditor at Jixian Pavilion (集賢院),[3] and his father Zhang Shang (張裼) served in a number of prominent positions, including, eventually, the military governorship (Jiedushi) of Tianping Circuit (天平, headquartered in modern Tai'an, Shandong).

[5] After his father Zhang Shang died in 877,[4] he left governmental service to observe a mourning period and to attend to the household.

[5] After Huang was defeated and Emperor Xizong returned to Chang'an in 885,[8] Zhang was first made an imperial censor with the title Jiancha Yushi (監察御史); then (either successively or holding the offices all at once) Zuo Bujue (左補闕), a low-level advisory official at the examination bureau of government (門下省, Menxia Sheng); an imperial censor with the title Dianzhong Shi Yushi (殿中侍御史); an imperial chronicler with the title Qiju Sheren (起居舍人); and Sixun Yuanwailang (司勛員外郎), a low-level official at the ministry of civil service affairs (吏部, Libu).

He was then promoted to a supervisory position at the ministry of civil service affairs, with the title Sixun Langzhong (司勛郎中) and put in charge of drafting edicts.

[10] He was also made Zhongshu Shilang (中書侍郎), the deputy head of the legislative bureau, and acting director of taxation (判戶部, Pan Hubu).

[5] Later in the year, when Zhu carried out a purge of many prominent Tang officials at the instigation of Liu and Li Zhen (in which, among others, Pei, Dugu, Cui, and other former chancellors Lu Yi and Wang Pu were killed), Liu had initially prepared an even larger list of officials to purge.

After Liu himself was killed by Zhu around the new year 906,[10] Zhang also took over the duties of the directors of finances and salt and iron monopolies.