I
I
iamserge2019-06-28 23:18:29
XPath
iamserge, 2019-06-28 23:18:29

XPath and dates, is it possible to do conditional queries?

I looked at the examples , it is clearly possible to make requests of the form:

author[last-name = "Bob" and ../price > 50]

All elements that have a child element with a value of Bob and a sibling element with a value greater than 50.

Haven't checked yet, but I hope everything will be fine with dooble numbers too. But then the question arose about the dates. Namely, is it possible to interact with them in text format as well, or will it be necessary to translate everything into numbers? On the one hand, this is not such a problem, but the readability of the file falls below the plinth, without conversions (unless you store a copy in text format), well, or there is more data .... In general, this is not fatal, but still I want to know ....
And the same applies to regular expressions, or at least their similarities, when you need to pass the attribute value through the filter.
In general, the question is, can dates and strings be handled in a more advanced way? Because there is a need for a database, but the data is very monotonous and there are quite a lot of them (up to 10 million actual rows, the rest can be stored, but if necessary, it can be deleted because it does not make sense later). That is, in general, monitoring the database seems much more difficult, as well as installing it in general, for the sake of just records in the spirit of "date + a couple of numbers + comment". This even looks very organic in XML, and besides, it is also just a file ... But the lack of experience and a couple of nuances stops me for now.
Tell me who has already done this, better directly with examples on the topic ... Well, if possible, how fast can it work in C # with its standard library on data files of this size (the length of the line as a whole is unlikely to be more than 200 characters, 500 is a rare case of no more than 5% of all data).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Fov, 2019-06-30
@Roman-Fov

Yes. You can make requests, including rather complex ones, to xml.
Yes. And the numbers will be ok. And with strings too.
Well... and dates too. It will be difficult for us, but we will manage.
But why?
XML was not created as a solution to the data storage problem.
It is not intended for this.
Databases are designed to store data.
Records of the form "date + a couple of numbers + comment" really look organic in it, exactly like records of any other type and structure.
But records of this kind in the database table will be presented more organically.
For all its shortcomings over databases, xml does not provide any advantages over them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question