Hyeonjong of Goryeo

Hyeonjong of Goryeo (1 August 992 – 17 June 1031, r. 1009–1031) was the 8th ruler of the Goryeo dynasty of Korea. He was a grandson of King Taejo. He was appointed by the military leader Gang Jo, whom the previous King Mokjong had called upon to destroy a plot by Kim Chi-yang.
In 1010, The Khitan attacked again during an internal Goryeo power struggle. Hyeonjong was forced to flee the capital temporarily, Hyeonjong directed the court to move far south to the port city of Naju. But Goryeo repulsed the khitan attack. Finally, Khitan forces withdrew.
In 1019, when Goryeo continued to refuse to submit or return the northern territories, the Khitan attacked once more. Goryeo generals, including Gang Gam-chan, were able to inflict heavy losses on the Khitan army in the Battle of Kwiju. The Khitan withdrew without achieving their demands. The Khitan never again invaded Goryeo. Both the Liao Dynasty and Goryeo enjoyed a time of peace, and their cultures were at their height.
Meantime, Hyeonjong ordered the compilation of the "Tripitaka Koreana", which was 6,000 volumes. It is the act of carving the woodblocks that was considered to be a way of bringing about a change in fortune by invoking the Buddha's help.