P
P
Pavel Khorikov2015-02-07 02:38:39
MySQL
Pavel Khorikov, 2015-02-07 02:38:39

Implementing xml parsing with database insertion in Yii 2?

There is a complex database structure (authors, articles, titles of articles, names of authors, titles of articles, journal in which the article was published, year, issue number and series of the journal).
All this is a multi-table database that needs to be replenished with data from an xml file. That is, in fact, it is necessary to parse the xml-file with data generated by a third-party resource (in my case, a third-party resource is elibrary.ru) and insert everything into the database mentioned above on our servers. Tell me, colleagues, experts, experienced comrades, how best and more competently to implement this craft?
That is, algorithmically it should be something like the following. Get the xml file (by hand pass it to the parser - so far the only way, due to the lack of any API in the E-library) and the parser should parse the data about the authors, articles and, bypassing all sorts of troubles like repetitions, insert everything into our local database . It is also worth mentioning that there is more than one journal in the editorial office and each author with articles can be published in any of them, which imposes a bunch of checks on the insert to avoid duplicates.
If we completely ignore the details, then the output should be a database in which you can find out which author how many times in which journals was published and which articles (title, description, headings, tags, keywords, udk and other data). And I would like to lift all this on Yii2. I will be glad to any adequate instructions, links and so on.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan, 2015-02-07
@Horik_off

You upload the xml as a regular file to the server, get its content, take the necessary data from the xml using SimpleXML , push it wherever you want according to whatever logic you want.

E
egorsmkv, 2015-02-07
@egorsmkv

They chose the wrong language for parsing, look towards Python. To get data from it, use XPath queries.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question