T
T
trace82015-11-12 03:51:58
Programming
trace8, 2015-11-12 03:51:58

XML to XML parsing and conversion. How to change a structure?

There is a database of books in xml. Inside such fields as author, publisher, year, text, pages, etc. This is an export from some system1. And there is another system2 where you need to upload this data, but there the xml files have a different structure - different tags or even the absence of some. These tags have the same meaning, but are written differently.
For example, in system1 there is a date tag in the date format, and in system2 there is an analogue of date_of_outgoing of the string type.
It is necessary to make a converter that would accept data in the system1 format as input and convert them into xml for system2.
We have:
- xsd files source and desired
- dtd files source and desired
- xml file with data and example xml from system2.
I can write simple programs in c++, c#, js, php. MB there are ready decisions? Please advise how best to solve this problem? Parse everything as text and replace words? This is gemorno, mb there are libraries? Or any third party software? Mb other approaches?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
X
xmoonlight, 2015-11-12
@trase8

Task : Search for intersections of two structures.
Procedure :
1. Search for the intersection of branches
2. Analysis of similar elements of the structure (levenshtein, etc.) and correction of the GENERAL structure.
3. Creation of a dictionary of synonyms ([unique entity ID]: Writer, Creator, Creator, Author), then - again step 2.
4. Remaining data - manual mapping.
Stream method (without checking the integrity of the XML structure).
https://www.ibm.com/developerworks/en/library/x-xm...

N
nirvimel, 2015-11-12
@nirvimel

XSLT - If you want to declaratively describe transformations.
If it is more pleasant imperatively, then simply by hands on any PL.

T
trace8, 2015-11-12
@trase8

though it's not really that ugly.)

A
Anatoly Medvedev, 2015-11-12
@balamyt92

Do you need an xml parsing library? Well, let's say I used one from the Qt framework. doc.qt.io/qt-5/qtxml-module.html
here is a good article with an example habrahabr.ru/sandbox/61031 if it is difficult in English.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question