From kfs1 at online.no Wed Apr 4 10:28:39 2007 From: kfs1 at online.no (kfs1 at online.no) Date: Wed, 04 Apr 2007 10:28:39 +0200 Subject: [XML-SIG] Trying to run Frets Onb fire... Message-ID: http://louhi.kempele.fi/~skyostil/uv/fretsonfire/ 3:22:50 ~/Desktop/FretsOnFire $ ./FretsOnFire open /dev/sequencer: No such device open /dev/sequencer: No such device Traceback (most recent call last): File "/home/skyostil/src/cx_Freeze-3.0.3/initscripts/Console.py", line 27, in ? File "src/FretsOnFire.py", line 64, in ? File "src/GameEngine.py", line 186, in __init__ File "src/Data.py", line 48, in __init__ File "src/Data.py", line 108, in loadSvgDrawing File "src/Svg.py", line 576, in convertToTexture File "src/Svg.py", line 597, in _render File "src/Svg.py", line 554, in _cacheDrawing File "/usr/lib/python2.4/site-packages/_xmlplus/sax/sax2exts.py", line 37, in make_parser return XMLParserFactory.make_parser(parser_list) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/saxexts.py", line 77, in make_parser raise _exceptions.SAXReaderNotAvailable("No parsers found", None) xml.sax._exceptions.SAXReaderNotAvailable: No parsers found i have 0.8.4 of pyxml and expat libxml* etc etc.. what could be wrong? From Pierre.DeWet at BITC.ORG.UK Wed Apr 4 12:02:14 2007 From: Pierre.DeWet at BITC.ORG.UK (Pierre DeWet) Date: Wed, 04 Apr 2007 11:02:14 +0100 Subject: [XML-SIG] XML-SIG Digest, Vol 48, Issue 2 (I'm out of the Office) Message-ID: From andrewdied at gmail.com Mon Apr 9 22:49:08 2007 From: andrewdied at gmail.com (Andrew Diederich) Date: Mon, 9 Apr 2007 14:49:08 -0600 Subject: [XML-SIG] Can't compile pyxml 0.8.4 with cygwin / windows Message-ID: <1810083971.20070409144908@gmail.com> I haven't been able to compile PyXML 0.8.4 for python 2.5 on my windows xp box, with a cygwin and mingw I just installed over the weekend. It looks like the compile is complaining about not finding things like io.h, which are installed in cygwin. On linux I'd use ldconfig and ld.so.conf, but that apparently isn't how cygwin works. I tried following the tutorial for Amara as described by this post http://mail.python.org/pipermail/xml-sig/2006-December/011626.html, but I haven't had any change in my errors. I basically get errors that start like this: In file included from c:/python25/include/Python.h:8, from extensions/pyexpat.c:5: c:/python25/include/pyconfig.h:57:16: io.h: No such file or directory c:/python25/include/pyconfig.h:251:20: stdio.h: No such file or directory In file included from /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/syslimits.h:7, from /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/limits.h:11, from c:/python25/include/Python.h:18, from extensions/pyexpat.c:5: /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/limits.h:122:61: limits.h: No such file or directory Does anyone have any tips for fixing this? My end goal is to be able to use ZSI 2.0 for some SOAP I need to interact with, but I haven't been able to get past the PyXML requirement for it yet. -- Best regards, Andrew Diederich From morillas at gmail.com Tue Apr 10 01:21:24 2007 From: morillas at gmail.com (Luis Miguel Morillas) Date: Tue, 10 Apr 2007 01:21:24 +0200 Subject: [XML-SIG] Can't compile pyxml 0.8.4 with cygwin / windows In-Reply-To: <1810083971.20070409144908@gmail.com> References: <1810083971.20070409144908@gmail.com> Message-ID: <68d25cbc0704091621h68c4f711l314bfeb20c1e7aa9@mail.gmail.com> Are you using cygwin or mingw? Did you declare the /bin path of mingw in the system PATH variable? 2007/4/9, Andrew Diederich : > I haven't been able to compile PyXML 0.8.4 for python 2.5 on my > windows xp box, with a cygwin and mingw I just installed over the > weekend. It looks like the compile is complaining about not finding > things like io.h, which are installed in cygwin. On linux I'd use > ldconfig and ld.so.conf, but that apparently isn't how cygwin works. > > I tried following the tutorial for Amara as described by this post > http://mail.python.org/pipermail/xml-sig/2006-December/011626.html, > but I haven't had any change in my errors. I basically get errors > that start like this: > > In file included from c:/python25/include/Python.h:8, > from extensions/pyexpat.c:5: > c:/python25/include/pyconfig.h:57:16: io.h: No such file or directory > c:/python25/include/pyconfig.h:251:20: stdio.h: No such file or directory > In file included from /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/syslimits.h:7, > from /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/limits.h:11, > from c:/python25/include/Python.h:18, > from extensions/pyexpat.c:5: > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/limits.h:122:61: limits.h: No such file or directory > > Does anyone have any tips for fixing this? My end goal is to be able > to use ZSI 2.0 for some SOAP I need to interact with, but I haven't > been able to get past the PyXML requirement for it yet. > > -- > Best regards, > Andrew Diederich > > _______________________________________________ > XML-SIG maillist - XML-SIG at python.org > http://mail.python.org/mailman/listinfo/xml-sig > -- Saludos, -- Luis Miguel From andrewdied at gmail.com Tue Apr 10 01:30:17 2007 From: andrewdied at gmail.com (Andrew Diederich) Date: Mon, 9 Apr 2007 17:30:17 -0600 Subject: [XML-SIG] Can't compile pyxml 0.8.4 with cygwin / windows In-Reply-To: <68d25cbc0704091621h68c4f711l314bfeb20c1e7aa9@mail.gmail.com> References: <1810083971.20070409144908@gmail.com> <68d25cbc0704091621h68c4f711l314bfeb20c1e7aa9@mail.gmail.com> Message-ID: <282281302.20070409173017@gmail.com> Hello Luis, On Monday, April 9, 2007, 5:21:24 PM, Luis Miguel Morillas wrote: > Are you using cygwin or mingw? Did you declare the /bin path of mingw > in the system PATH variable? I hadn't realized that there was a difference between the two -- cygwin had mingw packages, but since Windows is involved I wasn't surprised that mingw also had separate installers. I haven't adjusted my PATH at all in cygwin. I did change it for Windows like it says in http://livingpyxml.python-hosting.com/wiki/AmaraWindowsInstallTips. Oddly, I didn't change it on my python 2.4 windows box, but PyXML compiled there. -- Best regards, Andrew Diederich From morillas at gmail.com Wed Apr 11 12:31:07 2007 From: morillas at gmail.com (Luis Miguel Morillas) Date: Wed, 11 Apr 2007 12:31:07 +0200 Subject: [XML-SIG] Can't compile pyxml 0.8.4 with cygwin / windows In-Reply-To: <282281302.20070409173017@gmail.com> References: <1810083971.20070409144908@gmail.com> <68d25cbc0704091621h68c4f711l314bfeb20c1e7aa9@mail.gmail.com> <282281302.20070409173017@gmail.com> Message-ID: <68d25cbc0704110331p5936178dic41c74f4ac5b92d7@mail.gmail.com> I've built and uploaded http://platea.pntic.mec.es/~jmorilla/python/PyXML-0.8.4.win32-py2.5.exe Hope it'll be useful. I remember you that pyxml has no support. -- lm 2007/4/10, Andrew Diederich : > Hello Luis, > > On Monday, April 9, 2007, 5:21:24 PM, Luis Miguel Morillas wrote: > > > Are you using cygwin or mingw? Did you declare the /bin path of mingw > > in the system PATH variable? > > I hadn't realized that there was a difference between the two -- > cygwin had mingw packages, but since Windows is involved I wasn't > surprised that mingw also had separate installers. > > I haven't adjusted my PATH at all in cygwin. I did change it for > Windows like it says in > http://livingpyxml.python-hosting.com/wiki/AmaraWindowsInstallTips. > Oddly, I didn't change it on my python 2.4 windows box, but PyXML > compiled there. > > -- > Best regards, > Andrew Diederich > > _______________________________________________ > XML-SIG maillist - XML-SIG at python.org > http://mail.python.org/mailman/listinfo/xml-sig > -- Saludos, -- Luis Miguel From andrewdied at gmail.com Wed Apr 11 15:12:59 2007 From: andrewdied at gmail.com (Andrew Diederich) Date: Wed, 11 Apr 2007 07:12:59 -0600 Subject: [XML-SIG] Can't compile pyxml 0.8.4 with cygwin / windows In-Reply-To: <68d25cbc0704110331p5936178dic41c74f4ac5b92d7@mail.gmail.com> References: <1810083971.20070409144908@gmail.com> <68d25cbc0704091621h68c4f711l314bfeb20c1e7aa9@mail.gmail.com> <282281302.20070409173017@gmail.com> <68d25cbc0704110331p5936178dic41c74f4ac5b92d7@mail.gmail.com> Message-ID: <95b785820704110612r5a4b38b3n72fd46c1876f1e08@mail.gmail.com> On 4/11/07, Luis Miguel Morillas wrote: > I've built and uploaded > http://platea.pntic.mec.es/~jmorilla/python/PyXML-0.8.4.win32-py2.5.exe Luis, that did the trick! ZSI 2.0 still requires PyXML, which is the only reason I was still trying to build it for Python 2.5. Thanks for the help, it's much appreciated. -- Andrew Diederich From mike at skew.org Wed Apr 11 17:43:55 2007 From: mike at skew.org (Mike Brown) Date: Wed, 11 Apr 2007 09:43:55 -0600 (MDT) Subject: [XML-SIG] PyXML on AIX In-Reply-To: <20070331133410.36132.qmail@web23003.mail.ird.yahoo.com> Message-ID: <200704111543.l3BFhuRE000297@chilled.skew.org> John Dunn wrote: > I have been asked to install a python application on AIX 5.3 that runs OK on Windows > I have installed Python 4.2.2 from python.org and pyXML form > sourceforge. > > However when I run the application I get the following error : > > class xml.sax._exceptions.SAXReaderNotAvailable There should've been a more helpful message associated with that. In any case, it generally indicates a problem with PyExpat not being found, which seems strange because even if Python was built without it, PyXML would've installed it (wrapping Expat 1.95.7; PyXML isn't really maintained anymore). Python's should be in your python lib-dynload dir, e.g. on my FreeBSD system it's at /usr/local/lib/python2.4/lib-dynload/pyexpat.so. PyXML's should be at site-packages/_xmlplus/parsers/pyexpat.so. > Do I need to set some Python environment variables? Shouldn't, no. > Can I test the availibility of this from the python command line. e.g > import something? import xml.sax xml.sax.make_parser() You should get something like It's possible there's some kind of conflict between PyXML and Python but I'm guessing something else is wrong... unfortunately I'm not qualified to diagnose it further... From brendon at christian.net Sat Apr 14 13:00:19 2007 From: brendon at christian.net (Brendon Costa) Date: Sat, 14 Apr 2007 21:00:19 +1000 Subject: [XML-SIG] DOCTYPE problem loading XML file. Message-ID: <4620B443.4010906@christian.net> Hi all, I have a manual i am writing for a project I have been developing in docbook format. This manual contains "programlisting" nodes that show output generated from some scripts. I want to write a small application using python XML libraries that will load this docbook file and for each programlisting node with an id that starts with script_... i want to execute the script ... and replace the programlisting nodes value with the resulting output. Firstly does anyone know of an existing tool that could do this for me (I haven't been successful in finding one)? Otherwise i have been trying to create my own tool in python. The first stage which is loading the docbook XML file into python using the DOM parser. This is my first time dealing with python and XML. The code is so far VERY simple: import sys from xml.dom.ext.reader import Sax2 reader = Sax2.Reader() doc = reader.fromStream(sys.argv[1]) Running that using: python update_docbook.py manual.xml fails to load the manual.xml file. The XML file has a DOCTYPE. Now for my needs in modifying the document is don't care about the DOCTYPE, i just want to keep it intact as it is. Is there any way to tell the DOM parser that i don't care about the DOCTYPE? If this is not possible, following are the errors i get trying to load the docbook xml file. Firstly without a DTD available at all: ValueError: unknown url type: docbookx.dtd If i then copy across my DTD data into the current directory (DOCTYPE references a file in the current directory at the moment to avoid having to go to the internet all the time) it seems to find it as i would expect, but there are still other errors: xml.Sax._exceptions.SAXParseException: dbnotnx.mod:60:80: error in processing external entity reference and if i change the doctype back to the correct URL, i get the same error but: xml.Sax._exceptions.SAXParseException: http://www.oasis-open.org/docbook/xml/4.5/dbnotnx.mod:60:80: error in processing external entity reference So how would i go about loading this docbook xml file in python using DOM so i can then manipulate it? Would you recommend that i change to use a Sax parser and if so can it be used to ignore the DOCTYPE? Thanks for any info. Brendon. From morillas at gmail.com Sun Apr 15 19:25:26 2007 From: morillas at gmail.com (Luis Miguel Morillas) Date: Sun, 15 Apr 2007 19:25:26 +0200 Subject: [XML-SIG] DOCTYPE problem loading XML file. In-Reply-To: <4620B443.4010906@christian.net> References: <4620B443.4010906@christian.net> Message-ID: <68d25cbc0704151025w2756e67dm635a4c6e5c759d83@mail.gmail.com> 2007/4/14, Brendon Costa : > Hi all, > > I have a manual i am writing for a project I have been developing in > docbook format. This manual contains "programlisting" nodes that show > output generated from some scripts. > > I want to write a small application using python XML libraries that will > load this docbook file and for each programlisting node with an id that > starts with script_... i want to execute the script ... and replace the > programlisting nodes value with the resulting output. > > try this quick example (using amara lib): {{{ import sys import cStringIO import amara doc = amara.parse('doc.xml') fout_old = sys.stdout sys.stdout = cStringIO.StringIO() for pl in doc.xml_xpath(u'//programlisting[@id]'): if pl.id[:7]=='script_': exec(unicode(pl)) pl.xml_clear() pl.xml_append_fragment(sys.stdout.getvalue()) sys.stdout = fout_old print doc.xml() }}} > > Firstly does anyone know of an existing tool that could do this for me > (I haven't been successful in finding one)? > > > > > Otherwise i have been trying to create my own tool in python. The first > stage which is loading the docbook XML file into python using the DOM > parser. This is my first time dealing with python and XML. > > The code is so far VERY simple: > > import sys > from xml.dom.ext.reader import Sax2 > reader = Sax2.Reader() > doc = reader.fromStream(sys.argv[1]) > > Running that using: > python update_docbook.py manual.xml > > fails to load the manual.xml file. The XML file has a DOCTYPE. Now for > my needs in modifying the document is don't care about the DOCTYPE, i > just want to keep it intact as it is. Is there any way to tell the DOM > parser that i don't care about the DOCTYPE? > > > If this is not possible, following are the errors i get trying to load > the docbook xml file. > > Firstly without a DTD available at all: > ValueError: unknown url type: docbookx.dtd > > > If i then copy across my DTD data into the current directory (DOCTYPE > references a file in the current directory at the moment to avoid having > to go to the internet all the time) it seems to find it as i would > expect, but there are still other errors: > xml.Sax._exceptions.SAXParseException: dbnotnx.mod:60:80: error in > processing external entity reference > > and if i change the doctype back to the correct URL, i get the same > error but: > xml.Sax._exceptions.SAXParseException: > http://www.oasis-open.org/docbook/xml/4.5/dbnotnx.mod:60:80: error in > processing external entity reference > > > So how would i go about loading this docbook xml file in python using > DOM so i can then manipulate it? Would you recommend that i change to > use a Sax parser and if so can it be used to ignore the DOCTYPE? > > > Thanks for any info. > Brendon. > > > > _______________________________________________ > XML-SIG maillist - XML-SIG at python.org > http://mail.python.org/mailman/listinfo/xml-sig > -- Saludos, -- Luis Miguel From brendon at christian.net Mon Apr 16 00:27:16 2007 From: brendon at christian.net (Brendon Costa) Date: Mon, 16 Apr 2007 08:27:16 +1000 Subject: [XML-SIG] DOCTYPE problem loading XML file. In-Reply-To: <68d25cbc0704151025w2756e67dm635a4c6e5c759d83@mail.gmail.com> References: <4620B443.4010906@christian.net> <68d25cbc0704151025w2756e67dm635a4c6e5c759d83@mail.gmail.com> Message-ID: <4622A6C4.2050906@christian.net> Thanks that worked great (with a few minor modifications). The resulting script that achieved it for reference was: import sys import amara import commands doc = amara.parse(sys.argv[1]) for pl in doc.xml_xpath(u'//programlisting[@id]'): if pl.id[:7] == 'script_': value = commands.getoutput(unicode(pl.id[7:])) pl.xml_clear() pl.xml_append(unicode(value)) print doc.xml() Luis Miguel Morillas wrote: > 2007/4/14, Brendon Costa : >> Hi all, >> >> I have a manual i am writing for a project I have been developing in >> docbook format. This manual contains "programlisting" nodes that show >> output generated from some scripts. >> >> I want to write a small application using python XML libraries that will >> load this docbook file and for each programlisting node with an id that >> starts with script_... i want to execute the script ... and replace the >> programlisting nodes value with the resulting output. >> >> > try this quick example (using amara lib): > > {{{ > import sys > import cStringIO > import amara > doc = amara.parse('doc.xml') > > fout_old = sys.stdout > sys.stdout = cStringIO.StringIO() > for pl in doc.xml_xpath(u'//programlisting[@id]'): > if pl.id[:7]=='script_': > exec(unicode(pl)) > pl.xml_clear() > pl.xml_append_fragment(sys.stdout.getvalue()) > sys.stdout = fout_old > > print doc.xml() > }}} > > > >> >> Firstly does anyone know of an existing tool that could do this for me >> (I haven't been successful in finding one)? >> >> >> >> >> Otherwise i have been trying to create my own tool in python. The first >> stage which is loading the docbook XML file into python using the DOM >> parser. This is my first time dealing with python and XML. >> >> The code is so far VERY simple: >> >> import sys >> from xml.dom.ext.reader import Sax2 >> reader = Sax2.Reader() >> doc = reader.fromStream(sys.argv[1]) >> >> Running that using: >> python update_docbook.py manual.xml >> >> fails to load the manual.xml file. The XML file has a DOCTYPE. Now for >> my needs in modifying the document is don't care about the DOCTYPE, i >> just want to keep it intact as it is. Is there any way to tell the DOM >> parser that i don't care about the DOCTYPE? >> >> >> If this is not possible, following are the errors i get trying to load >> the docbook xml file. >> >> Firstly without a DTD available at all: >> ValueError: unknown url type: docbookx.dtd >> >> >> If i then copy across my DTD data into the current directory (DOCTYPE >> references a file in the current directory at the moment to avoid having >> to go to the internet all the time) it seems to find it as i would >> expect, but there are still other errors: >> xml.Sax._exceptions.SAXParseException: dbnotnx.mod:60:80: error in >> processing external entity reference >> >> and if i change the doctype back to the correct URL, i get the same >> error but: >> xml.Sax._exceptions.SAXParseException: >> http://www.oasis-open.org/docbook/xml/4.5/dbnotnx.mod:60:80: error in >> processing external entity reference >> >> >> So how would i go about loading this docbook xml file in python using >> DOM so i can then manipulate it? Would you recommend that i change to >> use a Sax parser and if so can it be used to ignore the DOCTYPE? >> >> >> Thanks for any info. >> Brendon. >> >> >> >> _______________________________________________ >> XML-SIG maillist - XML-SIG at python.org >> http://mail.python.org/mailman/listinfo/xml-sig >> > > From romeogasman at gmail.com Fri Apr 20 09:56:22 2007 From: romeogasman at gmail.com (Romeo Gasman) Date: Thu, 19 Apr 2007 21:56:22 -1000 Subject: [XML-SIG] Buy Vicodin online today, overnight shipping xyiz kccg v Message-ID: <9414630c0704200056q6d98e7e6w906648e757fd20bf@mail.gmail.com> 4-19-07 vicodon 750mg and soma350 call Rome at 808-393-8756 94-383 Iupika Pl. Mililani HI. 96789 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20070419/9edfdd4f/attachment.html From william.t.loging at pfizer.com Mon Apr 23 20:13:52 2007 From: william.t.loging at pfizer.com (Loging, William T) Date: Mon, 23 Apr 2007 14:13:52 -0400 Subject: [XML-SIG] Error on install Message-ID: Hello, I am installing PyXML on Python 2.4.3 [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-42)] on linux2, and I get the following error: [logingwt]# python setup.py install Traceback (most recent call last): File "setup.py", line 127, in ? config_h_vars = parse_config_h(open(config_h)) IOError: [Errno 2] No such file or directory: './pyconfig.h' Please let me know what issue I might be having. Thank you, William ---------------------------------------------------------------------- LEGAL NOTICE Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20070423/7bc0e067/attachment.html From arnaudsj at gmail.com Mon Apr 23 23:54:44 2007 From: arnaudsj at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Arnaud?=) Date: Mon, 23 Apr 2007 16:54:44 -0500 Subject: [XML-SIG] Python equivalent to Builder in Ruby? Message-ID: Hi, Just like any other dev on the block I took RoR for a test drive to see what the fuss was all about, but short of sharing my experience with it and what I liked or disliked about it, I wanted to know if there is a close equivalent to the RXML/Builder Ruby lib that saw the light under the RoR project: http://builder.rubyforge.org/ To me it is the best part of the Rails framework :), but I can't seem to find a simple and syntactically attractive module in python that achieves the same purpose. I posted below a quick naive example for those who are not familiar with ruby-builder lib. Thank you for any type of pointers! If I can't find anything then I might decide to start to write my own python based module on RXML/ Builder philosophy. Cheers! S?bastien TestBuilder.rb ============== require 'rubygems' require 'builder' xml = Builder::XmlMarkup.new(:target=>STDOUT, :indent=>2) xml.instruct! :"xml-stylesheet", :type=>"text/xsl", :href=>"/xsl/ mytext.xsl" xml.mytestdoc do xml.testing("Hello World!", :world=>"Escape me < > !!!") xml.person { |b| b.comment("Jim's dog is nice & friendly"); b.name ("Jim") } end Output ====== Hello World! Jim's dog is nice & friendly Jim From walter at livinglogic.de Tue Apr 24 01:10:28 2007 From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=) Date: Tue, 24 Apr 2007 01:10:28 +0200 Subject: [XML-SIG] Python equivalent to Builder in Ruby? In-Reply-To: References: Message-ID: <462D3CE4.4080001@livinglogic.de> S?bastien Arnaud wrote: > Hi, > > Just like any other dev on the block I took RoR for a test drive to > see what the fuss was all about, but short of sharing my experience > with it and what I liked or disliked about it, I wanted to know if > there is a close equivalent to the RXML/Builder Ruby lib that saw the > light under the RoR project: > http://builder.rubyforge.org/ > > To me it is the best part of the Rails framework :), but I can't seem > to find a simple and syntactically attractive module in python that > achieves the same purpose. I posted below a quick naive example for > those who are not familiar with ruby-builder lib. > > Thank you for any type of pointers! If I can't find anything then I > might decide to start to write my own python based module on RXML/ > Builder philosophy. Python options would by XIST, Stan and probably a few others. Servus, Walter > TestBuilder.rb > ============== > require 'rubygems' > require 'builder' > > xml = Builder::XmlMarkup.new(:target=>STDOUT, :indent=>2) > xml.instruct! :"xml-stylesheet", :type=>"text/xsl", :href=>"/xsl/ > mytext.xsl" > > xml.mytestdoc do > xml.testing("Hello World!", :world=>"Escape me < > !!!") > xml.person { |b| b.comment("Jim's dog is nice & friendly"); b.name > ("Jim") } > end > > Output > ====== > > > Hello World! > > Jim's dog is nice & friendly > Jim > > From jensuk at rock.com Tue Apr 24 13:36:38 2007 From: jensuk at rock.com (ronny sameh) Date: Tue, 24 Apr 2007 11:36:38 +0000 Subject: [XML-SIG] Visiting this list Meny Message-ID: <20070424113641.78AF3CA0A4@ws5-11.us4.outblaze.com> Hello Everyone -- You Rock! Your E-Mail Should Too! Signup Now at Rock.com and get 250MB of Storage! http://webmail.rock.com/signup/ From arnaudsj at gmail.com Wed Apr 25 03:47:30 2007 From: arnaudsj at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Arnaud?=) Date: Tue, 24 Apr 2007 20:47:30 -0500 Subject: [XML-SIG] Python equivalent to Builder in Ruby? In-Reply-To: <462D3CE4.4080001@livinglogic.de> References: <462D3CE4.4080001@livinglogic.de> Message-ID: <8C797C34-D688-4BF7-A4F7-D7C64C3DEA01@gmail.com> Thank you Walter for the pointers. Both look kind of heavy weight but I highly enjoyed discovering what they have to offer :) S?bastien On Apr 23, 2007, at 6:10 PM, Walter D?rwald wrote: > S?bastien Arnaud wrote: > >> Hi, >> Just like any other dev on the block I took RoR for a test drive >> to see what the fuss was all about, but short of sharing my >> experience with it and what I liked or disliked about it, I >> wanted to know if there is a close equivalent to the RXML/Builder >> Ruby lib that saw the light under the RoR project: >> http://builder.rubyforge.org/ >> To me it is the best part of the Rails framework :), but I can't >> seem to find a simple and syntactically attractive module in >> python that achieves the same purpose. I posted below a quick >> naive example for those who are not familiar with ruby-builder lib. >> Thank you for any type of pointers! If I can't find anything then >> I might decide to start to write my own python based module on >> RXML/ Builder philosophy. > > Python options would by XIST, Stan and probably a few others. > > Servus, > Walter > >> TestBuilder.rb >> ============== >> require 'rubygems' >> require 'builder' >> xml = Builder::XmlMarkup.new(:target=>STDOUT, :indent=>2) >> xml.instruct! :"xml-stylesheet", :type=>"text/xsl", :href=>"/xsl/ >> mytext.xsl" >> xml.mytestdoc do >> xml.testing("Hello World!", :world=>"Escape me < > !!!") >> xml.person { |b| b.comment("Jim's dog is nice & friendly"); >> b.name ("Jim") } >> end >> Output >> ====== >> >> >> Hello World! >> >> Jim's dog is nice & friendly >> Jim >> >> > From ah at hatzis.de Thu Apr 26 13:58:46 2007 From: ah at hatzis.de (Anastasios Hatzis) Date: Thu, 26 Apr 2007 13:58:46 +0200 Subject: [XML-SIG] XMI, MOF and UML Message-ID: <200704261358.46211.ah@hatzis.de> Hello! Have anyone of you already worked on XMI transformation? I'm going to re-engineer my lightweight MDA tool pyswarm SDK*), especially adding support of XMI formats of other UML tools. Currently the tool does only import XMI 2.1 files created with MagicDraw. It seems my plan means plenty of work, including UML and MOF implementations. So I wanted to know if someone in this list has experience with import/export of XMI files and mapping between different XMI versions and the UML or MOF versions they are representing. Best regards, Anastasios *) http://pyswarm.sourceforge.net/ From martin at v.loewis.de Sun Apr 29 20:25:53 2007 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Sun, 29 Apr 2007 20:25:53 +0200 Subject: [XML-SIG] XMI, MOF and UML In-Reply-To: <200704261358.46211.ah@hatzis.de> References: <200704261358.46211.ah@hatzis.de> Message-ID: <4634E331.80108@v.loewis.de> > Have anyone of you already worked on XMI transformation? I'm going to > re-engineer my lightweight MDA tool pyswarm SDK*), especially adding support > of XMI formats of other UML tools. Currently the tool does only import XMI > 2.1 files created with MagicDraw. It seems my plan means plenty of work, > including UML and MOF implementations. So I wanted to know if someone in this > list has experience with import/export of XMI files and mapping between > different XMI versions and the UML or MOF versions they are representing. Martin Karlsch (www.karlsch.org) has written a framework called Frodo, which includes XMI support. You should contact him about details. Regards, Martin From terry at jon.es Sat Apr 28 15:09:59 2007 From: terry at jon.es (Terry Jones) Date: Sat, 28 Apr 2007 15:09:59 +0200 Subject: [XML-SIG] Question about lxml and RELAX NG Message-ID: <17971.18343.824464.939803@terry-jones-computer.local> I'm trying to validate some XML, and I'd like to use RELAX NG. Looking around it seems that lxml may be the best way to go about this in Python. Is that a good choice? Other possibilities seem to be minixsv and XVIF, but these look less attractive (that's an uninformed quick impression - I'd be happy to be told I'm wrong). Although the documentation for using lxml is very simple and clear, I don't see an explanation of what parts of RELAX NG are supported. I get an error telling me my specification is not RELAX NG when I try to use a top-level element and also when I have two elements that refer to each other using (and IIRC also when I try to use ). Is there a description somewhere of what parts of RELAX NG are supported by lxml? I can provide detail of what I'm doing in case etc., actually are supported. If anyone has suggestions about better approaches to validating XML in python, please let me know. I've not done this before and so might be making bad/uninformed choices. The situation of python vis a vis XML validation seems a bit unclear, based on what I've tracked down via google. Thanks for any help, Terry Jones From hgg9140 at seanet.com Sun Apr 29 18:33:32 2007 From: hgg9140 at seanet.com (Harry George) Date: Sun, 29 Apr 2007 09:33:32 -0700 Subject: [XML-SIG] Question about lxml and RELAX NG In-Reply-To: <17971.18343.824464.939803@terry-jones-computer.local> References: <17971.18343.824464.939803@terry-jones-computer.local> Message-ID: <20070429093332.3c43c284@fred.site> libxml2, with its python binding is another possibility. I haven't tried it, but remember RelazNG is covered. On Sat, 28 Apr 2007 15:09:59 +0200 Terry Jones wrote: > I'm trying to validate some XML, and I'd like to use RELAX NG. Looking > around it seems that lxml may be the best way to go about this in > Python. > > Is that a good choice? Other possibilities seem to be minixsv and > XVIF, but these look less attractive (that's an uninformed quick > impression - I'd be happy to be told I'm wrong). > > Although the documentation for using lxml is very simple and clear, I > don't see an explanation of what parts of RELAX NG are supported. I > get an error telling me my specification is not RELAX NG when I try to > use a top-level element and also when I have two elements > that refer to each other using (and IIRC > also when I try to use ). > > Is there a description somewhere of what parts of RELAX NG are > supported by lxml? I can provide detail of what I'm doing in case > etc., actually are supported. > > If anyone has suggestions about better approaches to validating XML in > python, please let me know. I've not done this before and so might be > making bad/uninformed choices. The situation of python vis a vis XML > validation seems a bit unclear, based on what I've tracked down via > google. > > Thanks for any help, > Terry Jones > _______________________________________________ > XML-SIG maillist - XML-SIG at python.org > http://mail.python.org/mailman/listinfo/xml-sig -- Harry George hgg9140 at seanet.com www.seanet.com/~hgg9140 From andrewdied at gmail.com Mon Apr 30 21:34:32 2007 From: andrewdied at gmail.com (Andrew Diederich) Date: Mon, 30 Apr 2007 13:34:32 -0600 Subject: [XML-SIG] Python equivalent to Builder in Ruby? In-Reply-To: References: Message-ID: <1578794646.20070430133432@gmail.com> On Monday, April 23, 2007, 3:54:44 PM, S?bastien Arnaud wrote: > Just like any other dev on the block I took RoR for a test drive to > see what the fuss was all about, but short of sharing my experience > with it and what I liked or disliked about it, I wanted to know if > there is a close equivalent to the RXML/Builder Ruby lib that saw the > light under the RoR project: > http://builder.rubyforge.org/ > To me it is the best part of the Rails framework :), but I can't seem > to find a simple and syntactically attractive module in python that > achieves the same purpose. I posted below a quick naive example for > those who are not familiar with ruby-builder lib. If you're just comparing how attractive the syntax is, that sounds more like a python v. ruby discussion, rather than an XML-SIG discussion. Normally in the python world the goal is to be as pythonic as possible, which is, of course, beautiful in its own right. :) > Thank you for any type of pointers! If I can't find anything then I > might decide to start to write my own python based module on RXML/ > Builder philosophy. > Output > ====== > > > Hello World! > > Jim's dog is nice & friendly > Jim > > Since ElementTree is included in python 2.5, I'd always give that a shot, first: # use xml.etree.ElementTree for a pure python implementation import xml.etree.cElementTree as ET # Create the root element mytestdoc = ET.Element('mytestdoc') # Attributes can be created with dictionaries or keyword arguments # Add text with .text testing = ET.SubElement(mytestdoc, 'testing', {'world': 'Escape me < > !!!'}) testing.text = 'Hello World!' person = ET.SubElement(mytestdoc, 'person') # You can add text directly to new subnodes ET.SubElement(person, 'comment').text = "Jim's doc is nice & friendly" ET.SubElement(person, 'name').text = 'Jim' # For testing, dump out the text to stdout ET.dump(mytestdoc) # Or, you can write it to a file tree = ET.ElementTree(mytestdoc) tree.write(r'C:/temp/mytestdoc.xml') This gives you: Hello World!Jim's doc is nice & friendlyJim ElementTree doesn't put in the xsl-stylesheet line, and it doesn't prettyprint. http://effbot.org/zone/element-lib.htm has a short function for that. -- Best regards, Andrew Diederich