XML-based databases as with SQL?
Is it possible to store data as plain XML files and be able to search and sort information as in SQL? Various applications I have in mi开发者_如何学Gond are simple phonebooks, bookmarks lists, passwords lists for personal use.
For example:
<accounts>
<account>
<website>mail.google.com</website>
<username>example@gmail.com</username>
<password>mypassword</password>
</account>
<account>
...
</account>
</accounts>
In this case, I should be able to select only those websites where I use a particular password or username, for example.
If possible, I'd like to accomplish this just using a web browser or something such as them. No web servers or other daemons should be running on my machine as I don't want much overhead for such simple things.
Let me know if the question is not clear enough.
Thank you.
Have you seen XQuery ?
XQuery is to XML what SQL is to database tables.
Various implementations exist, including this in-browser version.
Take a look at Sedna, eXist and BaseX, these appear to be both open source and alive.
There are two main classes of XML databases: those that do "only XML", of which the best known are probably eXist as an open source solution, and MarkLogic as a commercial product; and those that do XML alongside relational data, which is possible with DB2, SQL server, and Oracle. All offer XQuery (sometimes with extensions or restrictions) as the main query language. If your data is naturally hierarchic and already represented in XML, then you should certainly consider these products rather than converting your data into the tabular form required for storage in a relational database - which is basically wasted effort.
精彩评论