The most efficient way to store list structure in XML

Starting a new project and planning to store all my web content in XML. I don't have access to the database, so it looked like the next best. One thing I'm struggling with is to structure the XML for the links (which will later be converted using XSLT). It should also be flexible enough. Below I started with this, but I'm starting to doubt it.

<links> <link> <url>http://google.com</url> <description>Google</description> <link> <link> <url>http://yahoo.com</url> <description>Yahoo</description> <links> <url>http://yahoo.com/search</url> <description>Search</description> </link> <link> </links> 

It should transform into

Google Yahoo Search

Perhaps something like this might work better.

 <links> <link href="http://google.com">Google</link> <link href="http://yahoo.com">Yahoo <link href="http://yahoo.com/search">Search</link> </link> </links> 

Does anyone have a link that correctly describes the structuring of web content in XML?

Thanks.:)

+4
source share
2 answers

I would have a desire to use something like:

 <links> <link url="http://google.com" text="Google"/> <link url="http://yahoo.com" text="Yahoo"> <links> <link url="http://yahoo.com/search" text="Search"/> </links> </link> </links> 

(although the internal <links> is optional and can be removed, so you have links / link / link)

+2
source

Are you sure you are using XML as a database? See: When will I use XML instead of SQL?

"XML is not a database. It means a database. It will never be a database. Relational databases are proven technology with over 20 years of experience. They are solid, stable, useful products. They do not go far. XML is a very useful technology for moving data between different databases or between databases and other programs. However, this is not the database itself. Do not use it as one. "

0
source

Source: https://habr.com/ru/post/1305673/


All Articles