I have a little py module that implements the Composite pattern to
represent xml file contents. My class is called ExtensionRegistry
because that's what I use it for, you could rename it to whatever you
wanted. After parsing, this allows me to access my xml file contents
like this:
xmlFile = Exten
you can use function parse from xml.sax
It takes your xml as the first argument and an
xml.sax.handler.ContentHandler instance as the second.
---
from xml.sax import parse
from xml.sax.handler import ContentHandler
class LogHandler(ContentHandler):
def startElement(self,name):
if na
[EMAIL PROTECTED]:
>Can you please tell me how Use python to process XML file?
>The example I find is build a DOM, but I just need to do it in SAX
>based, how can I do that?
http://docs.python.org/lib/module-xml.sax.html
http://pyxml.sourceforge.net/topics/howto/section-SAX.html
--
Ren
Hi,
Can you please tell me how Use python to process XML file?
The example I find is build a DOM, but I just need to do it in SAX
based, how can I do that?
For example, I have a xml file like this:
text
text
text
text
text
text
text
For i want to process the node in the order