Form Filling in XML

Discussion in 'Python' started by heel_spain_scarlet@yahoo.com, Oct 11, 2005.

  1. Guest

    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):
     
    , Oct 11, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. George

    form filling XML

    George, Oct 13, 2005, in forum: Python
    Replies:
    2
    Views:
    383
    Paul Boddie
    Oct 13, 2005
  2. Bob
    Replies:
    1
    Views:
    660
  3. Bob
    Replies:
    0
    Views:
    498
  4. Mohsen Pahlevanzadeh
    Replies:
    0
    Views:
    130
    Mohsen Pahlevanzadeh
    Sep 9, 2013
  5. MRAB
    Replies:
    0
    Views:
    124
Loading...

Share This Page