Starting a new project and was planning on storing all of my web content in XML. I do not have access to a database so this seemed like the next best thing. One thing I'm struggling with is how to structure the XML for links (which will later be transformed using XSLT). It needs to be fairly flexible as well. Below is what I started with, but I'm starting to question 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>
That should get transformed 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 perhaps have a link that talks about structuring web content properly in XML?
Thank you. :)
I would be tempted 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 inner <links>
is optional and could be removed so you had links/link/link)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With