Re: unencountered error in FFT python

2010-01-30 Thread uche
On Jan 30, 2:30 pm, uche wrote: > On Jan 30, 2:21 pm, Stefan Behnel wrote: > > > > > > > Stefan Behnel, 30.01.2010 19:52: > > > > uche, 30.01.2010 19:33: > > >> I have the following FFT python code > > > > You didn't seriously imp

Re: unencountered error in FFT python

2010-01-30 Thread uche
On Jan 30, 2:21 pm, Stefan Behnel wrote: > Stefan Behnel, 30.01.2010 19:52: > > > uche, 30.01.2010 19:33: > >> I have the following FFT python code > > > You didn't seriously implement an FFT in plain Python code, did you? > > Sorry, no, you didn'

Re: unencountered error in FFT python

2010-01-30 Thread uche
On Jan 30, 2:08 pm, MRAB wrote: > uche wrote: > > Hi, > > I have the following FFT python code and it doesn't seem to compile > > correctly. To run it, please create a file called output.csv with > > 1,2,3,4,5,6,7,8. simply run the main function. I get an

unencountered error in FFT python

2010-01-30 Thread uche
Hi, I have the following FFT python code and it doesn't seem to compile correctly. To run it, please create a file called output.csv with 1,2,3,4,5,6,7,8. simply run the main function. I get an error such as the following: x[a], x[b] = x[(a)] + W[(n % N)] * x[(b)], x[(a)] - W[(n % N)] * x [(b)

Re: lxml/ElementTree and .tail

2006-11-19 Thread Uche Ogbuji
ed to XML. Again, my take: http://www.ibm.com/developerworks/xml/library/x-namcar.html And yes, default namespaces are about 50% of the problem with namespace. QNames in content (which are of course an abuse of namespaces) are almost all of the other 50%. I call them "hidden namespaces":

Re: lxml/ElementTree and .tail

2006-11-19 Thread Uche Ogbuji
Fredrik Lundh wrote: > Uche Ogbuji wrote: > > > I certainly have never liked the aspects of the ElementTree API under > > present discussion. But that's not as important as the fact that I > > think the above statement is misleading. There has always been a > &g

Re: newbie: minidom

2006-11-17 Thread Uche Ogbuji
Paul Watson wrote: > Explicit [XML declaration] is better than implicit. Yes indeed. "Always use an XML declaration" http://www-128.ibm.com/developerworks/xml/library/x-tipdecl.html -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net

Re: lxml/ElementTree and .tail

2006-11-17 Thread Uche Ogbuji
In fact, I think it's clear that Infoset is not even the preeminent *data model* of the XML world. That distinction goes to the XPath data model, which is quite different from the Infoset. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net

Re: WSGI - How Does It Affect Me?

2006-10-10 Thread uche . ogbuji
t; [1] and > <http://www.xml.com/lpt/a/1675> [2] And also the following article, by me, focusing on middleware: http://www.ibm.com/developerworks/library/wa-wsgi/ (cover Weblog entry: http://copia.ogbuji.net/blog/2006-08-23/_Mix_and_m ) -- Uche Ogbuji

Re: Trying to find a elements Xpath and store it as a attribute

2006-10-06 Thread uche . ogbuji
em than you may think :-) Luckily it's a problem I've worked on. For discussion see: http://www.xml.com/pub/a/2004/11/24/py-xml.html For an updated solution see abs_path in Amara domtools. In most cases you can safely call that on an Amara bindery node. -- Uche Ogbuji

Re: File I/O

2006-10-06 Thread uche . ogbuji
ml.html Then add to that the fact that "" can legitimately appear in an XML comment, so that logic is even more brittle. The following code does this *safely* with Amara: import amara doc = amara.parse('test.xml') top = doc.xml_xpath('//Top')[0] top.xml_parent.xml_in

Re: PyXML not supported, what to use next?

2006-10-06 Thread uche . ogbuji
[2] and Amara [3]. For many people these are now very easy to install. This is the case for some other third-party XML tools as well. [1] http://peak.telecommunity.com/DevCenter/EasyInstall [2] http://4suite.org/ [3] http://uche.ogbuji.net/tech/4suite/amara/ -- Uche Ogbuji

Re: XSLT speed comparisons

2006-09-29 Thread uche . ogbuji
what's the XSLT processor in the case of Safari (only the most recent versions of Safari). But regardless, with that coverage you can write apps using XSLT, support the entire spectrum of browsers (and mobile apps, spiders, etc.) and yet rarely ever re

Re: XSLT speed comparisons

2006-09-29 Thread uche . ogbuji
32com.client > > def buildPage(): [SNIP] Added to: http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/python-xslt -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.nethttp://fourthought.com http://copia.ogbuji.net

Re: XSLT speed comparisons

2006-09-29 Thread uche . ogbuji
print buildPage() -- % -- For what it's worth I just developed, and switched to WSGI middleware that only does the transform on the server side if the client doesn't understand XSLT. It's called applyxslt and is part of wsgi.xml [1]. That reduces server load, and with caching (via Mygh

Re: XML parsing and writing

2006-08-28 Thread uche . ogbuji
d more such options. http://uche.ogbuji.net/tech/4suite/amara/ http://4Suite.org -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.nethttp://fourthought.com http://copia.ogbuji.net http://4Suite.org Articles: http://uche.ogbuji.ne

Re: Need help in xml

2006-07-10 Thread uche . ogbuji
i have to compare 2 similar xml document and get the add, changed and > deleted files.and write it into acd.xml file. > can u help me with the python code for this. I am using SAX. Use the right tool and such problems tend to become much simpler. http://www.logilab.org/projects/xmldiff -- Uche Og

Re: Amara: Where's my attribute?

2006-07-07 Thread uche . ogbuji
I don't get a crash on my system (Ubuntu), but I do get a legitimate error message because that DTD is broken. The W3C seems to like disseminating broken DTDs. Just yesterday I was helping someone around the infamous broken XHTML 1.1 DTDs. I do want to know why you're gettign a

Re: Amara: Where's my attribute?

2006-07-02 Thread uche . ogbuji
space declaration. So my guess is that you somehow got way off the rails in your problem-solving, and you'll need to provide mre background if you want help. BTW, I recommend upgrading to Amara 1.1.7. That branch will soon be 1.2, and I consider it more mature than 1.0 at this point.

Re: beautifulsoup .vs tidy

2006-07-02 Thread uche . ogbuji
http://copia.ogbuji.net/blog/2005-07-22/Beyond_HTM Personally, I avoid Tidy. I've too often seen it crash or hang on really bad HTML. TagSoup seems to be built like a tank. I've also never seen BeautifulSoup choke, but I don't use it as much as TagSoup. -- Uche Ogbuji

Re: xpath question

2006-07-02 Thread uche . ogbuji
ports regex in XPath using the EXSLT community standard's regex module [2]. It would be something like: [re:match(@class, 'fo.*'] With the re prefix set as required by the EXSLT module. [1] http://4Suite.org [2] http://www.exslt.org/regexp/ -- Uche Ogbuji

Re: 10GB XML Blows out Memory, Suggestions?

2006-06-11 Thread uche . ogbuji
only instantiating the chunks of interest one at a time. This allows for handling of huge files with a very simple programming idiom. http://uche.ogbuji.net/tech/4suite/amara/ -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.nethttp://fourthough

Re: how to print newline in xml?

2006-06-04 Thread uche . ogbuji
create text nodes by using doc.createTextNode. * You can always remove text nodes (or any other kind) by using .removeChild * It's much easier to navigate if you use XPath. PyXML has an xml.xpath module you can use. Good luck. [1] http://www-128.ibm.com/developerworks/xml/

Re: Announcing atomfeed.py, xmlelements.py, and feedutils.py

2006-03-17 Thread uche . ogbuji
FWIW, see also Sylvain Hellegouarch's atomixlib [1]. It's used in production to generate and manage PlanetAtom [2][3]. [1] http://trac.defuze.org/browser/oss/atomixlib [2] http://planetatom.net/ [3] http://copia.ogbuji.net/blog/2006-01-25/Planet_Ato -- Uche Ogbuji

Re: How to search XML? Are there special libs?

2006-03-17 Thread uche . ogbuji
xing of XML is something the OP needs as well. If so, see [3]. [1] http://uche.ogbuji.net/tech/4Suite/amara/ [2] http://copia.ogbuji.net/blog/2005-06-12/Amara_equi [3] http://copia.ogbuji.net/blog/2005/Sep/20 [4] http://www.xml.com/pub/a/2004/12/08/py-xml.html -- Uche Ogbuji

Re: Python version of XMLUnit?

2006-03-07 Thread uche . ogbuji
LogiLabs's app is that it can output XUpdate, which could be used with, say 4Suite's 4XUpdate to apply a patch to another document. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.nethttp://fourthought.com http://copia.ogbuji

Re: XSLT and gettext?

2006-03-03 Thread uche . ogbuji
4Suite has some friendly gettext-based i18n extensions. See: http://copia.ogbuji.net/blog/2005-06-14/i18n_for_X -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.nethttp://fourthought.com http://copia.ogbuji.net http://4Su

Re: only a simple xml reader value

2006-02-11 Thread uche . ogbuji
result.msg.xml() #to get the XML source for that element print doc.response.resData.appData.name print doc.response.resData.appData.name.xml() [1] http://uche.ogbuji.net/tech/4Suite/amara/ -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.nethttp://fourthought.com http://copia.ogbuji.net http://4Suite.org Articles: http://uche.ogbuji.net/tech/publications/ -- http://mail.python.org/mailman/listinfo/python-list

Re: only a simple xml reader value

2006-02-08 Thread uche . ogbuji
nt entity, because it has multiple elements at document level. It's also not well-formed according to XMLNS 1.0 unless you declare the "title" prefix. You will not be able to use a non XMLNS 1.0 document with most XML technologies, including XSLT

Re: Fromatting an xml file

2006-02-07 Thread uche . ogbuji
good > solution? Thanks! That minidom behavior is fairly unsafe. 4Suite's PrettyPrinter is much safer: >>> from Ft.Xml import Parse >>> from Ft.Xml.Domlette import PrettyPrint >>> XML = "blabla" >>> doc = Parse(XML) >>> Pre

Re: XML Writer in wxPython

2006-02-07 Thread uche . ogbuji
t "" Just be sure you're well aware of all the issues: http://www.xml.com/pub/a/2002/11/13/py-xml.html See also: http://www.ibm.com/developerworks/xml/library/x-think35.html -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net

Re: Large XML Document Processing

2006-02-07 Thread uche . ogbuji
tree-callback methods will give you the best speed. Fredrik already mentioned ElementTree's IterParse. Amara's pushbind and pushdom and 4Suite's Saxlette (which has some neat callback features) are other options. http://uche.ogbuji.net/tech/4suite/amara/ http://4suite.org/docs/Cor

Re: XML Writer in wxPython

2006-02-07 Thread uche . ogbuji
t "" Just be sure you're well aware of all the issues: http://www.xml.com/pub/a/2002/11/13/py-xml.html See also: http://www.ibm.com/developerworks/xml/library/x-think35.html -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net

Re: XML SAX parser bug?

2006-02-07 Thread uche . ogbuji
5881 Using this filter you can then write SAX code that assumes normalized text events. Also, 4Suite's SAX implementation, Saxlette, automatically does this text event merging for you at C speed: http://4suite.org/docs/CoreManual.xml#saxlette -- Uche Ogbuji F

Re: Rss/xml namespaces sgmllib, sax, minidom

2006-01-01 Thread uche . ogbuji
gt; in sax.handlers.contenthandler , is the namespace defined like domain > names on some website? Based on this question, I tend to think you might want to leave the XML processing to someone else's code. How about using Pilgrim's feedparser? http://feedparser.org/ -- Uche Ogbuji

Re: Amara (XML) problem on Solaris

2006-01-01 Thread uche . ogbuji
has no attribute 'create_document' > bash-2.03$ This came up when I was on vacation and incommunicado. What version of Amara are you using on both platforms? How did you install them? Thanks. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuj

Re: Help designing reading/writing a xml-fileformat

2005-12-13 Thread uche . ogbuji
Jacob Kroon wrote: > I'm writing a block-diagram editor, and could use some tips about > writing/reading > diagrams to/from an xml file format. The basic layout of my code : > > class Diagram { > Blocks blocks[] > } > > class Block { > int x, y > } > > class Square(Block) { > int width,

Re: Using XML w/ Python...

2005-12-12 Thread uche . ogbuji
Rick, thanks. Based on your clue I checked, and it seems those Amara packages are not being built rightly. I'll look to get those packages fixed and updated tomorrow. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.nethttp://fourthough

Re: Using XML w/ Python...

2005-12-12 Thread uche . ogbuji
at right after waking up. And it shows :-) Should have been "print domtools.__file__" -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.nethttp://fourthought.com http://copia.ogbuji.net http://4Suite.org Articles: http:/

Re: Using XML w/ Python...

2005-12-12 Thread uche . ogbuji
that you can perhaps try out any solutions we come up with? Thanks. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.nethttp://fourthought.com http://copia.ogbuji.net http://4Suite.org Articles: http://uche.ogbuji.net/tech/publ

Re: Using XML w/ Python...

2005-12-12 Thread uche . ogbuji
""" >>> import amara >>> print dir(amara) ['__builtins__', '__doc__', '__file__', '__name__', '__path__', '__version__', 'binderytools', 'os', 'parse'] &q

Re: Using XML w/ Python...

2005-12-11 Thread uche . ogbuji
#x27;__name__', '__path__', '__version__', 'bindery', 'binderytools', 'binderyxpath', 'create_document', 'dateutil_standins', 'domtools', 'os', 'parse', 'pushbind', 'pushdom', 'py

Re: Using XML w/ Python...

2005-12-11 Thread uche . ogbuji
DId you run a WIndows installer? Next I'd check the library path for ActivePython. What is the output of python -c "import sys; print sys.path" Where you replace "python" abpve with whatever way you invoke ActivePython. -- Uche Ogbuji Fo

Re: Using XML w/ Python...

2005-12-11 Thread uche . ogbuji
at you guessed: >>> import amara >>> rssDigg = amara.parse("http://www.digg.com/rss/index.xml";) >>> print rssDigg.rss.channel.item.title Video: Conan O'Brien iPod Ad Parody -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net

Re: Using XML w/ Python...

2005-12-11 Thread uche . ogbuji
[1] http://uche.ogbuji.net/tech/4suite/amara/ [2] http://uche.ogbuji.net/uche.ogbuji.net/tech/4suite/amara/manual-dev -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.nethttp://fourthought.com http://copia.ogbuji.net http://4Suite

Re: Creating referenceable objects from XML

2005-12-11 Thread uche . ogbuji
one possible hybrid approach. xmltramp ( http://www.aaronsw.com/2002/xmltramp/ ) is another interesting hybrid. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.nethttp://fourthought.com http://copia.ogbuji.net http://4Suite.org Articles: http://uche.ogbuji.net/tech/publications/ -- http://mail.python.org/mailman/listinfo/python-list

Re: XML and namespaces

2005-12-05 Thread uche . ogbuji
ere an option to make it include namespaces? """ Getting back to the OP: PyXML's xml.dom.ext.Print does get things right, and based on discussion in this thread, the only way you can serialize correctly is to use that add-on with minidom, or to

Re: XML and namespaces

2005-12-05 Thread uche . ogbuji
wildering, not XML namespaces (well, they are confusing, but I have a good handle on all the nuances by now). Again, no skin off my back here: I write and use tools that are XML namespaces compliant. It doesn't hurt me that Minidom is not. I was hoping to help, but again I

Re: XML and namespaces

2005-12-05 Thread uche . ogbuji
ompleted their work until they also do: element.setAttributeNS(xml.dom.XMLNS_NAMESPACE, None, "DAV:") I'd love to hear how many actual minidom users would agree with you. """ Of course (FWIW) I meant element.setAttributeNS(xml.dom.XMLNS_NAMESPACE, "xmlns", &

Re: XML and namespaces

2005-12-05 Thread uche . ogbuji
with you. It's currently a bug. It needs to be fixed. However, I have no time for this bewildering fight. If the consensus is to leave minidom the way it is, I'll just wash my hands of the matter, but I'll be sure to emphasize heavily to users that minidom is broken with res

Re: XML and namespaces

2005-12-02 Thread uche . ogbuji
diosyncracies. Andrew, for this reason I probably take the initiative to work up a patch for the issue. I'll do what I can to get to it tomorrow. If you help me with code review and maybe writing some tests, that would be a huge help. -- Uche Ogbuji

Re: XML and namespaces

2005-12-02 Thread uche . ogbuji
L documents that aren't well-formed w.r.t. namespaces, I think.) """ Oh no. That only means that namespace declaration attributes are not created in the DOM data structure. However, output has to fix up namespaces in .namespaceURI properties as well as directly asserted "

Re: XML and namespaces

2005-11-30 Thread uche . ogbuji
=637355&group_id=6473&atid=106473 Different symptom, but also looks like a case of namespace ignorant code. Can anyone who's worked on minidom more recently let me know if I'm just blind to something? -- Uche Ogbuji Fourthought, Inc. h

Re: xpath support in python 2.4

2005-11-29 Thread uche . ogbuji
"And80": "Is [the xml.xpath module] still part of the standard library?" Alan Kennedy: "No, it's not. Not sure if it ever was. " It never was. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.nethttp://four

Re: XMLSchema Parsing

2005-11-29 Thread uche . ogbuji
l2/Python lxml generateDS.py Good luck. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.nethttp://fourthought.com http://copia.ogbuji.net http://4Suite.org Articles: http://uche.ogbuji.net/tech/publications/ -- http://mail.pyth

Re: Move xml.sax.saxutils.*?

2005-11-29 Thread uche . ogbuji
But as an alias, rather than a replacement for the current import. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.nethttp://fourthought.com http://copia.ogbuji.net http://4Suite.org Articles: http://uche.ogbuji.ne

Re: BisonGen parser generator. Newbie question

2005-11-29 Thread uche . ogbuji
ou want to try a recent CVS version, grab the snapshot: ftp://ftp.fourthought.com/pub/cvs-snapshots/BisonGen-CVS.tar.gz (.zip also available). Also, you might want to ask BGen questions on the 4Suite mailing list, where other BGen developers hang out. http://lists.fourthought.com/pipermail/4sui

Re: Writing big XML files where beginning depends on end.

2005-11-28 Thread uche . ogbuji
writer.xmlFragment method to stitch the inner subtrees to the outer shell. MarkupWriter operates in streaming mode, so you would not be holding much XML in memory at all. http://www.xml.com/pub/a/2005/04/20/py-xml.html -- Uche Ogbuji Fourthought, Inc. http:/

Re: Recommendation please: forming an XML toolkit

2005-11-11 Thread uche . ogbuji
u have initial impressions based on that. If you have specific outstanding questions, do ask. If not, I would just take a chance on whatever your present leaning may be. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.nethttp://fourthought.com

Re: Add attribute using pyxml

2005-11-04 Thread uche . ogbuji
"How do I add a new attribute to the existing xml Document tree??? " what do you mean by "using pyxml"? There are several pyxml modules. Do you mean minidom? If so that comes with stock Python as well (hint: element_node.setAttributeNS(ns, qnam

Re: XML DOM: XML/XHTML inside a text node

2005-11-04 Thread uche . ogbuji
cument or element object. Many short examples here: http://copia.ogbuji.net/blog/2005-09-21/Dare_s_XLI excerpt: Adding a element as a child of the element' contacts.xml_append_fragment('%s'%'206-555-0168' http://uche.ogbuji.net/tech/4suite/amara -- Uche Ogbuji

Re: XML Tree Discovery (script, tool, __?)

2005-10-30 Thread uche . ogbuji
(http://saxon.sourceforge.net/dtdgen.html), though as the original it has several limitations on the accuracy of the inferred DTD. " Ah. Cool. Got a link? -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.nethttp://four

Re: XML Tree Discovery (script, tool, __?)

2005-10-28 Thread uche . ogbuji
operworks/xml/library/x-xmptron/ It's XSLT rather than Python, but the good news is that XSLT is easy to invoke from Python using tools such as 4Suite. http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/python-xslt -- Uche Ogbuji Fourthought, Inc. http://uche.og

Re: XML Tree Discovery (script, tool, __?)

2005-10-27 Thread uche . ogbuji
oin([n.nodeName for n in e.xml_xpath(u'ancestor::*')]) paths.add(u'/' + path) #Pretty-print output for name in elems: print name, '\n\t\t\t', '\n\t\t\t'.join(elems[name]) -- Uche Ogbuji Fourthought, Inc. http://uche.

Re: XML Tree Discovery (script, tool, __?)

2005-10-26 Thread uche . ogbuji
arbitrary element I would know: 1) whether the element was in a document 2) where to find it (the chain of parents) """ This is easy to do in SAX. For some hints, see page 2 of my article: http://www.xml.com/pub/a/2004/11/24/py-xml.html -- Uche Ogbuji

Re: XML Tree Discovery (script, tool, __?)

2005-10-24 Thread uche . ogbuji
might want to be more specific. What sort of output do you want from this discovery? -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.nethttp://fourthought.com http://copia.ogbuji.net http://4Suite.org Articles: http://uche.

Re: xml2schema

2005-09-30 Thread uche . ogbuji
quot; Very well put. However, for RELAX NG there is a tool that might work for the OP: Examplotron. See: http://www-128.ibm.com/developerworks/xml/library/x-xmptron/ As I show in that article, you can use Examplotron from any XSLT processor, including one invoked through Python API. -- Uch

Re: xml2schema

2005-09-23 Thread uche . ogbuji
quot; Very well put. However, for RELAX NG there is a tool that might work for the OP: Examplotron. See: http://www-128.ibm.com/developerworks/xml/library/x-xmptron/ As I show in that article, you can use Examplotron from any XSLT processor, including one invoked through Python API. -- Uch

Re: What XML lib to use?

2005-09-13 Thread uche . ogbuji
ons besides Amara: http://www.xml.com/pub/at/24 -- Uche http://copia.ogbuji.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Limited XML tidy

2005-08-25 Thread uche . ogbuji
might be your best bet. You might even be able to turn that SGML into XML using a tool such as James Clark's SX: http://www.jclark.com/sp/sx.htm -- Uche http://copia.ogbuji.net -- http://mail.python.org/mailman/listinfo/python-list

Re: PyXML and xml.dom

2005-08-17 Thread uche . ogbuji
> Is PyXML now part of the Python distribution, or is it still an add-on? Parts of PyXML have been migrated into Python core since Python 2.0, but there is still also a standalone PyXML package.,. See: http://www.xml.com/pub/a/2002/09/25/py.html -- Uche http://copia.ogbuji.net -- h

Re: [XML-SIG] xml-object mapping

2005-07-30 Thread Uche Ogbuji
or existing object models")) Answered: http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/a63d0ad3fd23cb37/6ad0223c5b8f9946?lnk=st&q=python+xml&rnum=3&hl=en -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net

Re: xml-object mapping

2005-07-29 Thread uche . ogbuji
's defined in a W3C XML Schema file, which makes good sense (except that in my case I dislike WXS). Amara does not use a mapping specification: it maps automatically, and it allows you to specify your own classes for the mapping. This is discussed in the manual. http://uche.ogbuji.ne

Re: Suggestions for Python XML library which can search and insert

2005-07-29 Thread uche . ogbuji
#x27; for trees which are relatively shallow compared to mine. " Amara can easily do this using XPath (complete with predicates, functions, etc.), without nested for loops: http://uche.ogbuji.net/tech/4Suite/amara/ -- Uche http://uche.ogbuji.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Differences between RDFlib - 4RDF and Redfoot - 4Suite?

2005-07-15 Thread uche . ogbuji
ain XML, and stuff like Versa RDF query language aren't important to you, you'll get along just fine with rdflib. -- Uche http://copia.ogbuji.net -- http://mail.python.org/mailman/listinfo/python-list

Re: formatted xml output from ElementTree inconsistency

2005-06-26 Thread uche . ogbuji
from the XSLT spec, which is designed by people who have the above design goal well in their blood. -- Uche http://copia.ogbuji.net -- http://mail.python.org/mailman/listinfo/python-list

Re: ElementTree Namespace Prefixes

2005-06-17 Thread uche . ogbuji
[1] http://4suite.org [2] http://uche.ogbuji.net/tech/4Suite/amara/ -- Uche http://copia.ogbuji.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting a DOM element's children by type (STUPID)

2005-06-10 Thread uche . ogbuji
In Amara[2], this task is trivial. To get all the images in an XHTML div, you'd simply do: for img in div.img: process_img(img) You access names directly as objects according to their element type name. [1] see, e.g., http://www.xml.com/pub/a/2003/01/08/py-xml.html [2] see http:

Re: Elementtree and CDATA handling

2005-06-04 Thread uche . ogbuji
TML serialiser. " Amara does provide for this, e.g.: from amara.binderytools import bind_string doc = bind_string(text) print doc.xml(method=u"html") Which automatically and transparently brings to bear the full power of the XSLT HTML output method. -- Uche Ogbuji

Re: Newbie Python & XML

2005-06-04 Thread uche . ogbuji
1-01/general-section -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.nethttp://fourthought.com http://copia.ogbuji.net http://4Suite.org Use CSS to display XML, part 2 - http://www-128.ibm.com/developerworks/edu/x-dw-x-xmlcs

Re: Bug in Elementtree/Expat

2005-05-20 Thread uche . ogbuji
validate. This may seem a subtle distinction, but it lies behind a lot of user confusion in practice. The XML WG really should have simplified such matters (IIRC SGML compatability was a big obstruction to doing so). -- Uche http://uche.ogbuji.net -- http://mail.python.org/mailman/listinfo/python-list

Re: XML file parsing with SAX

2005-04-23 Thread Uche Ogbuji
cal filesystem. Problem, now that I think of it, is that I'm not sure you can specify an catalog in PySAX. You might instead have to override the method entityResolver in your handler (and be sure to ). See the example in listing 1 and and discussion here: http://www.xml.com/pub/a/

Re: XML file parsing with SAX

2005-04-23 Thread Uche Ogbuji
s"; true: Include all external general (text) entities. false: Do not include external general entities. access: (parsing) read-only; (not parsing) read/write """ Quote from: http://docs.python.org/lib/module-xml.sax.handler.html But you're on pre

Re: python modules in home dir

2005-04-23 Thread Uche Ogbuji
On Sat, 2005-04-16 at 08:12 -0600, Uche Ogbuji wrote: > On Sat, 2005-04-09 at 14:09 -0700, dzieciou wrote: > > > I'm new-comer in Python. > > I want to install few Python modules (4Suite, RDFLib, Twisted and Racoon) > > in my home directory, since Python installatio

Re: python modules in home dir

2005-04-16 Thread Uche Ogbuji
. > I cannot install pyvm (portable binary python machine) - have no such big > quota. > Any idea how can I solve it? To install 4Suite in the home dir, use an incantation such as: ./setup.py config --prefix=$HOME/lib ./setup.py install Note: I expect you also installed Python i

Re: how to use structured markup tools

2005-03-22 Thread Uche Ogbuji
])) Same output, of course. I even tested it for you in Amara 0.9.4. And what the heck, while I was there, I added it to the demos. You can make things even more obfuscated^H^H^H^H^H^H^H^H^H^Hterse using further lambda or list comp tricks, but I leave that as an exercise for the perverse

Re: Simple XML-to-Python conversion

2005-03-22 Thread Uche Ogbuji
gt; compiled, but I'll try it anyway. Actually, as I mentioned in my last message, we do have some success reports re: 4Suite + py2exe. See the March archives of the 4Suite list. I think it took some work from those of the 4Suite developers who are Windows-savvy, it did

Re: Simple XML-to-Python conversion

2005-03-22 Thread Uche Ogbuji
ara discussion as well). I follow that list far more diligently than c.l.py. -- Uche OgbujiFourthought, Inc. http://uche.ogbuji.nethttp://4Suite.orghttp://fourthought.com Use CSS to display XML, part 2 - http://www-128.ibm.com/developerworks/edu/x-dw-x-xm

Re: SAX parsing problem

2005-03-22 Thread Uche Ogbuji
l/xml-sig/2005-March/011013.html -- Uche OgbujiFourthought, Inc. http://uche.ogbuji.nethttp://4Suite.orghttp://fourthought.com Use CSS to display XML, part 2 - http://www-128.ibm.com/developerworks/edu/x-dw-x-xmlcss2-i.html Introducing the Amara XML Toolki

Re: SAX: Help on processing qualified attribute values

2005-03-22 Thread Uche Ogbuji
0989.html I also provide a useful mix-in class for this purpose in Amara's saxtools: http://www.xml.com/pub/a/2005/01/19/amara.html http://cvs.4suite.org/viewcvs/Amara/lib/saxtools.py?rev=1.9&view=markup In the latter link see class namespace_mixin, which you should be able

Re: best XSLT processor?

2005-03-04 Thread uche . ogbuji
prefer to just search weekly for "Python XML". --Uche -- http://mail.python.org/mailman/listinfo/python-list

Re: get textual content of a Xml element using 4DOM

2005-03-04 Thread uche . ogbuji
I suggest using minidom or pxdom [1] rather than 4DOM. If you insist on using 4DOM, xml.dom.ext.Print(node) or xml.dom.ext.PrettyPrint(node) does what you want. [1] http://www.doxdesk.com/software/py/pxdom.html --Uche -- http://mail.python.org/mailman/listinfo/python-list

Re: get textual content of a Xml element using 4DOM

2005-03-04 Thread uche . ogbuji
I suggest using minidom or pxdom [1] rather than 4DOM. If you insist on using 4DOM, xml.dom.ext.Print(node) or xml.dom.ext.PrettyPrint(node) does what you want. --Uche -- http://mail.python.org/mailman/listinfo/python-list

Re: best XSLT processor?

2005-02-28 Thread uche . ogbuji
Actually, most of the compliant problems I can remember off-head with respect to Xalan have been regarding EXSLT 1.0, not base XSLT 1.0. Sorry for any misconstruction. --Uche -- http://mail.python.org/mailman/listinfo/python-list

Re: best XSLT processor?

2005-02-28 Thread uche . ogbuji
xotic to run into trouble. Just pick one or two and try them. http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/python-xslt --Uche -- http://mail.python.org/mailman/listinfo/python-list

Re: best XSLT processor?

2005-02-28 Thread uche . ogbuji
compliance examples. You fired the first shot. Can you back it up? --Uche -- http://mail.python.org/mailman/listinfo/python-list

Re: best XSLT processor?

2005-02-28 Thread uche . ogbuji
Who says 4Suite is buggy? Do they have any evidence to back that up? We have a huge test suite, and though 4Suite is by no means the fastest option, it's quite reliable for XSLT. The XSLT processor in PyXML is just a very old version of 4XSLT. --Uche -- http://mail.python.org/mailman/lis

Re: forms, xslt and python

2005-02-04 Thread Uche Ogbuji
to do this? -- Uche OgbujiFourthought, Inc. http://uche.ogbuji.nethttp://4Suite.orghttp://fourthought.com Use CSS to display XML - http://www.ibm.com/developerworks/edu/x-dw-x-xmlcss-i.html Introducing the Amara XML Toolkit - http://www.xml.com/pub/a/

Re: parsing WSDL

2005-01-27 Thread Uche Ogbuji
Just for completeness I wanted to mention that yes, you can use 4Suite to parse WSDL and get method signature information, but I do agree that it's better to do this at a higher level, if you can. WHy reinvent that wheel? SOAPpy has a decent WSDL class. -- Uche O

Re: 4suite XSLT thread safe ?

2005-01-27 Thread Uche Ogbuji
d has its own instance, there are no state clashes. Therefore, you should be creating at least one processor object per thread. Note: the 4Suite server is a multi-threaded architecture that uses 4XSLT heavily using processor-per-thread. -- Uche OgbujiFourthought

  1   2   >