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