I
I
Ilya Balabanov2015-12-09 23:51:51
Java
Ilya Balabanov, 2015-12-09 23:51:51

Which model to write an XML file in Java to use?

The task is to log the history of messages from the chat. Settled on DOM. But I ran into a problem that dom is obtained as a single file, and I need new elements to be added to the xml structure as messages arrive. What do you advise?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Riard Brugekaaim, 2015-12-10
@ilyablbnv

What's the problem?
We take and do something like this:

<log>
<message nik="" data="">Я твой код парсер шатал!</message>
</log>

And then, as we update, we add a new child message to the log.
The first Google link already gives full information about it.

A
Andrey Shishkin, 2015-12-10
@compiler

Why use xml at all?
Write to the file by mask and that's it.
The answers to your question may change if you tell us how you plan to use these logs later :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question