Im new to XML and decided I would try and use it to implement a simple CMS compared to constructing a whole MySQL database. However Im stuck on how to print things out on the webpage. In all tutorials I ve seen they loop through each XML element and print out every one, I only want to print out the one where page name = home or page name = mypage.
这完全是在MySQL与WHERE的网页上进行的,但我不得不发现使用XML的同一法典是什么。
<?xml version="1.0" encoding="utf-8"?>
<content>
<page name = "home"><br />
<title>Home</title><br />
<subtitle>a test of my testing</subtitle><br />
<top-papa>blah blah top para</top-papa><br />
<mid-para>blah blah mid para</mid-para><br />
<bot-para>blah blah bot para</bot-para><br />
<image>
<imge>mememem</imge><br />
</image>
</page>
<page name = "whatdowedo"><br />
<title>What do we do?</title><br />
<subtitle>a test of my testing</subtitle><br />
<top-papa>blah blah top para</top-papa><br />
<mid-para>blah blah mid para</mid-para><br />
<bot-para>blah blah bot para</bot-para><br />
<image>
<imge>mememem</imge><br />
</image>
</page>
</content>
Many thanks to all replies. Ben