Я работаю с предварительной обработкой XML-файлов, в которых я должен заменить числовой десятичный код классификации в поле следующего XML-файла их текстовым описанием из следующего текстового файла.Как мы можем это сделать?Пожалуйста, помогите.
XML-файл:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- version 1.0 / 2009-11-11T02:23:47+01:00 -->
<!DOCTYPE book SYSTEM "books.dtd">
<book>
<isbn>0006498000</isbn>
<title>Winston's War</title>
<listprice>$10.11</listprice>
<publisher>HarperCollins Publishers Ltd</publisher>
<edition/>
<dewey>813</dewey>
</book>
Текстовый файл, который можно использовать для сопоставления, доступен по адресу: https://www.oclc.org/en/dewey/resources/summaries.html#dev. Выдержка, которая должна работать с вышеуказаннымXML-файл приведен ниже:
800 Literature (Belles-lettres) and rhetoric
801 Philosophy and theory
802 Miscellany
803 Dictionaries & encyclopedias
804 [Unassigned]
805 Serial publications
806 Organizations and management
807 Education, research, related topics
808 Rhetoric & collections of literature
809 History, description & criticism
810 American literature in English
811 American poetry in English
812 American drama in English
813 American fiction in English
814 American essays in English
815 American speeches in English
816 American letters in English
817 American humor and satire in English
818 American miscellaneous writings
819 (Optional number)
820 English & Old English literatures
821 English poetry
822 English drama
823 English fiction
Я ожидаю, что результат будет:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- version 1.0 / 2009-11-11T02:23:47+01:00 -->
<!DOCTYPE book SYSTEM "books.dtd">
<book>
<isbn>0006498000</isbn>
<title>Winston's War</title>
<listprice>$10.11</listprice>
<publisher>HarperCollins Publishers Ltd</publisher>
<edition/>
<dewey>American fiction in English</dewey>
</book>
Спасибо.