Most efficient way to store list structure in XML

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2010-03-31T15:35:45Z Indexed on 2010/03/31 15:43 UTC
Read the original article Hit count: 386

Filed under:
|
|

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. :)

© Stack Overflow or respective owner

Related posts about Xml

Related posts about xslt