It is not known when Zhang Wenwei was born. His family claimed ancestry from the early Han dynasty general Zhang Er (張耳). The traceable ancestry of Zhang Wenwei's included officials of Sui dynasty and Tang dynasty. 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).[4] Zhang Wenwei had at least two younger brothers, Zhang Jimei (張濟美) and Zhang Yixian (張貽憲),[3] both of whom, like he, would eventually pass the imperial examinations in the Jinshi (進士) class.[when?] However, only Zhang Yixian would go on to serve as an imperial official;[4] Zhang Jimei would be stricken by mental ailments, and it was said that Zhang Wenwei, while eventually progressing in his career, would care for Zhang Jimei's health for over 30 years, drawing praise from the gentry of the day. Zhang Wenwei himself was said to be good at writing in his youth, and he was both studious and friendly with people, gaining the reputation of being a gentleman.[5]
Early career
Zhang Wenwei passed the imperial examinations in the Jinshi class in 875, during the reign of Emperor Xizong.[4] He thereafter served as a surveyor for the office of salt and iron monopolies;[5][6] he then served as a sheriff of a county near the imperial capital Chang'an, as well as a scholar at an imperial institute.[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]
Sometime during Emperor Xizong's Zhonghe era (881-885), when Emperor Xizong had fled to Chengdu due to the major agrarian rebellion led by Huang Chao, who captured Chang'an and declared his own state of Qi as its emperor,[7] Emperor Xizong, in order to raise funds for the military campaigns against Qi, moved the office of salt and iron monopolies to Yang Prefecture (揚州, in modern Yangzhou, Jiangsu) and put the official Li Du (李都) in charge of the office. At Li Du's recommendation, Zhang Wenwei was made a roving surveyor for the office.[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. After serving in those roles for a year, he was made Zhongshu Sheren (中書舍人). After his mother's death, he left governmental service to observe a mourning period for her.[5]
After Zhang finished observing the mourning period, he returned to the imperial government as a Zhongshu Sheren. He was soon thereafter made the chief imperial scholar (翰林學士承旨, Hanlin Xueshi Chengzhi). As then-reigning Emperor Zhaozong (Emperor Xizong's brother and successor) had just returned to Chang'an,[9] and the imperial authority was extremely weak at that time, edicts that Zhang drafted had to be, and were, appropriately delicate in language but assertive, and was much praised for their propriety. He was then given the additional post of deputy minister of census (戶部侍郎, Hubu Shilang), and later was made the deputy minister of rites (禮部侍郎, Libu Shilang) but no longer imperial scholar by that point.[5]
Chancellorship
As of 905, Zhang was still serving as the deputy minister of rites[10]—at that time, at Luoyang, which had been made the capital after the powerful warlord Zhu Quanzhong the military governor of Xuanwu Circuit (宣武, headquartered in modern Kaifeng, Henan) had forcibly moved Emperor Zhaozong from Chang'an to Luoyang in 904,[11]—under Emperor Zhaozong's son and successor Emperor Ai, as Zhu had had Emperor Zhaozong assassinated late in 904. In 905, the chancellor Liu Can, an associate of Zhu's, had alienated Zhu from the other chancellors Pei Shu, Dugu Sun, and Cui Yuan; Pei, Dugu, and Cui were therefore removed from chancellor offices, while Zhang and Yang She were made chancellors, with the designation Tong Zhongshu Menxia Pingzhangshi (同中書門下平章事).[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. It was said that it was at Zhang's urging that the purge was not expanded. 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.[5]
In 907, Emperor Ai was preparing to yield the throne to Zhu Quanzhong. As part of the ceremonial passage of the throne, Zhang, acting as the head of the legislative bureau (中書令, Zhongshu Ling), was put in charge of announcing the passage of the throne. He, as well as Yang (who was to deliver the main imperial seal to Zhu) and Xue Yiju (who was to deliver the secondary imperial seals), went in a grand procession from Luoyang to Daliang (i.e., the capital of Xuanwu Circuit), where Zhu was at the time, for the ceremony. Zhu accepted the throne, ending Tang and starting a new Later Liang (as its Emperor Taizu). It was said that, at a subsequent feast that the new emperor held for Zhang and the other Tang officials, most of them, including Zhang, were prostrate and unable to speak.[1]
During Later Liang
After the transition to Later Liang, Zhang remained chancellor. He was said to be the drafter of much of the regulations that the Later Liang imperial government used.[12] When Emperor Taizu left Luoyang in 908 to battle the state of Jin (i.e., the lands ruled by Li Cunxu the Prince of Jin, who refused to recognize the new Later Liang regime), he left Zhang in charge of Luoyang. Zhang died later in 908, while still serving as a Later Liang chancellor.[1]
^Zhang Wenwei's biography in the History of the Five Dynasties indicated that he served at the office of salt and iron monopolies under the chancellorPei Tan; however, as Pei only served briefly as chancellor in 874, prior to Zhang's passing the imperial examinations, this would not have been possible. See Zizhi Tongjian, vol. 252.
^Emperor Zhaozong had left Chang'an on three occasions during his reign—fleeing the potential attacks by the warlords Li Maozhen and Wang Xingyu in 895, returning later in the year; fleeing the attach by Li in 896, returning in 898; and taken forcibly by the eunuchs to Li's domain of Fengxiang Circuit (鳳翔, headquartered in modern Baoji, Shaanxi) in 901, returning in 903. See Zizhi Tongjian, vols. 260, 261, 262, 263. Given that Zhang was mentioned to be the chief imperial scholar when one of the imperial scholars, Liu Can, was made chancellor in 904, according to Liu's biography in the Old Book of Tang, it would appear that the reference here was to the return from Fengxiang in 903. See Old Book of Tang, vol. 179.