legalism (legal + -ism; doctrine_practice)
Focusing on the text of written law to the exclusion of the intent of law, elevating strict adherence to law over justice, mercy, grace and common sense