[XML-SIG] need some help...

sa sahrens@uv.ruhr-uni-bochum.de
Fri, 03 Nov 2000 16:32:12 +0100


--------------24C8E55EED37AA0C25B326EB
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Hi folks,
Iīve got some problems with the pyxml stuff. Even though I worked with
xml under perl and eiffel and I am familiar with all the general
concepts of xml / dom / sax etc I donīt have a clue how to do it under
python (I am no python newbee). If one tries to get the documentation
from the python.org site one can read the following lines:


     """
          import sys
          from xml.sax import saxexts
          from xml.dom.sax_builder import SaxBuilder

          # Create a SAX parser and a SaxBuilder instance
          p = saxexts.make_parser()
          dh = SaxBuilder()
          p.setDocumentHandler(dh)

     ----------------- snip ----------------

          from xml.dom import utils
          reader = utils.FileReader('quotations.xml')
          doc = reader.document


     """

Well that sounds so nice but why isnīt any of the mentioned modules in
the distro (no xml.dom.utils.FileReader nor xml.dom.sax_builder ...) and
how should I do it instead? Could anyone point me towards a
documentation or would anyone be so kind to send my some simple code
showing how to parse an xml-file and print out the dom-tree etc.

Oh well if you would help me understand the python way of handling xml I
would try to write down some simple docs if you do not have somebody so
far applying for that job ;-)


            regards

                Sebastian

--------------24C8E55EED37AA0C25B326EB
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hi folks,
<br>I&acute;ve got some problems with the pyxml stuff. Even though I worked
with xml under perl and eiffel and I am familiar with all the general concepts
of xml / dom / sax etc I don&acute;t have a clue how to do it under python
(I am no python newbee). If one tries to get the documentation from the
python.org site one can read the following lines:
<br>&nbsp;
<blockquote>"""
<br>&nbsp;&nbsp;&nbsp;&nbsp; import sys
<br>&nbsp;&nbsp;&nbsp;&nbsp; from xml.sax import saxexts
<br>&nbsp;&nbsp;&nbsp;&nbsp; from xml.dom.sax_builder import SaxBuilder
<p>&nbsp;&nbsp;&nbsp;&nbsp; # Create a SAX parser and a SaxBuilder instance
<br>&nbsp;&nbsp;&nbsp;&nbsp; p = saxexts.make_parser()
<br>&nbsp;&nbsp;&nbsp;&nbsp; dh = SaxBuilder()
<br>&nbsp;&nbsp;&nbsp;&nbsp; p.setDocumentHandler(dh)
<p>----------------- snip ----------------
<p>&nbsp;&nbsp;&nbsp;&nbsp; from xml.dom import utils
<br>&nbsp;&nbsp;&nbsp;&nbsp; reader = utils.FileReader('quotations.xml')
<br>&nbsp;&nbsp;&nbsp;&nbsp; doc = reader.document
<br>&nbsp;
<p>"""</blockquote>

<p><br>Well that sounds so nice but why isn&acute;t any of the mentioned
modules in the distro (no xml.dom.utils.FileReader nor xml.dom.sax_builder
...) and how should I do it instead? Could anyone point me towards a documentation
or would anyone be so kind to send my some simple code showing how to parse
an xml-file and print out the dom-tree etc.
<p>Oh well if you would help me understand the python way of handling xml
I would try to write down some simple docs if you do not have somebody
so far applying for that job ;-)
<br>&nbsp;
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; regards
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Sebastian</html>

--------------24C8E55EED37AA0C25B326EB--