K
K
Karina2015-09-17 10:57:12
Programming
Karina, 2015-09-17 10:57:12

How to store xml in db?

There is a large xml, where there are MANY, MANY attributes. This xml must be stored in the DB. And I will have 14 such types of xml. For now, it’s a draft version, without a framework, but later it will be necessary to somehow screw ORM. I do not know what to do.
Yesterday I did this - I made a separate field in the table for each attribute. Today it seems like I did something crazy.
I understand that the best option is to store somehow in an array. But how is it possible to link the ORM and the array?
How can this be organized and what design pattern should be used?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
C
Curly Brace, 2015-09-17
@stasuss

make separate tables for each entity (the type of object described in the file), in the tables the fields are the attributes of the entities. link the tables to each other to taste.

D
Dmitry Kovalsky, 2015-09-17
@dmitryKovalskiy

If you want to deserialize xml into a dataset by tables, then the standard simplest option is a field table (id, nameNode) and a value table (NodeId, Value). But in general, the DBMS should have a special type xmlData

O
Optimus, 2015-09-17
Pyan @marrk2

Little data, xml is stored as a file, will someone request it? Then let there be a file and the data from the database is unloaded into it once a day, for example. Why store xml in a database? Is it requested a lot and often? Then you can give in another form.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question