Form Filling in XML

H

heel_spain_scarlet

if i have the following chunck of code how can I look at the Text Nodes
of Fillin and compare them with the Element Nodes of Form and if they
are equal put the Text Node of Fillin into the Text Node of Form

ie)<Monday>=Monday so put maandag it between <li> and </li>
so <li>maantag</li>

thanks for the insight

import xml.dom.minidom

form = """
<html>
<head> <title> My Sample Web Page </title> </head>
<body bgcolor="white">
<p>
What are the weekdays?
<ol>
<li>Monday</li>
<li>Tuesday</li>
<li>Wednesday</li>
<li>Thursday</li>
<li>Friday</li>
</ol>
</p>
</body>
</html>
"""

fillin = """
<dutchdays><Monday>maandag</Monday><Tuesday>dinsdag</Tuesday>
<Wednesday>woensdag</Wednesday><Thursday>donderdag</Thursday>
<Friday>vrijdag</Friday><Saturday>zaterdag</Saturday>
<Sunday>zondag</Sunday>
</dutchdays>
"""

For = xml.dom.minidom.parseString(form) # parse some XML into a DOM
object
Fill = xml.dom.minidom.parseString(fillin) # parse some XML into a DOM
object

def xmlForm(formstr=None, fillinstr=None):
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top