[Python-au] xml.dom.minidom

Graeme Matthew graeme_matthew@hotmail.com
Sat, 18 Jan 2003 20:56:13 +1100

Hi all, hope the weekend is going well.

I have a problem in trying to work out how minidom works. I have tried pyRXP 
but its not DOM or SAX based , I also found minidom ideal for what I want to 

below is the beginnings of the class that I am developing. Im inheriting 
from object as I will be using __slots__ (just in case anyone asks :-))

This class processes an xml based order

At the moment I can get the root node then I want to extract the order 
details in the example below OrderId and Date. At the moment I am just 


from xml.dom.minidom import parseString
import Order
import OrderLine

class OrderMessageProcessor(object):

    def __init__ (self,data=None):

        self.order = Order.Order()
        self.data = data

    def processOrder(self):

        xmlTree = parseString(self.data)
        assert xmlTree.documentElement.tagname == 'Order'

        order = xmlTree.
        order = xmlTree.getElementsByTagName('Order')
        print order.item(1)
        #orderId = order.getElementsByTagName('OrderId')
        #print getText(orderId)

        #order = xmlTree.documentElement.tagName
        #print order.OrderId


any help would be most wlecome



MSN 8: advanced junk mail protection and 2 months FREE*.