Re: [MathDOM] Problem running MathDOM
Brought to you by:
scoder
From: Stefan B. <ste...@be...> - 2007-04-11 08:46:30
|
Hi, chrystiano araujo wrote: > You helped me a lot. i've already installed the lxml1.0. and it's > functioning. Good. > But now, there is another doubt. > can you help me again? I would prefer it if you wrote to the mailing list. Admittedly, there are not a lot of subscribers currently, but at least your questions get archived that way, so that others can find them on the web. > I have to make a Mathml parser with python. So i have to study > mathdom a lot, don't I? What do you need a MathML parser for? How is that more than a validating XML parser? (and how is that different from what MathDOM already gives you?) > and i have only 3 examples as documentation, i think it's not enough. As I said, look at the Python scripts that come with MathDOM. They use quite a big part of the API, so they may give you enough hints already. > doc.serialize("python") > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "/usr/local/lib/python2.5/site-packages/mathml/mathdom.py", line > 441, in serialize > return serialize_dom(self._document, output_format, converter) > File "/usr/local/lib/python2.5/site-packages/mathml/xmlterm.py", line > 134, in serialize_dom > tree = dom_to_tree(doc_or_element) > File "/usr/local/lib/python2.5/site-packages/mathml/xmlterm.py", line > 216, in dom_to_tree > tree = _recursive_dom_to_tree(root) > File "/usr/local/lib/python2.5/site-packages/mathml/xmlterm.py", line > 188, in _recursive_dom_to_tree > name = operator.mathtype() > File "/usr/lib/python2.5/site-packages/_xmlplus/dom/FtNode.py", line > 83, in __getattr__ > return getattr(FtNode, name) > AttributeError: class FtNode has no attribute 'mathtype' Hmm, ok, now that's using the PyXML implementation of MathDOM. I'll have to check what's not working here. Any reason you can't keep using MathDOM with lxml? It's the preferred way anyway. Regards, Stefan |