I have thousands of xml files with title and their description in different xml files.
Example:
<entertainment id="12">
<title>who is your favorite star?</title>
<description>
<male>Brad Pitt</male>
<female>Angelina Jolie</female>
</description>
</entertainment>
I want to create a web page using minidom in python to list all the titles having links to their answer page.
from xml.dom import minidom
doc = minidom.parse('entertainment.xml')
questions = doc.getElementsByTagName('entertainment')
print "<ul><h1>Star Questions</h1>"
for n in questions:
print "<li>" + n.toxml() +"</li>";
print "</ul>";
I have tried writing this code, which list the titles. But couldn’t make a link to the title to it’s description page. And in that short description page, for example “Brad Pitt”, i want to create a link and extract data from another xml file which has more information about Brad Pitt.
I am new to python, so not getting idea to make a link.
The way that you want to achieve to your tag is wrong.
This is the correct hierarchy: