From noreply@sourceforge.net Wed Nov 1 12:49:37 2000
From: noreply@sourceforge.net (noreply@sourceforge.net)
Date: Wed, 1 Nov 2000 04:49:37 -0800
Subject: [XML-SIG] [Patch #102204] Make sgmlop case sensitive
Message-ID: <200011011249.EAA16134@sf-web3.vaspecialprojects.com>
Patch #102204 has been updated.
Project: pyxml
Category: None
Status: Open
Summary: Make sgmlop case sensitive
-------------------------------------------------------
For more info, visit:
http://sourceforge.net/patch/?func=detailpatch&patch_id=102204&group_id=6473
From martin@loewis.home.cs.tu-berlin.de Thu Nov 2 05:04:22 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Thu, 2 Nov 2000 06:04:22 +0100
Subject: [XML-SIG] Error in pyexpat docs
In-Reply-To: <200010291916.MAA16420@localhost.localdomain>
(uche.ogbuji@fourthought.com)
References: <200010291916.MAA16420@localhost.localdomain>
Message-ID: <200011020504.GAA00898@loewis.home.cs.tu-berlin.de>
> The wrong, "xml.parsers.expat" is the first indicator that there might be a
> problem, yet I took the docs at their word and wrapped the call to ParseFile
> in a blanket try/except, only to find that no exception of any sort is ever
> raised by ParseFile.
> It turns out that ParseFile actually returns 0 on error, returning 1
> otherwise.
> The first matter is that the code and the docs need to be reconciled.
> However, I would _much_ rather prefer that things were as in the docs.
Thanks for the report. What do you mean with 'the wrong,
"xml.parsers.expat"'? There really is an exception
xml.parsers.expat.error, and it really is raised from
xml.parsers.expat (aka pyexpat).
It turns out that it is only raised for Parse, not for ParseFile,
which is a bug introduced when the return value of these functions was
changed from a number to an exception. In the PyXML CVS, I have
corrected that error. As a result, PyXML 0.6.2 will build its own
pyexpat.c even for Python 2.0, which will implement the documentation.
Regards,
Martin
From ndw@nwalsh.com Thu Nov 2 14:18:50 2000
From: ndw@nwalsh.com (Norman Walsh)
Date: 02 Nov 2000 09:18:50 -0500
Subject: [XML-SIG] Help building XML-related Python RPM?
In-Reply-To: noreply@sourceforge.net's message of "Wed, 1 Nov 2000 04:49:37 -0800"
Message-ID: <87r94u5uet.fsf@nwalsh.com>
Ok, I admit this is somewhat off-topic, but I'm hoping you'll forgive
me. I'm trying to build a binary RPM for a Python XML package (the LT
XML[1] package from the HCRC Language Technology Group[2] which is
required in order to support the XSV Schema Validator[3], for the
curious).
The difficulty is that I have no experience building RPMs. I'm hoping
someone can send me a pointer to the "how to build an RPM"
documentation and an RPM that's sufficiently like the one I need to
build that I can steal most of what I need from it :-)
In a nutshell, what the package needs to install is
1. [/usr/local]/lib/ltxml12
2. [/usr/local]/include/ltxml12
3. [/usr/local]/bin/{some apps}
4. [/usr/local]/lib/python1.6/site-packages/PyLTXML
Where I presume the tricky bit in the RPM is figuring out if Python1.6
is installed (and what the other dependencies are) and what
[/usr/local] really should be.
Help?
Be seeing you,
norm
[1] http://www.ltg.ed.ac.uk/software/xml/index.html
[2] http://www.ltg.ed.ac.uk/
[3] http://dev.w3.org/cvsweb/xmlschema/
--
Norman Walsh | We dance around in a ring and suppose,
http://nwalsh.com/ | but the Secret sits in the middle and
| knows.--Robert Frost
From Nicolas.Chauvat@logilab.fr Thu Nov 2 14:37:15 2000
From: Nicolas.Chauvat@logilab.fr (Nicolas Chauvat)
Date: Thu, 2 Nov 2000 15:37:15 +0100 (CET)
Subject: [XML-SIG] Help building XML-related Python RPM?
In-Reply-To: <87r94u5uet.fsf@nwalsh.com>
Message-ID:
On 2 Nov 2000, Norman Walsh wrote:
> Ok, I admit this is somewhat off-topic, but I'm hoping you'll forgive
> me. I'm trying to build a binary RPM for a Python XML package (the LT
> ...
Did you try to use distutils ?
> The difficulty is that I have no experience building RPMs. I'm hoping
> someone can send me a pointer to the "how to build an RPM"
There is an RPM-HOWTO at
=09http://www.linuxdoc.org/HOWTO/RPM-HOWTO/index.html
It is not really up-to-date, nor is /usr/doc/rpm-x.y.z/*, but that's all
the documentation that is available. I wouldn't recommand using the
Maximum RPM book, as it is also outdated.
> documentation and an RPM that's sufficiently like the one I need to
> build that I can steal most of what I need from it :-)
>=20
> In a nutshell, what the package needs to install is
>=20
> 1. [/usr/local]/lib/ltxml12
> 2. [/usr/local]/include/ltxml12
> 3. [/usr/local]/bin/{some apps}
> 4. [/usr/local]/lib/python1.6/site-packages/PyLTXML
> Where I presume the tricky bit in the RPM is figuring out if Python1.6
> is installed (and what the other dependencies are) and what
> [/usr/local] really should be.
The end of /usr/doc/rpm-x.y.z/macros helps.
For example spec files, you can download any source rpm package, install
it and take a look at the spec file that got unpacked in
/usr/src/redhat/RPM/SPECS.
Feel free to mail me and continue this discussion off-line if you want.
--=20
Nicolas Chauvat
http://www.logilab.com - "Mais o=F9 est donc Ornicar ?" - LOGILAB, Paris (F=
rance)
From fdrake@acm.org Thu Nov 2 14:52:56 2000
From: fdrake@acm.org (Fred L. Drake, Jr.)
Date: Thu, 2 Nov 2000 09:52:56 -0500 (EST)
Subject: [XML-SIG] Help building XML-related Python RPM?
In-Reply-To: <87r94u5uet.fsf@nwalsh.com>
References: <87r94u5uet.fsf@nwalsh.com>
Message-ID: <14849.32712.791999.14981@cj42289-a.reston1.va.home.com>
Norman Walsh writes:
> Ok, I admit this is somewhat off-topic, but I'm hoping you'll forgive
> me. I'm trying to build a binary RPM for a Python XML package (the LT
> XML[1] package from the HCRC Language Technology Group[2] which is
> required in order to support the XSV Schema Validator[3], for the
> curious).
Norm,
My first reaction is "Why one RPM?" ... this sounds like it should
be two -- the LTXML package, and then the PyLTXML package. The
PyLTXML package should be a Distutils packge -- Distutils can build
an RPM for you.
Documentation on making Distutils packages is available at:
http://www.python.org/doc/current/dist/dist.html
You might also want to read the installer's documentation for
Distutils:
http://www.python.org/doc/current/inst/inst.html
-Fred
--
Fred L. Drake, Jr.
PythonLabs at Digital Creations
From china@thewrittenword.com Thu Nov 2 16:38:59 2000
From: china@thewrittenword.com (Albert Chin-A-Young)
Date: Thu, 2 Nov 2000 10:38:59 -0600
Subject: [XML-SIG] PyXML 0.6.1 and Solaris
Message-ID: <20001102103859.A13473@postal.il.thewrittenword.com>
Anyone have success using PyXML 0.6.1 and Solaris 2.6/SPARC? The problem
is the pyexpat module. The following code fails:
from xml.parsers import pyexpat
$ python
Python 2.0 (#1, Nov 1 2000, 13:16:57) [C] on sunos5
Type "copyright", "credits" or "license" for more information.
>>> from xml.parsers import pyexpat
>>> Traceback (most recent call last):
>>> File "", line 1, in ?
>>> ImportError: cannot import name pyexpat
>>>
There are no problems on HP-UX, IRIX, or Compaq Tru64 UNIX. I did a
truss on the process from IRIX and saw that
_xmlplus/parsers/pyexpat.so was being loaded (I didn't compile Python
2.0 with the pyexpat module). However, a truss from the Solaris 2.6
host above (2.7 and 8 also give the same error) does not show that
pyexpat.so is trying to be loaded. The files it tries are:
_xmlplus/parsers/pyexpat
_xmlplus/parsers/pyexpat.py
_xmlplus/parsers/pyexpat.pyc
Turnes out that the autoconf script to select the correct dynload_*.c
file is broken for Solaris. Patch below (submitted to SourceForge too).
--
albert chin (china@thewrittenword.com)
-- snip snip
--- configure.in.orig Wed Nov 1 10:17:25 2000
+++ configure.in Thu Nov 2 10:22:55 2000
@@ -936,10 +939,9 @@
*)
# use dynload_shlib.c and dlopen() if we have it; otherwise stub
# out any dynamic loading
- if test "$ac_cv_func_dlopen" = yes
- then DYNLOADFILE="dynload_shlib.o"
- else DYNLOADFILE="dynload_stub.o"
- fi
+ AC_CHECK_FUNC(dlopen, DYNLOADFILE="dynload_shlib.o",
+ AC_CHECK_LIB(dl, dlopen, DYNLOADFILE="dynload_shlib.o",
+ DYNLOADFILE="dynload_stub.o"))
;;
esac
fi
From chris@rpgarchive.com Thu Nov 2 23:50:06 2000
From: chris@rpgarchive.com (Chris Davis)
Date: Thu, 2 Nov 2000 17:50:06 -0600
Subject: [XML-SIG] unicode data
Message-ID:
Today I upgrade from python 1.5.2 to 2.0. Needless to say, I'm working
thought a few porting issues in my code. I noticed that after I create a
DOM, the string data (attributes, text nodes) are all Unicode instead of
strings. This is causing me a lot of problems, breaking function calls that
require strings. Is there a way to get a Dom with non Unicode strings?
Chris Davis
chris@rpgarchive.com
From martin@loewis.home.cs.tu-berlin.de Fri Nov 3 00:36:30 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Fri, 3 Nov 2000 01:36:30 +0100
Subject: [XML-SIG] Help building XML-related Python RPM?
In-Reply-To: <87r94u5uet.fsf@nwalsh.com> (message from Norman Walsh on 02 Nov
2000 09:18:50 -0500)
References: <87r94u5uet.fsf@nwalsh.com>
Message-ID: <200011030036.BAA00844@loewis.home.cs.tu-berlin.de>
> In a nutshell, what the package needs to install is
>
> 1. [/usr/local]/lib/ltxml12
> 2. [/usr/local]/include/ltxml12
> 3. [/usr/local]/bin/{some apps}
> 4. [/usr/local]/lib/python1.6/site-packages/PyLTXML
>
> Where I presume the tricky bit in the RPM is figuring out if Python1.6
> is installed (and what the other dependencies are) and what
> [/usr/local] really should be.
I believe the common "solution" to these problems is to ignore
them. Is RPM even capable to install files into a dynamically-computed
root directory?
Instead, it seems common to build an RPM on top of another one by just
knowing where that puts its files. I.e. you'd build an RPM for
BeOpen-something-2.0-rpm, and another one for
ActivePython-1.6-something.rpm. You place a depency between the two,
and when the required RPM is not there, rpm will just refuse to
install.
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Fri Nov 3 00:49:17 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Fri, 3 Nov 2000 01:49:17 +0100
Subject: [XML-SIG] unicode data
In-Reply-To:
References:
Message-ID: <200011030049.BAA00910@loewis.home.cs.tu-berlin.de>
> Today I upgrade from python 1.5.2 to 2.0. Needless to say, I'm working
> thought a few porting issues in my code. I noticed that after I create a
> DOM, the string data (attributes, text nodes) are all Unicode instead of
> strings. This is causing me a lot of problems, breaking function calls that
> require strings. Is there a way to get a Dom with non Unicode strings?
You'd need to use a driver that produces byte strings. I believe both
sgmlop and xmlproc will do at the moment (at least until they are
fixed to produce Unicode).
Out of curiosity: What specific problems are you encountering?
Regards,
Martin
From fdrake@acm.org Fri Nov 3 00:54:33 2000
From: fdrake@acm.org (Fred L. Drake, Jr.)
Date: Thu, 2 Nov 2000 19:54:33 -0500 (EST)
Subject: [XML-SIG] Help building XML-related Python RPM?
In-Reply-To: <200011030036.BAA00844@loewis.home.cs.tu-berlin.de>
References: <87r94u5uet.fsf@nwalsh.com>
<200011030036.BAA00844@loewis.home.cs.tu-berlin.de>
Message-ID: <14850.3273.711283.24489@cj42289-a.reston1.va.home.com>
Martin v. Loewis writes:
> I believe the common "solution" to these problems is to ignore
> them. Is RPM even capable to install files into a dynamically-computed
> root directory?
This depends on the packages. Some RPMs allow you to pass --prefix/
--exec-prefix options, and dependent packages should be installable by
passing the same values for those options. It does take more work to
create "relocatable" RPMs, and there are some constraints on them. I
don't remember the details well enough; it would take a bit of
digging.
I think splitting this into two packages, with the first being
RPM-based and the second Distutils based, makes more sense.
-Fred
--
Fred L. Drake, Jr.
PythonLabs at Digital Creations
From dwallace@delanet.com Fri Nov 3 01:58:49 2000
From: dwallace@delanet.com (Dave)
Date: Thu, 02 Nov 2000 20:58:49 -0500
Subject: [XML-SIG] unicode data
References: <200011030049.BAA00910@loewis.home.cs.tu-berlin.de>
Message-ID: <3A021BD9.7030703@delanet.com>
I see this in the DOM CharacterData.py where a few places throw
exceptions :
if data != None and type(data) != type(''):
raise DOMException(SYNTAX_ERR)
Dave.
Martin v. Loewis wrote:
>> Today I upgrade from python 1.5.2 to 2.0. Needless to say, I'm working
>> thought a few porting issues in my code. I noticed that after I create a
>> DOM, the string data (attributes, text nodes) are all Unicode instead of
>> strings. This is causing me a lot of problems, breaking function calls that
>> require strings. Is there a way to get a Dom with non Unicode strings?
>
>
> You'd need to use a driver that produces byte strings. I believe both
> sgmlop and xmlproc will do at the moment (at least until they are
> fixed to produce Unicode).
>
> Out of curiosity: What specific problems are you encountering?
>
> Regards,
> Martin
>
>
> _______________________________________________
> XML-SIG maillist - XML-SIG@python.org
> http://www.python.org/mailman/listinfo/xml-sig
From chris@rpgarchive.com Sat Nov 4 11:53:42 2000
From: chris@rpgarchive.com (chris)
Date: Sat, 04 Nov 2000 05:53:42 -0600
Subject: [XML-SIG] unicode data
References: <200011030049.BAA00910@loewis.home.cs.tu-berlin.de>
Message-ID: <3A03F8C6.60848AE8@rpgarchive.com>
I have an wxPython application that stores configuration info and meta
data in xml. I hold this xml data in a dom for easy use. I pass a lot
of data to wxPython functions calls that require string types. Now all
those calls (a lot) raise a TypError.
How do I use a different driver? This is how I get my dom:
from xml.dom.ext.reader import Sax
doc = Sax.FromXml(s,ownerDocument)
"Martin v. Loewis" wrote:
>
> > Today I upgrade from python 1.5.2 to 2.0. Needless to say, I'm working
> > thought a few porting issues in my code. I noticed that after I create a
> > DOM, the string data (attributes, text nodes) are all Unicode instead of
> > strings. This is causing me a lot of problems, breaking function calls that
> > require strings. Is there a way to get a Dom with non Unicode strings?
>
> You'd need to use a driver that produces byte strings. I believe both
> sgmlop and xmlproc will do at the moment (at least until they are
> fixed to produce Unicode).
>
> Out of curiosity: What specific problems are you encountering?
>
> Regards,
> Martin
>
> _______________________________________________
> XML-SIG maillist - XML-SIG@python.org
> http://www.python.org/mailman/listinfo/xml-sig
--
chris davis
chris@rpgarchive.com
http://www.rpgarchive.com
news and adventure database!
http://www.openrpg.com
open source role playing!
From martin@loewis.home.cs.tu-berlin.de Fri Nov 3 09:12:59 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Fri, 3 Nov 2000 10:12:59 +0100
Subject: [XML-SIG] unicode data
In-Reply-To: <3A021BD9.7030703@delanet.com> (message from Dave on Thu, 02 Nov
2000 20:58:49 -0500)
References: <200011030049.BAA00910@loewis.home.cs.tu-berlin.de> <3A021BD9.7030703@delanet.com>
Message-ID: <200011030912.KAA00905@loewis.home.cs.tu-berlin.de>
> I see this in the DOM CharacterData.py where a few places throw
> exceptions :
>
> if data != None and type(data) != type(''):
> raise DOMException(SYNTAX_ERR)
That, of course, is a bug in 4DOM. Can you please try the patch below?
I'll include that also in PyXML 0.6.2 (although I do hope there will
be an update from 4Thought, yet).
Regards,
Martin
Index: CharacterData.py
===================================================================
RCS file: /cvsroot/pyxml/xml/xml/dom/CharacterData.py,v
retrieving revision 1.4
diff -u -r1.4 CharacterData.py
--- CharacterData.py 2000/10/02 17:57:43 1.4
+++ CharacterData.py 2000/11/03 09:07:30
@@ -21,6 +21,12 @@
INDEX_SIZE_ERR = dom.INDEX_SIZE_ERR
SYNTAX_ERR = dom.SYNTAX_ERR
+import types
+try:
+ _StringTypes = [types.StringType, types.UnicodeType]
+except AttributeError:
+ _StringTypes = [types.StringType]
+
class CharacterData(Node):
def __init__(self, ownerDocument, data):
Node.__init__(self, ownerDocument, '', '', '')
@@ -33,7 +39,7 @@
return self.__dict__['__nodeValue']
def _set_data(self, data):
- if data != None and type(data) != type(''):
+ if data != None and type(data) not in _StringTypes:
raise DOMException(SYNTAX_ERR)
self.__dict__['__nodeValue'] = data
self.__dict__['__length'] = len(data)
@@ -49,13 +55,13 @@
return self.data[int(offset):int(offset+count)]
def appendData(self, arg):
- if type(arg) != type(''):
+ if type(arg) not in _StringTypes:
raise DOMException(SYNTAX_ERR)
self._set_data(self.data + arg)
return
def insertData(self, offset, arg):
- if type(arg) != type(''):
+ if type(arg) not in _StringTypes:
raise DOMException(SYNTAX_ERR)
if offset < 0 or offset >= self.__dict__['__length']:
raise DOMException(INDEX_SIZE_ERR)
@@ -72,7 +78,7 @@
return
def replaceData(self, offset, count, arg):
- if type(arg) != type(''):
+ if type(arg) not in _StringTypes:
raise DOMException(SYNTAX_ERR)
#Really a delete, then an insert
self.deleteData(offset, count)
From martin@loewis.home.cs.tu-berlin.de Fri Nov 3 09:30:08 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Fri, 3 Nov 2000 10:30:08 +0100
Subject: [XML-SIG] unicode data
In-Reply-To: <3A03F8C6.60848AE8@rpgarchive.com> (message from chris on Sat, 04
Nov 2000 05:53:42 -0600)
References: <200011030049.BAA00910@loewis.home.cs.tu-berlin.de> <3A03F8C6.60848AE8@rpgarchive.com>
Message-ID: <200011030930.KAA01045@loewis.home.cs.tu-berlin.de>
> I have an wxPython application that stores configuration info and meta
> data in xml. I hold this xml data in a dom for easy use. I pass a lot
> of data to wxPython functions calls that require string types. Now all
> those calls (a lot) raise a TypError.
I see. It would be possible to wrap all data with str(), but that is
probably not an acceptable solution; in the long run, wxPython should
be taught to accept Unicode objects (one primary reason to introduce
Unicode is to display it to the user, after all).
> How do I use a different driver? This is how I get my dom:
>
> from xml.dom.ext.reader import Sax
> doc = Sax.FromXml(s,ownerDocument)
Good question, with no satisfying answer, at the moment. I envision an
API where you say
from xml.dom.saxexts import make_parser
p = parser.make_parser("xml.sax.drivers.drv_sgmlop") # that works today
doc = Sax.FromXml(s,ownerDocument,parser=p)
The last part doesn't work, yet - please try the patch I've attached
below; I'd like to ship that with 0.6.2 unless I get an update of 4DOM
that solves this in a different way.
With 0.6.1, your only option is to set the environment variable
PY_SAX_PARSER to xml.sax.drivers.drv_sgmlop.
Regards,
Martin
Index: Sax.py
===================================================================
RCS file: /cvsroot/pyxml/xml/xml/dom/ext/reader/Sax.py,v
retrieving revision 1.4
diff -u -r1.4 Sax.py
--- Sax.py 2000/10/02 17:57:44 1.4
+++ Sax.py 2000/11/03 09:25:17
@@ -116,9 +116,10 @@
validate=0,
keepAllWs=0,
catName=None,
- saxHandlerClass=XmlDomGenerator):
+ saxHandlerClass=XmlDomGenerator,
+ parser = None):
#Create an XML DOM from SAX events
- parser = (validate and saxexts.XMLValParserFactory.make_parser()) or saxexts.XMLParserFactory.make_parser()
+ parser = parser or (validate and saxexts.XMLValParserFactory.make_parser()) or saxexts.XMLParserFactory.make_parser()
if catName:
#set up the catalog, if there is one
from xml.parsers.xmlproc import catalog
@@ -137,9 +138,10 @@
validate=0,
keepAllWs=0,
catName=None,
- saxHandlerClass=XmlDomGenerator):
+ saxHandlerClass=XmlDomGenerator,
+ parser=None):
fp = cStringIO.StringIO(str)
- rv = FromXmlStream(fp,ownerDocument,validate,keepAllWs,catName,saxHandlerClass)
+ rv = FromXmlStream(fp,ownerDocument,validate,keepAllWs,catName,saxHandlerClass,parser)
return rv
def FromXmlFile(fileName,
@@ -147,9 +149,10 @@
validate=0,
keepAllWs=0,
catName=None,
- saxHandlerClass=XmlDomGenerator):
+ saxHandlerClass=XmlDomGenerator,
+ parser=None):
fp = open(fileName, 'r')
- rv = FromXmlStream(fp,ownerDocument,validate,keepAllWs,catName,saxHandlerClass)
+ rv = FromXmlStream(fp,ownerDocument,validate,keepAllWs,catName,saxHandlerClass,parser)
fp.close()
return rv
@@ -158,10 +161,11 @@
validate=0,
keepAllWs=0,
catName=None,
- saxHandlerClass=XmlDomGenerator):
+ saxHandlerClass=XmlDomGenerator,
+ parser=None):
import urllib
fp = urllib.urlopen(url)
- rv = FromXmlStream(fp,ownerDocument,validate,keepAllWs,catName,saxHandlerClass)
+ rv = FromXmlStream(fp,ownerDocument,validate,keepAllWs,catName,saxHandlerClass,parser)
fp.close()
return rv
From Alexandre.Fayolle@logilab.fr Fri Nov 3 09:50:21 2000
From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle)
Date: Fri, 3 Nov 2000 10:50:21 +0100 (CET)
Subject: [XML-SIG] SIG page outdated
Message-ID:
Hi there, I just noticed that the SIG page on python.org is outdated:
http://www.python.org/topics/xml/download.html gives 0.5.5.1 as the latest
release candidate.
Alexandre Fayolle
--
http://www.logilab.com
Narval is the first software agent available as free software (GPL).
LOGILAB, Paris (France).
From sahrens@uv.ruhr-uni-bochum.de Fri Nov 3 15:32:12 2000
From: sahrens@uv.ruhr-uni-bochum.de (sa)
Date: Fri, 03 Nov 2000 16:32:12 +0100
Subject: [XML-SIG] need some help...
Message-ID: <3A02DA7B.3E3FBC4F@uv.ruhr-uni-bochum.de>
--------------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
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--
From Alexandre.Fayolle@logilab.fr Fri Nov 3 15:54:25 2000
From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle)
Date: Fri, 3 Nov 2000 16:54:25 +0100 (CET)
Subject: [XML-SIG] need some help...
In-Reply-To: <3A02DA7B.3E3FBC4F@uv.ruhr-uni-bochum.de>
Message-ID:
The doc is slightly outdated. I think that more up to date stuff can be
found somewhere on sourceforge, since PyXml has moved there.
As for creating DOMs, you can do the following:
from xml.dom.ext.reader import Sax2
d1 = Sax2.FromXml('put your XML code here')
d2 = Sax2.FromXmlFile('/tmp/file.xml')
I'm not a sax specialist, but if you have questions about the DOM api in
PyXml, I'll be glad to answer. In the meanwhile, you may want to check
http://www.fourthought.com : it's their implementation of DOM that's used
in PyXml, but these guys have something called 4Suite which adds XPath and
XSLT to DOM, and this roars.
Alexandre Fayolle
--
http://www.logilab.com
Narval is the first software agent available as free software (GPL).
LOGILAB, Paris (France).
From uche.ogbuji@fourthought.com Fri Nov 3 16:21:35 2000
From: uche.ogbuji@fourthought.com (Uche Ogbuji)
Date: Fri, 03 Nov 2000 09:21:35 -0700
Subject: [4suite] Re: [XML-SIG] unicode data
References: <200011030049.BAA00910@loewis.home.cs.tu-berlin.de> <3A03F8C6.60848AE8@rpgarchive.com> <200011030930.KAA01045@loewis.home.cs.tu-berlin.de>
Message-ID: <3A02E60F.1322F4B5@fourthought.com>
"Martin v. Loewis" wrote:
> > How do I use a different driver? This is how I get my dom:
> >
> > from xml.dom.ext.reader import Sax
> > doc = Sax.FromXml(s,ownerDocument)
>
> Good question, with no satisfying answer, at the moment. I envision an
> API where you say
>
> from xml.dom.saxexts import make_parser
> p = parser.make_parser("xml.sax.drivers.drv_sgmlop") # that works today
> doc = Sax.FromXml(s,ownerDocument,parser=p)
>
> The last part doesn't work, yet - please try the patch I've attached
> below; I'd like to ship that with 0.6.2 unless I get an update of 4DOM
> that solves this in a different way.
>
> With 0.6.1, your only option is to set the environment variable
> PY_SAX_PARSER to xml.sax.drivers.drv_sgmlop.
Martin is kindly not pointing out that I promised to do this and never
got around to it. Thanks, Martin. We'll apply the patch with some
mods.
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From chris@rpgarchive.com Fri Nov 3 16:48:39 2000
From: chris@rpgarchive.com (chris davis)
Date: Fri, 03 Nov 2000 10:48:39 -0600
Subject: [XML-SIG] unicode data
References: <200011030049.BAA00910@loewis.home.cs.tu-berlin.de> <3A03F8C6.60848AE8@rpgarchive.com> <200011030930.KAA01045@loewis.home.cs.tu-berlin.de>
Message-ID: <3A02EC67.B5446DA2@rpgarchive.com>
Thanks for the help. In an earlier email you wrote:
"You'd need to use a driver that produces byte strings. I believe both
sgmlop and xmlproc will do at the moment (at least until they are
fixed to produce Unicode)."
Does that mean this solution will only work until those drivers are
updated?
Thanks
chris
"Martin v. Loewis" wrote:
>
> > I have an wxPython application that stores configuration info and meta
> > data in xml. I hold this xml data in a dom for easy use. I pass a lot
> > of data to wxPython functions calls that require string types. Now all
> > those calls (a lot) raise a TypError.
>
> I see. It would be possible to wrap all data with str(), but that is
> probably not an acceptable solution; in the long run, wxPython should
> be taught to accept Unicode objects (one primary reason to introduce
> Unicode is to display it to the user, after all).
>
> > How do I use a different driver? This is how I get my dom:
> >
> > from xml.dom.ext.reader import Sax
> > doc = Sax.FromXml(s,ownerDocument)
>
> Good question, with no satisfying answer, at the moment. I envision an
> API where you say
>
> from xml.dom.saxexts import make_parser
> p = parser.make_parser("xml.sax.drivers.drv_sgmlop") # that works today
> doc = Sax.FromXml(s,ownerDocument,parser=p)
>
> The last part doesn't work, yet - please try the patch I've attached
> below; I'd like to ship that with 0.6.2 unless I get an update of 4DOM
> that solves this in a different way.
>
> With 0.6.1, your only option is to set the environment variable
> PY_SAX_PARSER to xml.sax.drivers.drv_sgmlop.
>
> Regards,
> Martin
>
> Index: Sax.py
> ===================================================================
> RCS file: /cvsroot/pyxml/xml/xml/dom/ext/reader/Sax.py,v
> retrieving revision 1.4
> diff -u -r1.4 Sax.py
> --- Sax.py 2000/10/02 17:57:44 1.4
> +++ Sax.py 2000/11/03 09:25:17
> @@ -116,9 +116,10 @@
> validate=0,
> keepAllWs=0,
> catName=None,
> - saxHandlerClass=XmlDomGenerator):
> + saxHandlerClass=XmlDomGenerator,
> + parser = None):
> #Create an XML DOM from SAX events
> - parser = (validate and saxexts.XMLValParserFactory.make_parser()) or saxexts.XMLParserFactory.make_parser()
> + parser = parser or (validate and saxexts.XMLValParserFactory.make_parser()) or saxexts.XMLParserFactory.make_parser()
> if catName:
> #set up the catalog, if there is one
> from xml.parsers.xmlproc import catalog
> @@ -137,9 +138,10 @@
> validate=0,
> keepAllWs=0,
> catName=None,
> - saxHandlerClass=XmlDomGenerator):
> + saxHandlerClass=XmlDomGenerator,
> + parser=None):
> fp = cStringIO.StringIO(str)
> - rv = FromXmlStream(fp,ownerDocument,validate,keepAllWs,catName,saxHandlerClass)
> + rv = FromXmlStream(fp,ownerDocument,validate,keepAllWs,catName,saxHandlerClass,parser)
> return rv
>
> def FromXmlFile(fileName,
> @@ -147,9 +149,10 @@
> validate=0,
> keepAllWs=0,
> catName=None,
> - saxHandlerClass=XmlDomGenerator):
> + saxHandlerClass=XmlDomGenerator,
> + parser=None):
> fp = open(fileName, 'r')
> - rv = FromXmlStream(fp,ownerDocument,validate,keepAllWs,catName,saxHandlerClass)
> + rv = FromXmlStream(fp,ownerDocument,validate,keepAllWs,catName,saxHandlerClass,parser)
> fp.close()
> return rv
>
> @@ -158,10 +161,11 @@
> validate=0,
> keepAllWs=0,
> catName=None,
> - saxHandlerClass=XmlDomGenerator):
> + saxHandlerClass=XmlDomGenerator,
> + parser=None):
> import urllib
> fp = urllib.urlopen(url)
> - rv = FromXmlStream(fp,ownerDocument,validate,keepAllWs,catName,saxHandlerClass)
> + rv = FromXmlStream(fp,ownerDocument,validate,keepAllWs,catName,saxHandlerClass,parser)
> fp.close()
> return rv
>
From Alexandre.Fayolle@logilab.fr Fri Nov 3 16:57:35 2000
From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle)
Date: Fri, 3 Nov 2000 17:57:35 +0100 (CET)
Subject: [XML-SIG] unicode data
In-Reply-To: <3A02EC67.B5446DA2@rpgarchive.com>
Message-ID:
On Fri, 3 Nov 2000, chris davis wrote:
> Thanks for the help. In an earlier email you wrote:
>
> "You'd need to use a driver that produces byte strings. I believe both
> sgmlop and xmlproc will do at the moment (at least until they are
> fixed to produce Unicode)."
>
> Does that mean this solution will only work until those drivers are
> updated?
It means that the DOM spec specifies that the CharacterData holds its data
in a DOMstring type, and adds :
"Applications must encode DOMString using UTF-16 (defined in [Unicode] and
Amendment 1 of [ISO/IEC 10646])"
Using an interface not called DOMstring is allowed by the spec, as long as
the encoding is UTF-16.
This implies that 4DOM is not compliant when used with Python 1.5.2.
Alexandre Fayolle
--
http://www.logilab.com
Narval is the first software agent available as free software (GPL).
LOGILAB, Paris (France).
From akuchlin@mems-exchange.org Fri Nov 3 19:57:59 2000
From: akuchlin@mems-exchange.org (Andrew Kuchling)
Date: Fri, 3 Nov 2000 14:57:59 -0500
Subject: [XML-SIG] SIG page outdated
In-Reply-To: ; from Alexandre.Fayolle@logilab.fr on Fri, Nov 03, 2000 at 10:50:21AM +0100
References:
Message-ID: <20001103145759.A24483@kronos.cnri.reston.va.us>
On Fri, Nov 03, 2000 at 10:50:21AM +0100, Alexandre Fayolle wrote:
>Hi there, I just noticed that the SIG page on python.org is outdated:
>http://www.python.org/topics/xml/download.html gives 0.5.5.1 as the latest
>release candidate.
I've added a redirection from /topics/xml/ to the new (and up-to-date)
pages on pyxml.sourceforge.net.
--amk
From akuchlin@mems-exchange.org Fri Nov 3 20:02:56 2000
From: akuchlin@mems-exchange.org (Andrew Kuchling)
Date: Fri, 3 Nov 2000 15:02:56 -0500
Subject: [XML-SIG] need some help...
In-Reply-To: <3A02DA7B.3E3FBC4F@uv.ruhr-uni-bochum.de>; from sahrens@uv.ruhr-uni-bochum.de on Fri, Nov 03, 2000 at 04:32:12PM +0100
References: <3A02DA7B.3E3FBC4F@uv.ruhr-uni-bochum.de>
Message-ID: <20001103150256.B24483@kronos.cnri.reston.va.us>
On Fri, Nov 03, 2000 at 04:32:12PM +0100, sa wrote:
>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
Because the documentation on www.python.org was far out of date. I've
updated the copies of the HOWTOs on python.org, but they should really
be kept on the SourceForge site. I'll work on that this weekend.
--amk
From uche.ogbuji@fourthought.com Fri Nov 3 23:55:26 2000
From: uche.ogbuji@fourthought.com (uche.ogbuji@fourthought.com)
Date: Fri, 03 Nov 2000 16:55:26 -0700
Subject: [XML-SIG] unicode data
In-Reply-To: Message from Dave
of "Thu, 02 Nov 2000 20:58:49 EST." <3A021BD9.7030703@delanet.com>
Message-ID: <200011032355.QAA14678@localhost.localdomain>
> I see this in the DOM CharacterData.py where a few places throw
> exceptions :
>
> if data != None and type(data) != type(''):
> raise DOMException(SYNTAX_ERR)
Ooh! nasty! We'll fix that. Thanks.
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From martin@loewis.home.cs.tu-berlin.de Sat Nov 4 01:08:36 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Sat, 4 Nov 2000 02:08:36 +0100
Subject: [XML-SIG] unicode data
In-Reply-To: <3A02E9BB.9F3980AE@rpgarchive.com> (message from chris davis on
Fri, 03 Nov 2000 10:37:15 -0600)
References: <200011030049.BAA00910@loewis.home.cs.tu-berlin.de> <3A03F8C6.60848AE8@rpgarchive.com> <200011030930.KAA01045@loewis.home.cs.tu-berlin.de> <3A02E9BB.9F3980AE@rpgarchive.com>
Message-ID: <200011040108.CAA00949@loewis.home.cs.tu-berlin.de>
> Does that mean this solution will only work until those drivers are
> updated?
Exactly, yes. The DOM specification clearly says that the type
DOMString must correspond to some Unicode two-byte data type. By
putting plain strings into a DOM tree, we violate both the spirit of
XML and of DOM.
I expect updates to xmlproc to happen soon (perhaps this year) since
Lars is interested in supporting Unicode. I doubt anybody will change
sgmlop, or xmllib (which all operate on byte strings still).
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Sat Nov 4 01:26:19 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Sat, 4 Nov 2000 02:26:19 +0100
Subject: [XML-SIG] SIG page outdated
In-Reply-To: <20001103145759.A24483@kronos.cnri.reston.va.us> (message from
Andrew Kuchling on Fri, 3 Nov 2000 14:57:59 -0500)
References: <20001103145759.A24483@kronos.cnri.reston.va.us>
Message-ID: <200011040126.CAA01091@loewis.home.cs.tu-berlin.de>
> I've added a redirection from /topics/xml/ to the new (and up-to-date)
> pages on pyxml.sourceforge.net.
Thanks! I don't think there was an official announcement, yet, so here
it goes:
The Python XML topic guide is now hosted on SourceForge. That means
that the pages are under control of CVS, with a module name of "www",
and thus accessible through
http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/www/?cvsroot=pyxml
Everybody is encouraged to send comments and patches (or to commit new
contents yourself). Please note that this tree uses Barry Warsaw's
ht2html, so the tree has to be regenerated every time a document is
modified. Currently, a cron job does this every six hours; if you need
an earlier update, invoke "doupdate" yourself.
If somebody can tell me how to initiate doupdate run on the machine
hosting pyxml.sourceforge.net from the machine that hosts the CVS
repository, please let me know. I've played with CVSROOT/loginfo
somewhat just to find out that the cvs machine doesn't nfsmount the
web server...
Regards,
Martin
From fredrik@effbot.org Sat Nov 4 18:40:10 2000
From: fredrik@effbot.org (Fredrik Lundh)
Date: Sat, 4 Nov 2000 19:40:10 +0100
Subject: [XML-SIG] unicode data
References: <20001104170114.C56E51D117@dinsdale.python.org>
Message-ID: <001f01c0468e$aa580750$3c6340d5@hagrid>
Martin wrote:
> I expect updates to xmlproc to happen soon (perhaps this year) since
> Lars is interested in supporting Unicode. I doubt anybody will change
> sgmlop, or xmllib (which all operate on byte strings still).
xmllib in 2.0 handles unicode just fine -- but you have to decode
the data yourself before passing it to the parser...
sgmlop did handle unicode in a similar fashion, but last-minute
changes to 2.0's unicode support broke the current version. this
will be fixed soon.
From uche.ogbuji@fourthought.com Sun Nov 5 17:46:13 2000
From: uche.ogbuji@fourthought.com (Uche Ogbuji)
Date: Sun, 05 Nov 2000 10:46:13 -0700
Subject: [XML-SIG] New Reader Architecture
Message-ID: <3A059CE5.90692504@fourthought.com>
We have rewitten most of the code used for creating text from DOMs.
I've cc'ed xml-sig because the check-ins of 4DOM I'll be making today
reflect these changes.
All the changes described here are intended for the 4Suite 0.9.2 release
but are reflected in the CVS snapshot I just put up today.
I won't go over much of the legacy except as it occurs in 4DOM. In the
past, to read, you would do as follows:
from xml.dom.ext.reader import Sax2
xml_dom_object = Sax2.FromXml(text)
or
from xml.dom.ext.reader import HtmlLib
html_dom_object = Sax2.FromHtml(text)
This worked well for a while, and this interface will still be supported
although it is now deprecated. The problem is that as other parts of
4Suite evolved various DOM subsets to deal with footprint and
performance problems, it was becoming nearly impossible to properly
parameterize the particular type of DOM in use for, say XSLT processing.
Finally, when we added XPointer we had to find a way to allow it return
a type of DOM according to user configuration, so that, say if you
pointed 4XPointer at
http://xslt.fourthought.com/docbook_html1.xslt#xpointer(/*/*[3])
Some users could choose to get back 4DOM representing the document
sub-set while the code that implements the document() function in XSLT
would be able to match the returned type of DOM to the one in the
original source document (say cDomlette or pDomlette).
The solution I came up with for parameterizing DOM types like this was
to create at least one reader class for each DOM type. This Reader
class is responsible for parsing and releasing nodes, and could hold any
global state for a group of DOM subtrees (say the collection of source
documents used in XSLT). cDomlette, which is only designed to work at
low-level with Expat, has only the RawExpatReaader class, but pDomlette
has a PyExpatReader and SaxReader class. 4DOM has the usual assortment
of classes: Sax, Sax2, HtmlLib, but I have added a PyExpat reader there
as well.
Using one of the new reader classes is also simple. You create an
instance passing in to the constructor any parameters relevant to the
state of that class. For instance, Sax reader classes support
validation and so you can pass a validate flag to the initializer of
each instance of such classes:
from xml.dom.ext.reader import Sax2
reader = Sax2.Reader(validate=1)
or
from Ft.Lib.pDomlette import SaxReader
reader = SaxReader(validate=1)
However, Expat supports no validation so there is no such initializer
argument in the specialized expat readers:
from xml.dom.ext.reader import PyExpat
reader = PyExpat.Reader()
or
from Ft.Lib.pDomlette import PyExpatReader
reader = PyExpatReader()
The initializer parameters are used for all reading (unless changed
through direct attribute manipulation), so if you are using Sax you
might want to have multiple reader instances in your code. One for
validating parses and one for non-validating parsers.
[Note that you can now directly specify the desired parser in any SAX
reader.]
Once you have the reader instance, you use the fromStream or fromUri
method to create each DOM. The equivalents to the other common utility
reader functions (say fromString or fromFile) have been eliminated for
simplicity since it is trivial to turn text or a filename into a
stream. fromUri was provided because 4Suite now supports URI handlers
and the conversion from URI to stream might not be as straightforward as
using Python's urllib.
fromStream accepts a stream object as its first parameter and an
optional ownerdocument as its second. If the ownerdocument is given,
the return from the method will be a DocumentFragment instance,
otherwise it will be a Document instance.
xml_doc = reader.fromStream(stream)
or
xml_docfrag = reader.fromStream(stream, ownerDoc)
[Note that the Domlette readers also have an argument to fromStream,
stripElements, for specifying elements from which white-space is to be
stripped while building the DOM. This is merely to support some
internal XSLT optimizations until a better way can be found. Using
these arguments is deprecated and they may be removed from the method
signatures in any future 4Suite release.]
Python 1.x users can break circular dependencies by calling the
releaseNode method on the reader that was used to create the DOM:
reader.releaseNode(xml_doc)
Comments and bug reports welcome. We shall update the API docs to
reflect these changes before releasing 4Suite 0.9.2.
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From gherman@darwin.in-berlin.de Sun Nov 5 22:43:06 2000
From: gherman@darwin.in-berlin.de (Dinu C. Gherman)
Date: Sun, 05 Nov 2000 23:43:06 +0100
Subject: [XML-SIG] Structural view of XML files?
Message-ID: <3A05E27A.BB280902@darwin.in-berlin.de>
This is a multi-part message in MIME format.
--------------E297EF79130E2B6151467772
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hello,
I'm using a little tool that I found *somewhere* and attached
to this message in a slightly modified version. It is supposed
to display an indented tree view of XML files. And this is
what it does, but only as long as there are no entities in
the files, like 'ü'. Sigh...
Does anybody know of a version that handles this XML 'feature'
as well? I'm not exactly very familiar with all the SAX frame-
work stuff... but I can imagine there is some method that I
need to implement or something like this... Or this a version-
ing problem?
Regards,
Dinu
--
Dinu C. Gherman
................................................................
"The only possible values [for quality] are 'excellent' and 'in-
sanely excellent', depending on whether lives are at stake or
not. Otherwise you don't enjoy your work, you don't work well,
and the project goes down the drain."
(Kent Beck, "Extreme Programming Explained")
--------------E297EF79130E2B6151467772
Content-Type: text/plain; charset=us-ascii;
name="xmlpp.py"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="xmlpp.py"
#! /usr/local/bin/python
# $Id: simple_appl.py 0.3 1999/01/19 20:42:17 simon Exp simon $
"""This simple application writes a structured view of the contents of
an XML file. The line number after the opening tag demonstrates the
use of locator methods. The error and fatalError methods can simply
print the exception because the SAXParseException class has a __str__
method."""
from xml.sax import saxexts, saxlib, saxutils
import sys, urllib, string
indentString = " "
class DocumentHandler(saxlib.DocumentHandler):
"""Handle general document events. This is the main client
interface for SAX: it contains callbacks for the most important
document events, such as the start and end of elements. You need
to create an object that implements this interface, and then
register it with the Parser. If you do not want to implement
the entire interface, you can derive a class from HandlerBase,
which implements the default functionality. You can find the
location of any document event using the Locator interface
supplied by setDocumentLocator()."""
def __init__(self):
self.start_tag = {'name' : [], 'indent': '', 'line' : ''}
def setDocumentLocator(self, locator):
"Receive an object for locating the origin of SAX document events."
self.locator = locator
def startDocument(self):
"Handle an event for the beginning of a document."
self.level = -1 # we are still below the root element
pass
## try:
## print "Document: %s" % (self.locator.getSystemId())
## except AttributeError:
## pass
def startElement(self, name, attrs):
"Handle an event for the beginning of an element."
self.output_start_tag('start') # output start element of parent
self.level = self.level + 1
self.start_tag['indent'] = indentString * self.level
self.start_tag['name'] = [name]
# attrs is an AttributeMap object
# that implements the AttributeList methods.
for i in range(attrs.getLength()):
self.start_tag['name'].append("%s=\"%s\"" % (attrs.getName(i),attrs.getValue(i)))
try:
self.start_tag['line'] = self.locator.getLineNumber()
except AttributeError:
self.start_tag['line'] = None
def endElement(self, name):
"Handle an event for the end of an element."
# output start tag (empty element) or print end tag
if not self.output_start_tag('end'):
print "%s%s>" % (indentString * self.level, name)
self.level = self.level - 1
def characters(self, all_data, start, length):
"Handle a character data event."
# all_data contains the whole file;
# start:start+length is this part's slice
data = string.strip(all_data[start:start+length])
if data:
self.output_start_tag('data') # output start element of parent
print "%s%s" % (indentString * (self.level + 1), data)
def output_start_tag (self, where):
"""startElement puts its data in self.start_tag;
startElement, characters, and endElement call output_start_tag;
when called by startElement or characters
and the start tag (of the parent) is still unprinted:
print start tag, return 1;
else return None;
when called by endElement
and the start tag is still unprinted:
print empty element tag, return 1;
else return None"""
if self.start_tag['name']: # if still unprinted
if where in ['start', 'data']:
STAGC = ">"
elif where in ['end']:
STAGC = "/>"
else:
raise ValueError, 'output_start_tag("start"|"data"|"end")'
output = "%s<%s%s" % \
(self.start_tag['indent'],
string.join(self.start_tag['name']), STAGC)
if self.start_tag['line']:
#output = "%s (line %s)" % (output, self.start_tag['line'])
output = "%s" % output
print output
self.start_tag = {'name' : [], 'indent': '', 'line' : ''}
return 1
else:
return None
class ErrorHandler:
"""Basic interface for SAX error handlers. If you create an object
that implements this interface, then register the object with your
Parser, the parser will call the methods in your object to report
all warnings and errors. There are three levels of errors
available: warnings, (possibly) recoverable errors, and
unrecoverable errors. All methods take a SAXParseException as the
only parameter."""
global SGMLSyntaxError
SGMLSyntaxError = "SGML syntax error"
def error(self, exception):
"Handle a recoverable error."
sys.stderr.write ("Error: %s\n" % exception)
def fatalError(self, exception):
"Handle a non-recoverable error."
sys.stderr.write ("Fatal error: %s\n" % exception)
raise SGMLSyntaxError
def warning(self, exception):
"Handle a warning."
sys.stderr.write ("Warning: %s\n" % exception)
# pick a specific parser
from xml.sax.drivers import drv_xmlproc
SAXparser=drv_xmlproc.SAX_XPParser()
SAXparser.setDocumentHandler(DocumentHandler())
if __name__ == '__main__':
# Redirect stdout into a file, if second argument provided.
path = ''
try:
path = sys.argv[2]
f = open(path, 'w')
sys.stdout = f
except IndexError:
pass
try:
SAXparser.parse(sys.argv[1])
# catch the 'SGMLSyntaxError's raised by our own ErrorHandler
except SGMLSyntaxError:
sys.stderr.write("%s; processing aborted\n" % (SGMLSyntaxError))
sys.exit(1)
# catch the SAXParseException errors raised by the SAX parser
# and passed on by ErrorRaiser
except saxlib.SAXParseException:
sys.stderr.write("%s; processing aborted\n"
% (saxlib.SAXParseException))
sys.exit(1)
if path:
f.close()
--------------E297EF79130E2B6151467772--
From martin@loewis.home.cs.tu-berlin.de Mon Nov 6 07:42:33 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Mon, 6 Nov 2000 08:42:33 +0100
Subject: [XML-SIG] New Reader Architecture
In-Reply-To: <3A059CE5.90692504@fourthought.com> (message from Uche Ogbuji on
Sun, 05 Nov 2000 10:46:13 -0700)
References: <3A059CE5.90692504@fourthought.com>
Message-ID: <200011060742.IAA00830@loewis.home.cs.tu-berlin.de>
> We have rewitten most of the code used for creating text from DOMs.
> I've cc'ed xml-sig because the check-ins of 4DOM I'll be making
> today reflect these changes.
Very interesting. Are you following the DOM Level 3 discussions on
load-and-save interfaces? [I couldn't access the draft right now, so
I can't check whether it is related to your work]
> Using one of the new reader classes is also simple. You create an
> instance passing in to the constructor any parameters relevant to the
> state of that class.
While support for customization is a good thing, I think many users
won't need it, or might get confused by it. So I'd prefer to have some
guidelines what the "good for most uses" way of getting a DOM is.
> Once you have the reader instance, you use the fromStream or fromUri
> method to create each DOM. The equivalents to the other common utility
> reader functions (say fromString or fromFile) have been eliminated for
> simplicity since it is trivial to turn text or a filename into a
> stream.
Can you please bring the fromString interface back? In interactive
mode, it is a pain to type StringIO.StringIO.
Also, what is the complication that makes urllib not work for fromUri?
In the Python 2 SAX2 interfaces, you can pass a string to parse, and
it will then consider that as a system identifier. In turn, it will
pass it to urllib, which will open either a local file or the URL.
> [Note that the Domlette readers also have an argument to fromStream,
> stripElements, for specifying elements from which white-space is to be
> stripped while building the DOM. This is merely to support some
> internal XSLT optimizations until a better way can be found. Using
> these arguments is deprecated and they may be removed from the method
> signatures in any future 4Suite release.]
Isn't a validating parser supposed to indicate which elements can have
their whitespace stripped?
> Python 1.x users can break circular dependencies by calling the
> releaseNode method on the reader that was used to create the DOM:
>
> reader.releaseNode(xml_doc)
What kind of circularity does that break? The one in the tree? Does
that mean I have to keep the reader until I release the tree?
Regards,
Martin
From Alexandre.Fayolle@logilab.fr Mon Nov 6 08:54:22 2000
From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle)
Date: Mon, 6 Nov 2000 09:54:22 +0100 (CET)
Subject: [XML-SIG] Re: [4suite] Converting a DOM-tree with XSL
In-Reply-To: <20001106000527.A6433@wintermute.esw-heim.tu-clausthal.de>
Message-ID:
On Mon, 6 Nov 2000, Daniel Plagge wrote:
> Hello,
>
> I want to build an DOM tree from the results of database queries
> and to convert this tree to HTML via XSL.
> The transformation with Processor from xml.xslt works well if I use
> FromXmlFile from ml.dom.ext.reader.Sax to build the DOM tree.
> But if I use the DOM-builder (xml.dom.builder) instead, I get the
This package, as well as core.py are obsolete packages from PyXml
0.5.5.1. You should not be using them.
Maybe a clear warning should be put somewhere on the PyXml web site, or a
FAQ set up, since this question really comes up often.
Alexandre Fayolle
--
http://www.logilab.com
Narval is the first software agent available as free software (GPL).
LOGILAB, Paris (France).
From larsga@garshol.priv.no Mon Nov 6 09:04:36 2000
From: larsga@garshol.priv.no (Lars Marius Garshol)
Date: 06 Nov 2000 10:04:36 +0100
Subject: [XML-SIG] unicode data
In-Reply-To:
References:
Message-ID:
* Alexandre Fayolle
|
| It means that the DOM spec specifies that the CharacterData holds
| its data in a DOMstring type, and adds :
|
| "Applications must encode DOMString using UTF-16 (defined in
| [Unicode] and Amendment 1 of [ISO/IEC 10646])"
|
| Using an interface not called DOMstring is allowed by the spec, as
| long as the encoding is UTF-16.
Actually, this part of the spec is basically confused and confusing.
The character encoding used only matters in primitive programming
languages where there is no suitable wide string type. This basically
means C and C++.
That the requirement for UTF-16 fits Java, tcl and Python is mostly
pure luck, since both UTF-8 (used by Perl) and UCS-4 (used by gcc) are
credible alternatives.
In most languages, the character encoding used in wide strings are
something the DOM should keep quiet about.
--Lars M.
From larsga@garshol.priv.no Mon Nov 6 09:13:18 2000
From: larsga@garshol.priv.no (Lars Marius Garshol)
Date: 06 Nov 2000 10:13:18 +0100
Subject: [XML-SIG] Structural view of XML files?
In-Reply-To: <3A05E27A.BB280902@darwin.in-berlin.de>
References: <3A05E27A.BB280902@darwin.in-berlin.de>
Message-ID:
* Dinu C. Gherman
|
| I'm using a little tool that I found *somewhere* and attached to
| this message in a slightly modified version. It is supposed to
| display an indented tree view of XML files. And this is what it
| does, but only as long as there are no entities in the files, like
| 'ü'. Sigh...
Have you declared your entities? If not that is probably the reason.
| Does anybody know of a version that handles this XML 'feature'
| as well?
Entities are no business of the SAX application; they are resolved
before the application ever sees them. You use xmlproc, which supports
them, but you should note that you are using the non-validating
version, which will not read the external DTD.
If you want the validating version, try using:
SAXparser = saxexts.XMLValParserFactory.make_parser()
instead.
--Lars M.
From guenter@ubka.uni-karlsruhe.de Mon Nov 6 09:42:30 2000
From: guenter@ubka.uni-karlsruhe.de (Guenter Radestock)
Date: Mon, 6 Nov 2000 10:42:30 +0100
Subject: [XML-SIG] Python API for the Sablotron XSL Processor
Message-ID: <20001106104230.B27987@ubka.uni-karlsruhe.de>
Hello,
I copied a new version of Sab-pyth, the Python interface for the
Sablotron XSL processor, on our website at:
http://www.ubka.uni-karlsruhe.de/~guenter/Sab-pyth/
To use this, You also need Sablotron, avaliable at www.gingerall.com.
The module is in a very early stage of development and not tested very
much, yet.
I appreciate all kinds of comments, also some testing and/or code
reviewing would be nice (I am not sure I am doing all the reference
counting in C right...).
This version supports regHandler() to register Scheme handlers, used to
resolve URLs other than the builtin (into Sablotron) file: and arg:.
There also is the start of some documentation.
--
Guenter Radestock, Universitaetsbibliothek Karlsruhe
guenter@ubka.uni-karlsruhe.de
http://www.ubka.uni-karlsruhe.de/~guenter
From uche.ogbuji@fourthought.com Mon Nov 6 20:46:16 2000
From: uche.ogbuji@fourthought.com (uche.ogbuji@fourthought.com)
Date: Mon, 06 Nov 2000 13:46:16 -0700
Subject: [XML-SIG] New Reader Architecture
In-Reply-To: Message from "Martin v. Loewis"
of "Mon, 06 Nov 2000 08:42:33 +0100." <200011060742.IAA00830@loewis.home.cs.tu-berlin.de>
Message-ID: <200011062046.NAA11502@localhost.localdomain>
> > We have rewitten most of the code used for creating text from DOMs.
> > I've cc'ed xml-sig because the check-ins of 4DOM I'll be making
> > today reflect these changes.
>
> Very interesting. Are you following the DOM Level 3 discussions on
> load-and-save interfaces? [I couldn't access the draft right now, so
> I can't check whether it is related to your work]
Not yet. In the first draft, load and save was not covered at all. I haven't
perused the second draft, but at any rate it will be somewhat closer to CR
before we move DOM L3. We were burned in terms of wasted effort by moving to
the draft DOM L2 namespaces and having them change quite a bit.
> > Using one of the new reader classes is also simple. You create an
> > instance passing in to the constructor any parameters relevant to the
> > state of that class.
>
> While support for customization is a good thing, I think many users
> won't need it, or might get confused by it. So I'd prefer to have some
> guidelines what the "good for most uses" way of getting a DOM is.
OK. I'll try to get some such doc in before release.
> > Once you have the reader instance, you use the fromStream or fromUri
> > method to create each DOM. The equivalents to the other common utility
> > reader functions (say fromString or fromFile) have been eliminated for
> > simplicity since it is trivial to turn text or a filename into a
> > stream.
>
> Can you please bring the fromString interface back? In interactive
> mode, it is a pain to type StringIO.StringIO.
OK.
> Also, what is the complication that makes urllib not work for fromUri?
> In the Python 2 SAX2 interfaces, you can pass a string to parse, and
> it will then consider that as a system identifier. In turn, it will
> pass it to urllib, which will open either a local file or the URL.
Ah, but not all URIs are URLs. What if you have a URN resolution handler?
This is something that will be especially relevant with 4Suite Server, which
provides URN/UUIDs for XML documents in the repositories, and also provides a
relevant URI handler which can easily be plugged into XPath, XSLT, RDF,
XPointer, etc.
> > [Note that the Domlette readers also have an argument to fromStream,
> > stripElements, for specifying elements from which white-space is to be
> > stripped while building the DOM. This is merely to support some
> > internal XSLT optimizations until a better way can be found. Using
> > these arguments is deprecated and they may be removed from the method
> > signatures in any future 4Suite release.]
>
> Isn't a validating parser supposed to indicate which elements can have
> their whitespace stripped?
Not directly, but of course one can use the ignorableWhitespace call-back if
you're using SAX.
However, the reader support for stripping is an entirely different matter
entirely. XSLT allows you to specify elements to be stripped from source
documents. Originally, 4XSLT would create the DOM normally, and then strip
the relevant WS nodes, but this was horribly inefficient. We sped things up
several times by merely stripping whitespace as we built the DOM. This is why
we have the interface, and it is also why it is not recommended for regular
use: it's pretty much a hack (but a very important hack) for XSLT performance.
> > Python 1.x users can break circular dependencies by calling the
> > releaseNode method on the reader that was used to create the DOM:
> >
> > reader.releaseNode(xml_doc)
>
> What kind of circularity does that break? The one in the tree? Does
> that mean I have to keep the reader until I release the tree?
Yes and maybe. You don't have to keep the reader around if you're sure what
type of DOM you have. However, if you try to call cDomlette's ReleaseNode on
a pDomlette node, it will break, and vice versa. That's why it's also on the
instance as a convenience.
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From martin@loewis.home.cs.tu-berlin.de Mon Nov 6 23:06:19 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Tue, 7 Nov 2000 00:06:19 +0100
Subject: [XML-SIG] Re: [4suite] Converting a DOM-tree with XSL
In-Reply-To: (message
from Alexandre Fayolle on Mon, 6 Nov 2000 09:54:22 +0100 (CET))
References:
Message-ID: <200011062306.AAA00892@loewis.home.cs.tu-berlin.de>
> > I want to build an DOM tree from the results of database queries
> > and to convert this tree to HTML via XSL.
> > The transformation with Processor from xml.xslt works well if I use
> > FromXmlFile from ml.dom.ext.reader.Sax to build the DOM tree.
> > But if I use the DOM-builder (xml.dom.builder) instead, I get the
>
> This package, as well as core.py are obsolete packages from PyXml
> 0.5.5.1. You should not be using them.
I'm not sure I understand the problem here. If he was using PyXML
0.6.1, there would not be any xml.dom.builder, nor does any online
documentation claim there is (if that's incorrect, please let me know).
However, if he does use 0.5.x, what's wrong with using
xml.dom.builder? It won't give you a 4DOM tree, and yes, it is not
included in later releases anymore - but that doesn't help users who
can't or won't upgrade.
> Maybe a clear warning should be put somewhere on the PyXml web site,
> or a FAQ set up, since this question really comes up often.
Contributions of documentation are certainly welcome. The easiest
thing is probably to do such stuff on the XML topic guide; feel free
to check that out via CVS.
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Mon Nov 6 23:12:38 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Tue, 7 Nov 2000 00:12:38 +0100
Subject: [XML-SIG] unicode data
In-Reply-To: (message from Lars Marius
Garshol on 06 Nov 2000 10:04:36 +0100)
References:
Message-ID: <200011062312.AAA00954@loewis.home.cs.tu-berlin.de>
> Actually, this part of the spec is basically confused and confusing.
> The character encoding used only matters in primitive programming
> languages where there is no suitable wide string type. This basically
> means C and C++.
>
> That the requirement for UTF-16 fits Java, tcl and Python is mostly
> pure luck, since both UTF-8 (used by Perl) and UCS-4 (used by gcc) are
> credible alternatives.
>
> In most languages, the character encoding used in wide strings are
> something the DOM should keep quiet about.
The real underlying requirement is: strings in the DOM are number with
Unicode code points (i.e. Unicode is the character set); and the data
type should allow access to individual characters (rather than to
individual bytes of encoding) - IOW, DOM applications don't need to
care about multiple character sets.
In that way, UTF-16 and UCS-4 certainly qualify (if accessible on a
per-character basis). I don't know about Perl, but I think UTF-8
encoded byte strings would not be suitable in Python.
Regards,
Martin
P.S. The Unicode standard (even Unicode 3.0) is stupid enough to
outrule UCS-4 as an in-memory representation for Unicode. So it'll
take a while until others (like W3C) get it really right. As a
starting point, I think DOMString was the right thing to define.
From jchalfan@outbackinc.com Mon Nov 6 23:22:13 2000
From: jchalfan@outbackinc.com (Jay Chalfant)
Date: Mon, 6 Nov 2000 15:22:13 -0800
Subject: [XML-SIG] Element.firstChild() returns error
Message-ID: <9D7F61B87714D31194530090276212441F46FC@outback.internal.outbackinc.com>
Hello All..
I just discovered PyXML and would first like to say thanks to all those who
have contributed to the project. I'm a new user of Python and have been
using XML for about 6 months (mostly Java) and am very excited about the
confluence of the two. Now to the meat of this post.. ;-)
By pawing around in the code, I discovered that instead of using
getFirstChild() I should use firstChild() on a Node. So first question, is
there a documented Python language binding to the DOM?
Secondly, when I try to use this method on an Element, I get the following
error:
>>> acctList1
>>> acctList1.firstChild()
Traceback (most recent call last):
File "", line 1, in ?
AttributeError: no __call__ method defined
Is this an error in the implementation or in my use?
Finally, I noticed the javadom.py module. The comments indicate that this
module is to allow access to Java implementations from Python. What I was
hoping for was a wrapper to provide the Java IF's to the Python
implementation! Is this a reasonable request or am I up the wrong tree?
Thanks in advance for your time.
-J
----------------------
Jay Chalfant
OutBack Resource Group
www.outbackinc.com
From martin@loewis.home.cs.tu-berlin.de Tue Nov 7 00:03:39 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Tue, 7 Nov 2000 01:03:39 +0100
Subject: [XML-SIG] Python API for the Sablotron XSL Processor
In-Reply-To: <20001106104230.B27987@ubka.uni-karlsruhe.de> (message from
Guenter Radestock on Mon, 6 Nov 2000 10:42:30 +0100)
References: <20001106104230.B27987@ubka.uni-karlsruhe.de>
Message-ID: <200011070003.BAA01100@loewis.home.cs.tu-berlin.de>
> I copied a new version of Sab-pyth, the Python interface for the
> Sablotron XSL processor, on our website at:
>
> http://www.ubka.uni-karlsruhe.de/~guenter/Sab-pyth/
I put a link on
http://pyxml.sourceforge.net/topics/software.html
If you'd like a different text, please sent me a patch against
http://pyxml.sourceforge.net/topics/software.ht
[also let me know if I should remove the link]
> I appreciate all kinds of comments, also some testing and/or code
> reviewing would be nice (I am not sure I am doing all the reference
> counting in C right...).
I only had a shallow look (not having used Sablotron before); here's
what I found:
- would be nice to use distutils for setup. If you think it is too
much trouble for 1.5.2 users to install Distutils before, you can
still continue to provide Setup.in for backwards compatibility.
Please note that it also gives an advantage for the maintainer:
You can produce RPMs and Windows Installers quite easily.
- on building Python objects: using specific constructor functions
instead of Py_BuildValue is preferred most of the time; if nothing
else, it is faster. Specifically, don't write
retval = Py_BuildValue("s", ret);
instead write
retval = PyString_FromString(ret);
Likewise PyInt_FromLong.
- I believe freedbllist/makedbllist doesn't work if initialization of
the list is incomplete (e.g. some of the elements are not string
pairs): the dbllist should be allocated with calloc, so any uninitialised
pointer is zero (or freedbllist should get the number of elements).
- Also, is it really necessary to strcpy all the strings in a dbllist?
It would be if Sablotron modifies the strings (or the dbllists); if it
merely looks at them, then putting the char* of the PyString into
the list may be sufficient.
Otherwise, your code looks quite clean to me; I could not spot any
refcounting problems.
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Tue Nov 7 00:23:14 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Tue, 7 Nov 2000 01:23:14 +0100
Subject: [XML-SIG] Element.firstChild() returns error
In-Reply-To: <9D7F61B87714D31194530090276212441F46FC@outback.internal.outbackinc.com>
(message from Jay Chalfant on Mon, 6 Nov 2000 15:22:13 -0800)
References: <9D7F61B87714D31194530090276212441F46FC@outback.internal.outbackinc.com>
Message-ID: <200011070023.BAA01175@loewis.home.cs.tu-berlin.de>
> By pawing around in the code, I discovered that instead of using
> getFirstChild() I should use firstChild() on a Node. So first
> question, is there a documented Python language binding to the DOM?
There will be RSN. Unfortunately, it was not completed in time for
2.0, and currently sits on a machine at BeOpen which is currently
down.
The core of your problem here is that IDL attributes map to attributes
in Python, instead of accessor functions as in Java. For compatibility
with the Python CORBA mapping, 4DOM also supports the an accessor
function _get_.
> >>> acctList1
> children>
> >>> acctList1.firstChild()
> Traceback (most recent call last):
> File "", line 1, in ?
> AttributeError: no __call__ method defined
>
> Is this an error in the implementation or in my use?
It's your use. accList1.firstChild *is* the first child, no need to
call it.
> Finally, I noticed the javadom.py module. The comments indicate that
> this module is to allow access to Java implementations from
> Python. What I was hoping for was a wrapper to provide the Java IF's
> to the Python implementation! Is this a reasonable request or am I
> up the wrong tree?
No, I believe that's something different: It gives you access to a
Java DOM implementation inside JPython, with exposes the official
Python DOM mapping of the Java DOM tree (instead of the one resulting
from the Java mapping).
However, it should not be too difficult to get used to this mapping;
apart from the attributes issue, there really is no deviation from the
straight-forward mapping (except that DOMStrings can sometimes appear
as Unicode strings and sometimes as byte strings - depending on the
Python version).
One more difference, perhaps: the Python mapping offers convenience
container objects instead of following the IDL-style containers: e.g.
a NodeList might be accessible as a Python sequence. "might be", since
it is a list in minidom (i.e. no .item, .length), and an object
following the IDL mapping in 4DOM (i.e. no __getitem__, __len__). I
hope this can be fixed so that you can always treat .childNodes as a
list. If you only use .firstChild, .nextSibling, you won't even
notice that difference.
Regards,
Martin
From uche.ogbuji@fourthought.com Tue Nov 7 00:42:09 2000
From: uche.ogbuji@fourthought.com (uche.ogbuji@fourthought.com)
Date: Mon, 06 Nov 2000 17:42:09 -0700
Subject: [XML-SIG] Element.firstChild() returns error
In-Reply-To: Message from "Martin v. Loewis"
of "Tue, 07 Nov 2000 01:23:14 +0100." <200011070023.BAA01175@loewis.home.cs.tu-berlin.de>
Message-ID: <200011070042.RAA12165@localhost.localdomain>
> One more difference, perhaps: the Python mapping offers convenience
> container objects instead of following the IDL-style containers: e.g.
> a NodeList might be accessible as a Python sequence. "might be", since
> it is a list in minidom (i.e. no .item, .length), and an object
> following the IDL mapping in 4DOM (i.e. no __getitem__, __len__). I
> hope this can be fixed so that you can always treat .childNodes as a
> list. If you only use .firstChild, .nextSibling, you won't even
> notice that difference.
?
The 4DOM NodeList class subclasses UserList so it does provide __getitem__,
__len__ and all that.
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From martin@loewis.home.cs.tu-berlin.de Tue Nov 7 01:15:27 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Tue, 7 Nov 2000 02:15:27 +0100
Subject: [XML-SIG] Element.firstChild() returns error
In-Reply-To: <200011070042.RAA12165@localhost.localdomain>
(uche.ogbuji@fourthought.com)
References: <200011070042.RAA12165@localhost.localdomain>
Message-ID: <200011070115.CAA01770@loewis.home.cs.tu-berlin.de>
> ?
>
> The 4DOM NodeList class subclasses UserList so it does provide __getitem__,
> __len__ and all that.
Oops, I shouldn't be studying complex Python source so late at night.
So I take that back: you *can* use
for n in node.childNodes:
...
both in minidom and 4DOM.
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Tue Nov 7 07:38:40 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Tue, 7 Nov 2000 08:38:40 +0100
Subject: [XML-SIG] Current Python docs
Message-ID: <200011070738.IAA00774@loewis.home.cs.tu-berlin.de>
Fred put the new version of the Python documentation online at
http://python.sourceforge.net/devel-docs/
which now includes the minidom documentation in
http://python.sourceforge.net/devel-docs/lib/module-xml.dom.minidom.html
Regards,
Martin
From gherman@darwin.in-berlin.de Tue Nov 7 15:53:16 2000
From: gherman@darwin.in-berlin.de (Dinu C. Gherman)
Date: Tue, 07 Nov 2000 16:53:16 +0100
Subject: [XML-SIG] Structural view of XML files?
References: <20001106170220.AD9371D099@dinsdale.python.org>
Message-ID: <3A08256C.2BBFDE41@darwin.in-berlin.de>
Lars Marius Garshol wrote:
>
> * Dinu C. Gherman
> |
> | I'm using a little tool that I found *somewhere* and attached to
> | this message in a slightly modified version. It is supposed to
> | display an indented tree view of XML files. And this is what it
> | does, but only as long as there are no entities in the files, like
> | 'ü'. Sigh...
>
> Have you declared your entities? If not that is probably the reason.
Of course not! ;-)
> | Does anybody know of a version that handles this XML 'feature'
> | as well?
>
> Entities are no business of the SAX application; they are resolved
> before the application ever sees them. You use xmlproc, which supports
> them, but you should note that you are using the non-validating
> version, which will not read the external DTD.
Well, I thought that would be enough to display a tree
view, which is all I wanted. I thought there is no need
for declaring or knowing about entities for such a simple
tool, as they do not affect the parsing of the elements
(or maybe IMHO they shouldn't).
> If you want the validating version, try using:
>
> SAXparser = saxexts.XMLValParserFactory.make_parser()
>
> instead.
Thanks for the hint. I might try that later. For the time
being I'm using some kind of a workaround, which is to
remove everything that looks like an entitiy in a pre-
processing step. This is sufficient for my current need.
Maybe it was silly to expect that entities would be handled
by default...
Regards,
Dinu
--
Dinu C. Gherman
................................................................
"The only possible values [for quality] are 'excellent' and 'in-
sanely excellent', depending on whether lives are at stake or
not. Otherwise you don't enjoy your work, you don't work well,
and the project goes down the drain."
(Kent Beck, "Extreme Programming Explained")
From martin@loewis.home.cs.tu-berlin.de Tue Nov 7 20:21:09 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Tue, 7 Nov 2000 21:21:09 +0100
Subject: [XML-SIG] Structural view of XML files?
In-Reply-To: <3A08256C.2BBFDE41@darwin.in-berlin.de>
(gherman@darwin.in-berlin.de)
References: <20001106170220.AD9371D099@dinsdale.python.org> <3A08256C.2BBFDE41@darwin.in-berlin.de>
Message-ID: <200011072021.VAA00761@loewis.home.cs.tu-berlin.de>
> Well, I thought that would be enough to display a tree
> view, which is all I wanted. I thought there is no need
> for declaring or knowing about entities for such a simple
> tool, as they do not affect the parsing of the elements
> (or maybe IMHO they shouldn't).
The problem is that you can't know what an entity expands to. It could
expand to an element, in which case the parser should pull-in the
definition of the entity, and your tool may want to indent the
resulting text.
I assume that you want the entity reference "unprocessed" in the
output; XML parsers won't do that.
Regards,
Martin
From gherman@darwin.in-berlin.de Tue Nov 7 22:07:23 2000
From: gherman@darwin.in-berlin.de (Dinu C. Gherman)
Date: Tue, 07 Nov 2000 23:07:23 +0100
Subject: [XML-SIG] Structural view of XML files?
References: <20001106170220.AD9371D099@dinsdale.python.org> <3A08256C.2BBFDE41@darwin.in-berlin.de> <200011072021.VAA00761@loewis.home.cs.tu-berlin.de>
Message-ID: <3A087D1B.6F804221@darwin.in-berlin.de>
"Martin v. Loewis" wrote:
>
> I wrote:
>
> > Well, I thought that would be enough to display a tree
> > view, which is all I wanted. I thought there is no need
> > for declaring or knowing about entities for such a simple
> > tool, as they do not affect the parsing of the elements
> > (or maybe IMHO they shouldn't).
>
> The problem is that you can't know what an entity expands to. It could
> expand to an element, in which case the parser should pull-in the
> definition of the entity, and your tool may want to indent the
> resulting text.
I guess you're right! I didn't think about the hidden com-
plexities 'under the hood'...
> I assume that you want the entity reference "unprocessed" in the
> output; XML parsers won't do that.
Right again! Perhaps that would be a nice-to-have feature
(switching entity expansion off) for the very simplest
cases, but well, I can do without...
Thanks!
Dinu
--
Dinu C. Gherman
................................................................
"The only possible values [for quality] are 'excellent' and 'in-
sanely excellent', depending on whether lives are at stake or
not. Otherwise you don't enjoy your work, you don't work well,
and the project goes down the drain."
(Kent Beck, "Extreme Programming Explained")
From jchalfan@outbackinc.com Tue Nov 7 23:09:55 2000
From: jchalfan@outbackinc.com (Jay Chalfant)
Date: Tue, 7 Nov 2000 15:09:55 -0800
Subject: [XML-SIG] Element.firstChild() returns error
Message-ID: <9D7F61B87714D31194530090276212441F4708@outback.internal.outbackinc.com>
Thanks Martin. I am able to 'get around' in Python/XML now. I did bump into
the Unicode issue and solved it with .encode("UTF-8"). I guess that's the
way it's done.
Thanks for your time.
-J
> -----Original Message-----
> From: Martin v. Loewis [mailto:martin@loewis.home.cs.tu-berlin.de]
> Sent: Monday, November 06, 2000 4:23 PM
> To: jchalfan@outbackinc.com
> Cc: xml-sig@python.org
> Subject: Re: [XML-SIG] Element.firstChild() returns error
>
>
> > By pawing around in the code, I discovered that instead of using
> > getFirstChild() I should use firstChild() on a Node. So first
> > question, is there a documented Python language binding to the DOM?
>
> There will be RSN. Unfortunately, it was not completed in time for
> 2.0, and currently sits on a machine at BeOpen which is currently
> down.
>
> The core of your problem here is that IDL attributes map to attributes
> in Python, instead of accessor functions as in Java. For compatibility
> with the Python CORBA mapping, 4DOM also supports the an accessor
> function _get_.
>
> > >>> acctList1
> > > children>
> > >>> acctList1.firstChild()
> > Traceback (most recent call last):
> > File "", line 1, in ?
> > AttributeError: no __call__ method defined
> >
> > Is this an error in the implementation or in my use?
>
> It's your use. accList1.firstChild *is* the first child, no need to
> call it.
>
> > Finally, I noticed the javadom.py module. The comments indicate that
> > this module is to allow access to Java implementations from
> > Python. What I was hoping for was a wrapper to provide the Java IF's
> > to the Python implementation! Is this a reasonable request or am I
> > up the wrong tree?
>
> No, I believe that's something different: It gives you access to a
> Java DOM implementation inside JPython, with exposes the official
> Python DOM mapping of the Java DOM tree (instead of the one resulting
> from the Java mapping).
>
> However, it should not be too difficult to get used to this mapping;
> apart from the attributes issue, there really is no deviation from the
> straight-forward mapping (except that DOMStrings can sometimes appear
> as Unicode strings and sometimes as byte strings - depending on the
> Python version).
>
> One more difference, perhaps: the Python mapping offers convenience
> container objects instead of following the IDL-style containers: e.g.
> a NodeList might be accessible as a Python sequence. "might be", since
> it is a list in minidom (i.e. no .item, .length), and an object
> following the IDL mapping in 4DOM (i.e. no __getitem__, __len__). I
> hope this can be fixed so that you can always treat .childNodes as a
> list. If you only use .firstChild, .nextSibling, you won't even
> notice that difference.
>
> Regards,
> Martin
>
> _______________________________________________
> XML-SIG maillist - XML-SIG@python.org
> http://www.python.org/mailman/listinfo/xml-sig
>
From larsga@garshol.priv.no Wed Nov 8 08:18:11 2000
From: larsga@garshol.priv.no (Lars Marius Garshol)
Date: 08 Nov 2000 09:18:11 +0100
Subject: [XML-SIG] Structural view of XML files?
In-Reply-To: <3A08256C.2BBFDE41@darwin.in-berlin.de>
References: <20001106170220.AD9371D099@dinsdale.python.org> <3A08256C.2BBFDE41@darwin.in-berlin.de>
Message-ID:
* Lars Marius Garshol
|
| Have you declared your entities?
* Dinu C. Gherman
|
| Of course not! ;-)
Then you absolutely should, because until you do you have broken
documents. This is like writing C code and leaving out all the
'#include' statements.
If you are using standard character entities you can probably just
steal them from the XHTML DTD and put them in your document like this:
If you do, the non-validating version of xmlproc that you use now will
read the declarations and resolve the entity references automatically.
| Well, I thought that would be enough to display a tree view, which
| is all I wanted. I thought there is no need for declaring or knowing
| about entities for such a simple tool, as they do not affect the
| parsing of the elements (or maybe IMHO they shouldn't).
They do, and they absolutely must. Like Martin pointed out, entities
can perfectly well contain elements. I'm writing my Python-XML book
now as an XML (well, SGML, really) document, and I have defined all
the chapters as entities.
Another issue is that once your document is considered to not be
well-formed it will not work anywhere. No parser will accept it.
--Lars M.
From tpassin@home.com Wed Nov 8 13:32:42 2000
From: tpassin@home.com (Thomas B. Passin)
Date: Wed, 8 Nov 2000 08:32:42 -0500
Subject: [XML-SIG] Structural view of XML files?
References: <20001106170220.AD9371D099@dinsdale.python.org> <3A08256C.2BBFDE41@darwin.in-berlin.de>
Message-ID: <000b01c04988$5f0f6c00$7cac1218@reston1.va.home.com>
Lars Marius Garshol remarked,
> Another issue is that once your document is considered to
not be
> well-formed it will not work anywhere. No parser will
accept it.
Yes, what one knows, they all know - they talk to each other
and keep a secret blacklist. :-)
Cheers,
Tom Passin
From Alexandre.Fayolle@logilab.fr Wed Nov 8 16:03:01 2000
From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle)
Date: Wed, 8 Nov 2000 17:03:01 +0100 (CET)
Subject: [XML-SIG] xml silly question
Message-ID:
Is it valid xml to have an attribute with an empty string as a value ?
Alexandre Fayolle
--
http://www.logilab.com
Narval is the first software agent available as free software (GPL).
LOGILAB, Paris (France).
From GuyM@eurodatasystems.com Wed Nov 8 17:26:04 2000
From: GuyM@eurodatasystems.com (Guy Murphy)
Date: Wed, 8 Nov 2000 17:26:04 -0000
Subject: [XML-SIG] xml silly question
Message-ID:
Hiya Alexandre.
I believe it is allowed in terms of being "well formed". It certainly seems
to work here,
although I haven't checked the spec to be 100% sure... I'm sure somebody
will pipe up
if I'm wrong.
Cheers
Guy.
-----Original Message-----
From: Alexandre Fayolle [mailto:Alexandre.Fayolle@logilab.fr]
Sent: 8 November 2000 16:03
To: xml-sig@python.org
Subject: [XML-SIG] xml silly question
Is it valid xml to have an attribute with an empty string as a value ?
Alexandre Fayolle
--
http://www.logilab.com
Narval is the first software agent available as free software (GPL).
LOGILAB, Paris (France).
_______________________________________________
XML-SIG maillist - XML-SIG@python.org
http://www.python.org/mailman/listinfo/xml-sig
From martin@loewis.home.cs.tu-berlin.de Wed Nov 8 17:51:06 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Wed, 8 Nov 2000 18:51:06 +0100
Subject: [XML-SIG] xml silly question
In-Reply-To:
(message from Alexandre Fayolle on Wed, 8 Nov 2000 17:03:01 +0100
(CET))
References:
Message-ID: <200011081751.SAA00827@loewis.home.cs.tu-berlin.de>
> Is it valid xml to have an attribute with an empty string as a value ?
AttValue is defined as
AttValue ::= '"' ([^<&"] | Reference)* '"'
| "'" ([^<&'] | Reference)* "'"
and there is no constraint on it, so yes, that is allowed.
Regards,
Martin
From Alexandre.Fayolle@logilab.fr Wed Nov 8 18:07:07 2000
From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle)
Date: Wed, 8 Nov 2000 19:07:07 +0100 (CET)
Subject: [XML-SIG] xml silly question
In-Reply-To: <200011081751.SAA00827@loewis.home.cs.tu-berlin.de>
Message-ID:
Thanks for all your answers.
Alexandre Fayolle
--
http://www.logilab.com
Narval is the first software agent available as free software (GPL).
LOGILAB, Paris (France).
From Alexandre.Fayolle@logilab.fr Wed Nov 8 19:31:48 2000
From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle)
Date: Wed, 8 Nov 2000 20:31:48 +0100 (CET)
Subject: [XML-SIG] [ANNOUNCE] xmltools
Message-ID:
I'm releasing the xmltools package.
Python XmlTools is a set of high level graphical components to help using
XML in python applications. Right now it features two pyGTK widgets:
XmlTree and XmlEditor, which can respectively display and edit an XML
document in a graphical user interface. Both widget are used in the Narval
project. They make use of 4DOM (and DOM L2 Events), 4XPath, and xmlproc.
The home page is http://www.logilab.org/xmltools/
Alexandre Fayolle
--
http://www.logilab.com
Narval is the first software agent available as free software (GPL).
LOGILAB, Paris (France).
From Juergen Hermann"
Message-ID:
On Wed, 8 Nov 2000 20:31:48 +0100 (CET), Alexandre Fayolle wrote:
>I'm releasing the xmltools package.
Looks interesting. Could you make some screenshots and link them on the =
site?
Bye, J=FCrgen
From frank63@ms5.hinet.net Thu Nov 9 10:31:31 2000
From: frank63@ms5.hinet.net (Frank J.S. Chen)
Date: Thu, 9 Nov 2000 10:31:31 -0000
Subject: [XML-SIG] PyXML-0_6_1_win32-py_2_0.exe
Message-ID: <200011090231.KAA26496@ms5.hinet.net>
Hi:
After executing this run file, where are the files?
----------------------------------------------------------------------------
-------
Chen Chien-Hsun
Taipei,Taiwan,R.O.C.
From frank63@ms5.hinet.net Thu Nov 9 13:13:19 2000
From: frank63@ms5.hinet.net (Frank J.S. Chen)
Date: Thu, 9 Nov 2000 13:13:19 -0000
Subject: [XML-SIG] PyXML-0_6_1_win32-py_2_0.exe
Message-ID: <200011090520.NAA20982@ms5.hinet.net>
Hello:
I found that this win32 package seems cannot run on WinNT 4.0 & Service
Pack 1.0?
----------------------------------------------------------------------------
-------
Chen Chien-Hsun
Taipei,Taiwan,R.O.C.
From frank63@ms5.hinet.net Thu Nov 9 14:22:38 2000
From: frank63@ms5.hinet.net (Frank J.S. Chen)
Date: Thu, 9 Nov 2000 14:22:38 -0000
Subject: [XML-SIG] 4XSLT 0.9.2
Message-ID: <200011090621.OAA27848@ms5.hinet.net>
Hi:
I cannot use 4Suite 0.9.1 for some reasons at this time, so I use old 4XSLT
0.9.2 to test instead.
Here is the problem.
When feeding 4XSLT this xml line:
平
after processing, its output still use UTF-8 3-bytes encodings:
... å¹³ ...
Apparently, 4XSLT does convert xml file into UTF-8 encoding, but it should
transcode back to
... 平 ...
when outputing a html file, shouldn't it?
Does this change in 4Suite 0.9.1?
----------------------------------------------------------------------------
-------
Chen Chien-Hsun
Taipei,Taiwan,R.O.C.
From jerome.chantelauze@finix.eu.org Thu Nov 9 10:44:41 2000
From: jerome.chantelauze@finix.eu.org (Speedy)
Date: Thu, 9 Nov 2000 11:44:41 +0100
Subject: [XML-SIG] location handling in pyexpat
Message-ID: <20001109114441.A3206@Speedy.Free-System.com>
--f2QGlHpHGjS2mn6Y
Content-Type: text/plain; charset=us-ascii
Hi.
I use pyexpat to parse xml stuff and I needed location, even in well
formed documents. I've made a few changes in pyexpat to make it work,
but I'm not sure it's the "right" way to do it.
I just added a few lines in the file drv_pyexpat.py.
I join to this e-mail
- a patch for drv_pyexpat.py (drv_pyexpat.py.patch).
- an example of code with location handling (Example.py).
This example is a (useless) python script.
$ Example.py Element_Name XML_File
It uses pyexpat to scan the file XML_File and display the position
of the elements named Element_Name.
Do you think these changes can become part of the next version of
pyxml, or do I need to rethink about it ?
Jerome Chantelauze
jerome@free-system.com
--f2QGlHpHGjS2mn6Y
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="drv_pyexpat.py.patch"
*** drv_pyexpat.py.orig Fri Nov 3 16:20:52 2000
--- drv_pyexpat.py Fri Nov 3 16:34:39 2000
***************
*** 41,53 ****
--- 41,61 ----
at[attrs[i]] = attrs[i+1]
+ # Line added for location handling
+ self.doc_handler.setDocumentLocator(self)
self.doc_handler.startElement(name,saxutils.AttributeMap(at))
def endElement(self,name):
+ # Line added for location handling
+ self.doc_handler.setDocumentLocator(self)
self.doc_handler.endElement(name)
def characters(self,data):
+ # Line added for location handling
+ self.doc_handler.setDocumentLocator(self)
self.doc_handler.characters(data,0,len(data))
def processingInstruction(self,target,data):
+ # Line added for location handling
+ self.doc_handler.setDocumentLocator(self)
self.doc_handler.processingInstruction(target,data)
--f2QGlHpHGjS2mn6Y
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="Example.py"
#!/usr/bin/python
from xml.sax import saxlib, saxexts
import sys
class my_document_handler(saxlib.DocumentHandler):
def __init__(self, Target):
self.Target=Target
self.Found=0
# Called by drv_pyexpat with a locator.
def setDocumentLocator(self, Locator):
self.Locator=Locator
def endDocument(self):
if not self.Found:
print "Element %s not found." % (self.Target,)
def startElement(self, name, attrs):
if name==self.Target:
self.Found=self.Found+1
print "Found %s element at (%s,%s)" % \
(self.Target, self.Locator.getColumnNumber(),
self.Locator.getLineNumber())
File=None
if len(sys.argv)!=3:
print "Usage: Example.py Target File"
else:
File=open(sys.argv[2], "r")
my_parser=saxexts.make_parser()
my_handler=my_document_handler(sys.argv[1])
my_parser.setDocumentHandler(my_handler)
my_parser.parseFile(File)
--f2QGlHpHGjS2mn6Y--
From Alexandre.Fayolle@logilab.fr Thu Nov 9 09:56:42 2000
From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle)
Date: Thu, 9 Nov 2000 10:56:42 +0100 (CET)
Subject: [XML-SIG] [ANNOUNCE] xmltools
In-Reply-To:
Message-ID:
On Wed, 8 Nov 2000, Juergen Hermann wrote:
> On Wed, 8 Nov 2000 20:31:48 +0100 (CET), Alexandre Fayolle wrote:
>
> >I'm releasing the xmltools package.
>
> Looks interesting. Could you make some screenshots and link them on the
> site?
Point taken. I've updated the web site (http://www.logilab.org/xmltools/)
to include a screenshot of XmlTree and a screenshot of XmlEditor.
Alexandre Fayolle
--
http://www.logilab.com
Narval is the first software agent available as free software (GPL).
LOGILAB, Paris (France).
From andorxor@gmx.de Thu Nov 9 12:33:13 2000
From: andorxor@gmx.de (Stephan Tolksdorf)
Date: Thu, 9 Nov 2000 13:33:13 +0100
Subject: [XML-SIG] XML appropiate for config files of a xml processor?
Message-ID: <12314247456.20001109133313@email.com>
Hello,
this a design question not directly related to Python.
I'm writing a small homegrown xml processor which is mainly
intended for transforming xml files to html.
At the moment it is configurable by config files written in xml.
But these config files are not easy to manually read or edit as you
have to escape <,>,".
For example a mapping for a xml-tag could look like
this:
<p><p><b></b></p>
The processor should now transform
"test"
into
"
test
".
Obviously you have to use a special XML-Editor to edit these type of
config files.
So, would you say this is an acceptable drawback in comparison to the
flexibility and ease of use of xml as the config file format?
Or would you say one should use a custom format for these config files?
Maybe you could point me to a config file format actually in use with
such type of processor?
I'd be thankful for your answers.
Best Regards,
Stephan Tolksdorf
From gstein@lyra.org Thu Nov 9 12:43:01 2000
From: gstein@lyra.org (Greg Stein)
Date: Thu, 9 Nov 2000 04:43:01 -0800
Subject: [XML-SIG] XML appropiate for config files of a xml processor?
In-Reply-To: <12314247456.20001109133313@email.com>; from andorxor@gmx.de on Thu, Nov 09, 2000 at 01:33:13PM +0100
References: <12314247456.20001109133313@email.com>
Message-ID: <20001109044301.H14895@lyra.org>
Blarg. Don't use XML for config files (that are intended to be read / edited
by a human). Take a look at the ConfigParser module in the standard library.
Cheers,
-g
On Thu, Nov 09, 2000 at 01:33:13PM +0100, Stephan Tolksdorf wrote:
> Hello,
>
> this a design question not directly related to Python.
>
> I'm writing a small homegrown xml processor which is mainly
> intended for transforming xml files to html.
>
> At the moment it is configurable by config files written in xml.
> But these config files are not easy to manually read or edit as you
> have to escape <,>,".
> For example a mapping for a xml-tag could look like
> this:
>
> <p><p><b>
> </b></p>
>
>
> The processor should now transform
> "test"
> into
> "
test
".
>
> Obviously you have to use a special XML-Editor to edit these type of
> config files.
>
> So, would you say this is an acceptable drawback in comparison to the
> flexibility and ease of use of xml as the config file format?
> Or would you say one should use a custom format for these config files?
> Maybe you could point me to a config file format actually in use with
> such type of processor?
>
> I'd be thankful for your answers.
>
> Best Regards,
> Stephan Tolksdorf
>
>
>
> _______________________________________________
> XML-SIG maillist - XML-SIG@python.org
> http://www.python.org/mailman/listinfo/xml-sig
--
Greg Stein, http://www.lyra.org/
From GuyM@eurodatasystems.com Thu Nov 9 13:10:03 2000
From: GuyM@eurodatasystems.com (Guy Murphy)
Date: Thu, 9 Nov 2000 13:10:03 -0000
Subject: [XML-SIG] XML appropiate for config files of a xml processor?
Message-ID:
Hiya.
One might consider...
...although in the example you cite, the end tags can be infered.
I noted well the advice that you not use XML for config files. At the end of
the day it's a matter of personal taste, but have found that if one pays
attention to extensible ways of expressing config, rather than literal
notation in XML format, XML configs work well.
Why for the example you give do you not simply....
If you use namespaces it clears up a lot of anxiety about confusing the
model of the config from expression of the content.
One might also question why you are not simply relying upon XSL to know how
to represent and "example", given that the config I expressed above is only
a hop, skip and a jump from XSL anyway.
XSLT is very good at mapping from one data model to another. Why reinvent
the wheel?
So in short: I like XML for config descriptions. Concentrate on expressing
your data, not literally notating it... think in terms of "what do I *need*
to know to process this?", and exclude the rest.
If I've misunderstood your intent or requirements please correct me.
Cheers
Guy.
-----Original Message-----
From: Stephan Tolksdorf [mailto:andorxor@gmx.de]
Sent: 9 November 2000 12:33
To: xml-sig@python.org
Subject: [XML-SIG] XML appropiate for config files of a xml processor?
Hello,
this a design question not directly related to Python.
I'm writing a small homegrown xml processor which is mainly
intended for transforming xml files to html.
At the moment it is configurable by config files written in xml.
But these config files are not easy to manually read or edit as you
have to escape <,>,".
For example a mapping for a xml-tag could look like
this:
<p><p><b></b></p>
The processor should now transform
"test"
into
"
test
".
Obviously you have to use a special XML-Editor to edit these type of
config files.
So, would you say this is an acceptable drawback in comparison to the
flexibility and ease of use of xml as the config file format?
Or would you say one should use a custom format for these config files?
Maybe you could point me to a config file format actually in use with
such type of processor?
I'd be thankful for your answers.
Best Regards,
Stephan Tolksdorf
_______________________________________________
XML-SIG maillist - XML-SIG@python.org
http://www.python.org/mailman/listinfo/xml-sig
From larsga@garshol.priv.no Thu Nov 9 13:18:25 2000
From: larsga@garshol.priv.no (Lars Marius Garshol)
Date: 09 Nov 2000 14:18:25 +0100
Subject: [XML-SIG] xml silly question
In-Reply-To:
References:
Message-ID:
(Sorry that I could not reply before; I have been having DNS problems.)
* Alexandre Fayolle
|
| Is it valid xml to have an attribute with an empty string as a value ?
To be valid an XML document must have a DTD to which it conforms. So
the correct answer to your question is that it depends on the type of
the attribute. For some, like CDATA, an empty string will be valid,
but for others, like ID, IDREF and NMTOKEN, it will not be.
However, regardless of what the DTD says, attributes with empty string
values will always be well-formed.
--Lars M.
From tpassin@home.com Thu Nov 9 13:34:38 2000
From: tpassin@home.com (Thomas B. Passin)
Date: Thu, 9 Nov 2000 08:34:38 -0500
Subject: [XML-SIG] XML appropiate for config files of a xml processor?
References: <12314247456.20001109133313@email.com>
Message-ID: <002401c04a51$cf2b4620$7cac1218@reston1.va.home.com>
Stephan Tolksdorf asked -
> this a design question not directly related to Python.
>
> I'm writing a small homegrown xml processor which is
mainly
> intended for transforming xml files to html.
>
> At the moment it is configurable by config files written
in xml.
> But these config files are not easy to manually read or
edit as you
> have to escape <,>,".
> For example a mapping for a xml-tag could look like
> this:
>
> <p><p><b>
> </b></p>
>
>
Don't include the markup in a markup definition! If you are
defining a starttag, your processor should know to supply
the "<", for example. There's no reason to include it in
the config definitions.
What's wrong with xslt with ?
If your config files have only one level of structure, use a
simple file format like
property:value
You can easily split this on the separator. If you need two
levels, use two separators - I have used a back-tick for
this (`) since it rarely appears in ordinary text. You
first split on the ":", then split each piece on the "`".
Or you can write the config file as a Python dictionary.
You can read it into the program and then convert to a real
dictionary using eval(). A dictionary is reasonably easy to
read and write by hand. I've done this too. ANy of these
approachs is extremely simple to code for, and it is easy to
write the config file by hand.
Cheers,
Tom Passin
From Stephan Tolksdorf Thu Nov 9 14:38:34 2000
From: Stephan Tolksdorf (Stephan Tolksdorf)
Date: Thu, 9 Nov 2000 15:38:34 +0100
Subject: Re[2]: [XML-SIG] XML appropiate for config files of a xml processor?
Message-ID: <15921768291.20001109153834@email.com>
Thanks for the many answers.
Nicolas Chauvat wrote:
> Why don't you just use 4xslt, the XSL processor that comes with PyXML and
> is maintained by 4Suite?
Mainly because my processor is a kind of programming exercise.
Secondly I think there could be a right to exist for a processor that
operates on a lower level than XSL and is easier to learn, at least
for my needs.
Guy Murphy wrote:
> One might consider...
>
>
>
>
>
This isn't really more easy to read or edit...
> Why for the example you give do you not simply....
>
>
>
>
>
>
>
This is an interesting approach but not suitable for my case as the
content of is not supposed to be correct xml in all
cases. Internally it is interpreted and processed as pure text.
Maybe I'll just use Python dictionaries but don't think it would be
the ideal solution...
Thanks again.
Stephan Tolksdorf
Best Regards,
Stephan Tolksdorf
From GuyM@eurodatasystems.com Thu Nov 9 15:07:25 2000
From: GuyM@eurodatasystems.com (Guy Murphy)
Date: Thu, 9 Nov 2000 15:07:25 -0000
Subject: Re[2]: [XML-SIG] XML appropiate for config files of a xml pro
cessor?
Message-ID:
Hiya.
OK, I take your point that there's concern over using XML. I use a
tuple-like format where readability is an issue, especialy for output during
dev...
(example
(start
(p)(p)(b)
)
(content)
(end
(b)(p)(p)
)
)
...::shrug:: its a little easier to read than XML and easy to parse into
XML.
For attributes and content I use...
(elementName @attr val @attr2 val2
-content here
)
I think ESIS (or is it ISIS? cant remember the name) is a similar format,
and I think there's some code for it among the Python SAX stuff. Have a dig
around, or somebody might know and pipe up.
If readability is key, then you'll just have to come up with your own
readable format and parse it...
I personally think that dictionaries look great too for simple named node
stuff, but tastes vary.
I've python code working with this sort of format somewhere, but not sure
where. Or I've C# code at hand, reading and writing to this format alongside
an XML reader and writer. As I said I use it a lot during development when
XML starts to hurt the eyes. Let me know if you want it.
But we're now way off topic =)
Cheers
Guy.
-----Original Message-----
From: Stephan Tolksdorf [mailto:andorxor@gmx.de]
Sent: 9 November 2000 14:39
To: xml-sig@python.org
Subject: Re[2]: [XML-SIG] XML appropiate for config files of a xml
processor?
Thanks for the many answers.
Nicolas Chauvat wrote:
> Why don't you just use 4xslt, the XSL processor that comes with PyXML and
> is maintained by 4Suite?
Mainly because my processor is a kind of programming exercise.
Secondly I think there could be a right to exist for a processor that
operates on a lower level than XSL and is easier to learn, at least
for my needs.
Guy Murphy wrote:
> One might consider...
>
>
>
>
>
This isn't really more easy to read or edit...
> Why for the example you give do you not simply....
>
>
>
>
>
>
>
This is an interesting approach but not suitable for my case as the
content of is not supposed to be correct xml in all
cases. Internally it is interpreted and processed as pure text.
Maybe I'll just use Python dictionaries but don't think it would be
the ideal solution...
Thanks again.
Stephan Tolksdorf
Best Regards,
Stephan Tolksdorf
_______________________________________________
XML-SIG maillist - XML-SIG@python.org
http://www.python.org/mailman/listinfo/xml-sig
From rsalz@caveosystems.com Thu Nov 9 15:19:35 2000
From: rsalz@caveosystems.com (Rich Salz)
Date: Thu, 09 Nov 2000 10:19:35 -0500
Subject: [XML-SIG] XML appropiate for config files of a xml processor?
References: <12314247456.20001109133313@email.com>
Message-ID: <3A0AC087.96578837@caveosystems.com>
You might look at the the XSLT syntax. You might also want to look at
CDATA (section 2.7 of the XML spec)
>
> <p><p><b>
> </b></p>
>
Becomes
]]>]]>
From andorxor@gmx.de Thu Nov 9 16:01:20 2000
From: andorxor@gmx.de (Stephan Tolksdorf)
Date: Thu, 9 Nov 2000 17:01:20 +0100
Subject: Re[2]: [XML-SIG] XML appropiate for config files of a xml pro cessor?
In-Reply-To:
References:
Message-ID: <12526734271.20001109170120@email.com>
Hello Guy,
thanks again for your answer.
> If readability is key, then you'll just have to come up with your own
> readable format and parse it...
I'm finally convinced to go this way. Sure you could use
Voici le site de jeux sur lequel Michčle a gagné 10 000 Balles.
www.duoloto.com
A+
Eric ;-))
From Mike.Olson@fourthought.com Fri Nov 10 03:32:07 2000
From: Mike.Olson@fourthought.com (Mike Olson)
Date: Thu, 09 Nov 2000 20:32:07 -0700
Subject: [XML-SIG] Re: [4suite] Converting a DOM-tree with XSL
References: <200011062306.AAA00892@loewis.home.cs.tu-berlin.de>
Message-ID: <3A0B6C37.4411D0C1@FourThought.com>
"Martin v. Loewis" wrote:
>
> > > I want to build an DOM tree from the results of database queries
> > > and to convert this tree to HTML via XSL.
> > > The transformation with Processor from xml.xslt works well if I use
> > > FromXmlFile from ml.dom.ext.reader.Sax to build the DOM tree.
> > > But if I use the DOM-builder (xml.dom.builder) instead, I get the
> >
> > This package, as well as core.py are obsolete packages from PyXml
> > 0.5.5.1. You should not be using them.
>
> I'm not sure I understand the problem here. If he was using PyXML
> 0.6.1, there would not be any xml.dom.builder, nor does any online
> documentation claim there is (if that's incorrect, please let me know).
>
> However, if he does use 0.5.x, what's wrong with using
> xml.dom.builder? It won't give you a 4DOM tree, and yes, it is not
> included in later releases anymore - but that doesn't help users who
> can't or won't upgrade.
>
If I remember the thread, he is passing the DOM into 4XSLT. I don't
think 4XSLT works with the old DOM.
Mike
>
> Regards,
> Martin
> _______________________________________________
> 4suite mailing list
> 4suite@lists.fourthought.com
> http://lists.fourthought.com/mailman/listinfo/4suite
--
Mike Olson Principal Consultant
mike.olson@fourthought.com (303)583-9900 x 102
Fourthought, Inc. http://Fourthought.com
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From johann@egenetics.com Fri Nov 10 11:49:01 2000
From: johann@egenetics.com (Johann Visagie)
Date: Fri, 10 Nov 2000 13:49:01 +0200
Subject: [XML-SIG] Problem with 0.6.1's sax.writer
Message-ID: <20001110134901.A32261@fling.sanbi.ac.za>
Busy trying to port a half-written application from Python 1.5.2 + PyXML
0.5.4 to Python 2.0 + PyXML 0.6.1, and getting a bit lost.
PyXML 0.6.1's sax.writer repeatedly calls xml.utils.escape(), which results
in an AttributeError.
This can seemingly be fixed by replacing them with calls to
xml.sax.saxutils.escape()
Is this an error, or am I misinterpreting things?
-- Johann
From larsga@garshol.priv.no Fri Nov 10 11:53:53 2000
From: larsga@garshol.priv.no (Lars Marius Garshol)
Date: 10 Nov 2000 12:53:53 +0100
Subject: [XML-SIG] Problem with 0.6.1's sax.writer
In-Reply-To: <20001110134901.A32261@fling.sanbi.ac.za>
References: <20001110134901.A32261@fling.sanbi.ac.za>
Message-ID:
* Johann Visagie
|
| PyXML 0.6.1's sax.writer repeatedly calls xml.utils.escape(), which
| results in an AttributeError.
|
| This can seemingly be fixed by replacing them with calls to
| xml.sax.saxutils.escape()
|
| Is this an error, or am I misinterpreting things?
You are right in that the function has moved, though whether that was
deliberate or a mistake I am not sure. Personally I feel that the
function does not belong at all in saxutils, but it might be that this
was done because of the Python 2.0 bundling issues.
--Lars M.
From martin@loewis.home.cs.tu-berlin.de Sat Nov 11 10:47:01 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Sat, 11 Nov 2000 11:47:01 +0100
Subject: [XML-SIG] XML appropiate for config files of a xml processor?
In-Reply-To: <12314247456.20001109133313@email.com> (message from Stephan
Tolksdorf on Thu, 9 Nov 2000 13:33:13 +0100)
References: <12314247456.20001109133313@email.com>
Message-ID: <200011111047.LAA01033@loewis.home.cs.tu-berlin.de>
> Maybe you could point me to a config file format actually in use with
> such type of processor?
As others have proposed already: It seems that this kind of
transformation is best done with an XSLT processor.
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Sat Nov 11 11:16:28 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Sat, 11 Nov 2000 12:16:28 +0100
Subject: [XML-SIG] PyXML-0_6_1_win32-py_2_0.exe
In-Reply-To: <200011090520.NAA20982@ms5.hinet.net> (frank63@ms5.hinet.net)
References: <200011090520.NAA20982@ms5.hinet.net>
Message-ID: <200011111116.MAA01142@loewis.home.cs.tu-berlin.de>
> I found that this win32 package seems cannot run on WinNT 4.0 & Service
> Pack 1.0?
What was the error that you got?
Martin
From martin@loewis.home.cs.tu-berlin.de Sat Nov 11 11:16:02 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Sat, 11 Nov 2000 12:16:02 +0100
Subject: [XML-SIG] [ANNOUNCE] xmltools
In-Reply-To: (message
from Alexandre Fayolle on Wed, 8 Nov 2000 20:31:48 +0100 (CET))
References:
Message-ID: <200011111116.MAA01127@loewis.home.cs.tu-berlin.de>
> Python XmlTools is a set of high level graphical components to help using
> XML in python applications.
I've added a link to it on the XML topic guide.
Martin
From martin@loewis.home.cs.tu-berlin.de Sat Nov 11 11:20:08 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Sat, 11 Nov 2000 12:20:08 +0100
Subject: [XML-SIG] PyXML-0_6_1_win32-py_2_0.exe
In-Reply-To: <200011090231.KAA26496@ms5.hinet.net> (frank63@ms5.hinet.net)
References: <200011090231.KAA26496@ms5.hinet.net>
Message-ID: <200011111120.MAA01180@loewis.home.cs.tu-berlin.de>
> After executing this run file, where are the files?
You should not need to care; "import xml.dom.ext.reader" should be
able to find it. Anyway, it should install the files into the Python
2.0 directory, i.e. c:\python20.
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Sat Nov 11 11:28:27 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Sat, 11 Nov 2000 12:28:27 +0100
Subject: [XML-SIG] location handling in pyexpat
In-Reply-To: <20001109114441.A3206@Speedy.Free-System.com> (message from
Speedy on Thu, 9 Nov 2000 11:44:41 +0100)
References: <20001109114441.A3206@Speedy.Free-System.com>
Message-ID: <200011111128.MAA01244@loewis.home.cs.tu-berlin.de>
> This example is a (useless) python script.
>
> $ Example.py Element_Name XML_File
>
> It uses pyexpat to scan the file XML_File and display the position
> of the elements named Element_Name.
>
> Do you think these changes can become part of the next version of
> pyxml, or do I need to rethink about it ?
I guess you should. When I run your example with some xml file in
PyXML 0.6.1, e.g. as
python Example.py history commonEuc.xml
it prints
Found history element at (2,9)
So it is not clear to me what bug you try to fix - it already gives
you location information even without your patch.
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Sat Nov 11 11:45:54 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Sat, 11 Nov 2000 12:45:54 +0100
Subject: [XML-SIG] Problem with 0.6.1's sax.writer
In-Reply-To: <20001110134901.A32261@fling.sanbi.ac.za> (message from Johann
Visagie on Fri, 10 Nov 2000 13:49:01 +0200)
References: <20001110134901.A32261@fling.sanbi.ac.za>
Message-ID: <200011111145.MAA01393@loewis.home.cs.tu-berlin.de>
> Is this an error, or am I misinterpreting things?
Thanks for reporting the error. I have fixed it in the CVS, so it will
be included in PyXML 0.6.2.
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Sat Nov 11 11:48:14 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Sat, 11 Nov 2000 12:48:14 +0100
Subject: [XML-SIG] Problem with 0.6.1's sax.writer
In-Reply-To: (message from Lars Marius
Garshol on 10 Nov 2000 12:53:53 +0100)
References: <20001110134901.A32261@fling.sanbi.ac.za>
Message-ID: <200011111148.MAA01408@loewis.home.cs.tu-berlin.de>
> You are right in that the function has moved, though whether that was
> deliberate or a mistake I am not sure. Personally I feel that the
> function does not belong at all in saxutils, but it might be that this
> was done because of the Python 2.0 bundling issues.
I'd agree that it does not belong there. However, since it is now
there as part of Python 2.0, that effectively its the official
location. I had removed the backwards-compatible support which
duplicated it in xml.utils some time ago, but apparently
xml.sax.writer slipped through.
Regards,
Martin
From partain@dcs.gla.ac.uk Sat Nov 11 16:33:48 2000
From: partain@dcs.gla.ac.uk (Will Partain)
Date: Sat, 11 Nov 2000 16:33:48 +0000
Subject: [XML-SIG] XML/python approach to "smooshing docs together"?
Message-ID: <200011111633.QAA00122@slicker.dcs.gla.ac.uk>
Folks, here's a puzzler of the "I'm sure someone's figured
this out" type... Seeking pointers, ideas, direction, ...
The context is the Arusha Project
(http://ark.sourceforge.net/), which is trying to crack the
problem of collaborative Unix system administration. We're
also gunning for a *universal* framework for expressing
system configurations, i.e. you might use it for hosts,
packages, users, web sites, vendor interactions, etc. It
also needs to be comparatively *simple*.
A metaphor I'm thinking about is overlapping transparencies.
Imagine that I draw three tree-like diagrams (yes, XML docs
:-) to describe hosts:
#1 Shows the distinctive things about my Sun 'slicker',
e.g. its name and IP address:
slicker221.170.160.25
#2 Shows the general stuff about how I plan to set up all
of the Suns at my site; e.g.:
/84MB/usr/local128MB
#3 Shows stuff that is probably true of all Suns everywhere:
Now, what if I line these three documents up at and
shine a light through them -- what do I see? I would hope
that, all together, they tell me *everything* there is to
know about my machine 'slicker'.
How might you define, precisely, such a "smooshing together"
system?
* How do you "line up" the transparencies so you can look at
them?
* Say you have 10 transparencies... in what order do you do
the pair-wise "smooshing"?
* Various rules for "top-layer wins", "bottom-layer wins",
"layers combined into a list", etc.
* Some sort of "type system" that helps to say whether the
overall "smoosh" makes sense. ???
I can imagine something similar prevails in a document
world. Imagine a "general info about something" document
and a "site-local info about the same something" document;
how do those get "smooshed together"? It seems like there
is a useful general problem to be solved...
All ideas gratefully received... And if any of you
Python/XML gurus want to hang out on our ark-dev mailing
list and keep us straight on these kinds of these, I would
be *most pleased*.
Will
From tpassin@home.com Sat Nov 11 17:06:44 2000
From: tpassin@home.com (Thomas B. Passin)
Date: Sat, 11 Nov 2000 12:06:44 -0500
Subject: [XML-SIG] XML/python approach to "smooshing docs together"?
References: <200011111633.QAA00122@slicker.dcs.gla.ac.uk>
Message-ID: <004001c04c01$c4ff0720$7cac1218@reston1.va.home.com>
Will Partain asks -
>
> How might you define, precisely, such a "smooshing
together"
> system?
>
> * How do you "line up" the transparencies so you can look
at
> them?
>
> * Say you have 10 transparencies... in what order do you
do
> the pair-wise "smooshing"?
>
Don't think about layers "winning". Use XML to tell you
what each layer really is. In your example, wrap each of
the three "layers" in its own wrapper:
slicker221.170.160.25/84MB/usr/local128MB
This do what you want? The other issues sound non-xml-ish.
E.g.,
> * Say you have 10 transparencies... in what order do you
do
> the pair-wise "smooshing"?
>
Depends on what you want to do it for ... sounds like a user
interface issue (that makes it the hardest kind!).
Cheers,
Tom Passin
From martin@loewis.home.cs.tu-berlin.de Sat Nov 11 23:52:50 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Sun, 12 Nov 2000 00:52:50 +0100
Subject: [XML-SIG] XML/python approach to "smooshing docs together"?
In-Reply-To: <200011111633.QAA00122@slicker.dcs.gla.ac.uk> (message from Will
Partain on Sat, 11 Nov 2000 16:33:48 +0000)
References: <200011111633.QAA00122@slicker.dcs.gla.ac.uk>
Message-ID: <200011112352.AAA00709@loewis.home.cs.tu-berlin.de>
> All ideas gratefully received...
It is certainly easy to combine the three XML files in a single parse
with a good SAX ContentHandler. Use a PyXML
xml.sax.saxutils.XMLGenerator as a base class, but keep an option in
it to ignore a sequence of starting and closing tags.
When parsing the first document, output
slicker221.170.160.25
When parsing the second one, output
/84MB/usr/local128MB
And when parsing the third one, output
If you need more complex merge operations, you can try merging DOM
trees, or use XSLT.
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Sun Nov 12 10:00:06 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Sun, 12 Nov 2000 11:00:06 +0100
Subject: [XML-SIG] PyXML 0.6.1 and Solaris
In-Reply-To: <20001102103859.A13473@postal.il.thewrittenword.com> (message
from Albert Chin-A-Young on Thu, 2 Nov 2000 10:38:59 -0600)
References: <20001102103859.A13473@postal.il.thewrittenword.com>
Message-ID: <200011121000.LAA00773@loewis.home.cs.tu-berlin.de>
> Turnes out that the autoconf script to select the correct dynload_*.c
> file is broken for Solaris. Patch below (submitted to SourceForge too).
This patch doesn't look right to me. Furthermore, on my system
(Solaris 2.6 with gcc), configure perfectly determines to use
dynload_shlib. That is because of the line
# the dlopen() function means we might want to use dynload_shlib.o. some
# platforms, such as AIX, have dlopen(), but don't want to use it.
AC_CHECK_FUNCS(dlopen)
which is executed before the DYNLOADFILE variable is set.
Can you please try to analyse why the first attempt to determine
presence of dlopen fails?
Regards,
Martin
From Nicolas.Chauvat@logilab.fr Sun Nov 12 13:03:14 2000
From: Nicolas.Chauvat@logilab.fr (Nicolas Chauvat)
Date: Sun, 12 Nov 2000 14:03:14 +0100 (CET)
Subject: [XML-SIG] [OffTopic?] ... "smooshing docs together"?
In-Reply-To: <200011111633.QAA00122@slicker.dcs.gla.ac.uk>
Message-ID:
On Sat, 11 Nov 2000, Will Partain wrote:
> Seeking pointers, ideas, direction, ...
To merge those informations, I'd suggest reading all of those files in any
order, adding an attributes "from" to the nodes and using "priority rules"
to decide whether to override or not the value.
For files
config1
and
config2
with a set of rules such as
softwarehostsite
you'd end up with
config2config1
because the rule said the host-specific values for software would override
the site-specific ones.
As rules can be quite complex, you can do fairly advanced stuff
(checking for coherence and all) and even get to hide lots of bugs in the
ruleset itself. The good point is that the mechanism is explicitly stating
what will override what in what situation.
That's my 0,2 euros, it sure needs more thinking/adaptation.
As for the pointers, you may look for subsumption architectures and rule
based systems. There is currently a rule/XML effort going on at
www.dfki.de/ruleml, you'll probably find stuff there. At least a better
syntax for your rules than the one I just gave you ;-)
--=20
Nicolas Chauvat
http://www.logilab.com - "Mais o=F9 est donc Ornicar ?" - LOGILAB, Paris (F=
rance)
From larsga@garshol.priv.no Sun Nov 12 13:13:44 2000
From: larsga@garshol.priv.no (Lars Marius Garshol)
Date: 12 Nov 2000 14:13:44 +0100
Subject: [XML-SIG] XML/python approach to "smooshing docs together"?
In-Reply-To: <200011112352.AAA00709@loewis.home.cs.tu-berlin.de>
References: <200011111633.QAA00122@slicker.dcs.gla.ac.uk> <200011112352.AAA00709@loewis.home.cs.tu-berlin.de>
Message-ID:
* Martin v. Loewis
|
| It is certainly easy to combine the three XML files in a single
| parse with a good SAX ContentHandler. Use a PyXML
| xml.sax.saxutils.XMLGenerator as a base class, but keep an option in
| it to ignore a sequence of starting and closing tags.
That is one approach, but it's only really useful it you want to parse
the documents only to create a new serialized XML document in the form
of a file.
If you want to make use of the merged document in a Python program it
is better to make a parser filter. See saxutils.XMLFilterBase.
--Lars M.
From larsga@garshol.priv.no Sun Nov 12 13:19:25 2000
From: larsga@garshol.priv.no (Lars Marius Garshol)
Date: 12 Nov 2000 14:19:25 +0100
Subject: [XML-SIG] XML/python approach to "smooshing docs together"?
In-Reply-To: <200011111633.QAA00122@slicker.dcs.gla.ac.uk>
References: <200011111633.QAA00122@slicker.dcs.gla.ac.uk>
Message-ID:
* Will Partain
|
| How might you define, precisely, such a "smooshing together"
| system?
Well, the first thing you need to do is to define your operation much
better. Are you looking for something that is general for all XML
documents? If so, what are the rules for 'smooshing'? Or is this
operation specific to your configuration data? If it is, are you sure
that the best thing to do is to implement it on the XML level?
I think my advice to you is to clarify your question. Are you looking
for help in figuring out what it is you want, or do you know what you
want and am seeking implementation design help.
| I can imagine something similar prevails in a document world.
| Imagine a "general info about something" document and a "site-local
| info about the same something" document; how do those get "smooshed
| together"? It seems like there is a useful general problem to be
| solved...
One way to handle this problem that I've seen is to use inheritance.
The documents are arranged in folders, folders and documents both have
metadata properties and some properties are inherited from folders to
sub-folders and contained documents. In some cases inheritance may
also be overridden. This has worked fairly well in some cases.
Another way to handle this is the approach taken by topic maps, which
define how two topics can be merged when one discovers that they are
really one and the same thing. However, topic maps deal with this
through the concept of scope, which is non-trivial to translate to
XML.
--Lars M.
From Mike.Olson@fourthought.com Sun Nov 12 19:30:36 2000
From: Mike.Olson@fourthought.com (Mike Olson)
Date: Sun, 12 Nov 2000 12:30:36 -0700
Subject: [XML-SIG] XML/python approach to "smooshing docs together"?
References: <200011111633.QAA00122@slicker.dcs.gla.ac.uk> <004001c04c01$c4ff0720$7cac1218@reston1.va.home.com>
Message-ID: <3A0EEFDC.67ABE2F@FourThought.com>
"Thomas B. Passin" wrote:
>
> Will Partain asks -
>
> >
> > How might you define, precisely, such a "smooshing
> together"
> > system?
> >
> > * How do you "line up" the transparencies so you can look
> at
> > them?
> >
> > * Say you have 10 transparencies... in what order do you
> do
> > the pair-wise "smooshing"?
> >
>
> Don't think about layers "winning". Use XML to tell you
> what each layer really is. In your example, wrap each of
> the three "layers" in its own wrapper:
>
>
>
>
> slicker
> 221.170.160.25
>
>
>
>
>
>
>
> /
> 84MB
>
>
> /usr/local
> 128MB
>
>
>
>
>
>
>
>
>
>
>
>
>
> This do what you want? The other issues sound non-xml-ish.
> E.g.,
If your finally UI is HTML, then you could use XSLT to "smoosh" the data
and dislpay it. It would be a pretty simple tranform depending on how
complex you rules are to combin.
IP Address:
You can also add logic to not display things that have been "overridden"
at higher level.
Mike
>
> > * Say you have 10 transparencies... in what order do you
> do
> > the pair-wise "smooshing"?
> >
>
> Depends on what you want to do it for ... sounds like a user
> interface issue (that makes it the hardest kind!).
>
> Cheers,
>
> Tom Passin
>
> _______________________________________________
> XML-SIG maillist - XML-SIG@python.org
> http://www.python.org/mailman/listinfo/xml-sig
--
Mike Olson Principal Consultant
mike.olson@fourthought.com (303)583-9900 x 102
Fourthought, Inc. http://Fourthought.com
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From titus@caltech.edu Mon Nov 13 07:16:43 2000
From: titus@caltech.edu (Titus Brown)
Date: Sun, 12 Nov 2000 23:16:43 -0800
Subject: [XML-SIG] Question re: 4DOM dom.ext.Printer
Message-ID: <20001112231643.A5868@cns.caltech.edu>
Hi,
I'm in the process of updating Christian Scholz's Python DAV server
(comlounge.net/webdav/) to work with the latest 4Suite release,
and I am using Greg Stein's 'davtest.py' to run through a series
of code tests.
The server is sending out what appears to me to be badly formed XML:
it is leading with
My handy-dandy little XML Pocket Reference (O'Reilly) tells me that
processing instructions should be closed with a '?':
In order to get the code to emit this trailing '?', I had to edit
xml/dom/ext/Printer.py:176 and change the self.stream.write statement.
Was this indeed incorrect behavior & is the change correct?
I'm using xml/dom from 4Suite-0.9.1, which is the latest release.
cheers,
--titus
P.S. I'm doing this partly to learn my way around Python's XML utilities,
so my apologies if this is a naive question...
From guenter@ubka.uni-karlsruhe.de Mon Nov 13 10:58:51 2000
From: guenter@ubka.uni-karlsruhe.de (Guenter Radestock)
Date: Mon, 13 Nov 2000 11:58:51 +0100
Subject: [XML-SIG] Python module for the Sablotron XSL processor
Message-ID: <20001113115851.A36327@ubka.uni-karlsruhe.de>
I have just uploaded version 0.4 of Sab-pyth, the Python interface for
the Sablotron XSL processor to our website at:
http://www.ubka.uni-karlsruhe.de/~guenter/Sab-pyth/
This new version has support for all four Sablotron handler types
(SchemeHandler, MessageHandler, SAXHandler, MiscHandler), also a few bug
fixes and updates to the documentation. I did not manage to put in
support for distutils so far (there is a broken setup.py included -
please do not attempt to use this).
I shamelessly copied parts of the Sablotron headers into the
documentation - this part still needs a lot of work, but it is better
than nothing, especially to those who do not know about the C interface
to Sablotron.
Thanks to all who sent me comments on the last version - it helped a lot
at places. Any more comments are allways welcome. Is anybody using
this and the XSL processor that comes with 4Dom? I would be very
interested in a performance comparison...
--
Guenter Radestock, Universitaetsbibliothek Karlsruhe
guenter@ubka.uni-karlsruhe.de
http://www.ubka.uni-karlsruhe.de/~guenter
From uche.ogbuji@fourthought.com Mon Nov 13 16:47:24 2000
From: uche.ogbuji@fourthought.com (uche.ogbuji@fourthought.com)
Date: Mon, 13 Nov 2000 09:47:24 -0700
Subject: [XML-SIG] Question re: 4DOM dom.ext.Printer
In-Reply-To: Message from Titus Brown
of "Sun, 12 Nov 2000 23:16:43 PST." <20001112231643.A5868@cns.caltech.edu>
Message-ID: <200011131647.JAA28293@localhost.localdomain>
> The server is sending out what appears to me to be badly formed XML:
> it is leading with
>
>
>
> My handy-dandy little XML Pocket Reference (O'Reilly) tells me that
> processing instructions should be closed with a '?':
>
>
>
> In order to get the code to emit this trailing '?', I had to edit
> xml/dom/ext/Printer.py:176 and change the self.stream.write statement.
> Was this indeed incorrect behavior & is the change correct?
>
> I'm using xml/dom from 4Suite-0.9.1, which is the latest release.
Yes, this was a silly bug in 4Suite 0.9.1 that we fixed a while back and
released a patch for, but of course there's no way you could have known that.
Aside: we really need to get a bug tracker going one of these days.
You fix is right on. We have begun packaging a 4Suite update with a _lot_ of
improvements, including this and many other bug fixes.
Note that since you said you were using 4DOM from 4Suite rather than from
PyXML, you might want to join the 4Suite mailing list, where we released the
bug report and fix.
http://lists.fourthought.com/mailman/listinfo/4suite
Thanks.
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From martin@loewis.home.cs.tu-berlin.de Mon Nov 13 19:56:04 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Mon, 13 Nov 2000 20:56:04 +0100
Subject: [XML-SIG] Question re: 4DOM dom.ext.Printer
In-Reply-To: <200011131647.JAA28293@localhost.localdomain>
(uche.ogbuji@fourthought.com)
References: <200011131647.JAA28293@localhost.localdomain>
Message-ID: <200011131956.UAA00936@loewis.home.cs.tu-berlin.de>
> Aside: we really need to get a bug tracker going one of these days.
Feel free to use the PyXML bug tracking on sourceforge.net; we can
create additional categories (e.g. 4XSLT, ...), whatever you want.
Tracking with SF is quite convenient - having set-up GNATS myself, I
can tell that administrating such a system is not fun.
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Mon Nov 13 23:12:01 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Tue, 14 Nov 2000 00:12:01 +0100
Subject: [XML-SIG] PyXML 0.6.2
Message-ID: <200011132312.AAA01465@loewis.home.cs.tu-berlin.de>
I just released PyXML 0.6.2, and I'd like to thank all contributors.
==================
Version 0.6.2 of the Python/XML distribution is now available. It
should be considered a beta release, and can be downloaded from
the following URLs:
http://download.sourceforge.net/pyxml/PyXML-0.6.2.tar.gz
http://download.sourceforge.net/pyxml/PyXML-0.6.2.win32-py1.5.exe
http://download.sourceforge.net/pyxml/PyXML-0.6.2.win32-py2.0.exe
http://download.sourceforge.net/pyxml/PyXML-0.6.2-1.5.2.i586.rpm
http://download.sourceforge.net/pyxml/PyXML-0.6.2-2.0.i586.rpm
Changes in this version, compared to 0.6.1:
* Synchronize with standard library from Python 2.0
* Updated to 4DOM from 4Suite 0.9.1. This corrects many
errors, see the 4Suite ChangeLog for details. Most notably,
the SAX reader interface has been expanded to support
arbitrary parsers, and a PyExpat reader class was added.
* Add minidom functions: normalize and hasAttribute.
* Fix a number of minor bugs.
* More tests pass now, in particular test_dom, and test/dom/test.
The Python/XML distribution contains the basic tools required for
processing XML data using the Python programming language, assembled
into one easy-to-install package. The distribution includes parsers
and standard interfaces such as SAX and DOM, along with various other
useful modules.
The package currently contains:
* XML parsers: Pyexpat (Jack Jansen), xmlproc (Lars Marius
Garshol), xmllib.py (Sjoerd Mullender) using the sgmlop.c accelerator
module (Fredrik Lundh).
* SAX interface (Lars Marius Garshol)
* DOM interface (Stefane Fermigier, A.M. Kuchling)
* 4DOM interface from Fourthought (Uche Ogbuji, Mike Olson)
* xmlarch.py, for architectural forms processing (Geir Ove Grønmo)
* Various utility modules and functions (various people)
* Documentation and example programs (various people)
The code is being developed bazaar-style by contributors from the
Python XML Special Interest Group, so please send comments, questions,
or bug reports to .
For more information about Python and XML, see:
http://www.python.org/topics/xml/
--
Martin v. Löwis http://www.informatik.hu-berlin.de/~loewis
From rb@ravenbrook.com Tue Nov 14 11:51:10 2000
From: rb@ravenbrook.com (Richard Brooksby)
Date: Tue, 14 Nov 2000 11:51:10 +0000
Subject: [XML-SIG] PyXML 0.6.2
In-Reply-To: <200011132312.AAA01465@loewis.home.cs.tu-berlin.de>
References: <200011132312.AAA01465@loewis.home.cs.tu-berlin.de>
Message-ID:
At 2000-11-14 00:12 +0100, Martin v. Loewis wrote:
>I just released PyXML 0.6.2, and I'd like to thank all contributors.
I'd be grateful if someone could supply me with a built version of
PyXML for Mac, compatible with Mac Python 2.0.
From teg@redhat.com Tue Nov 14 19:56:57 2000
From: teg@redhat.com (Trond Eivind =?iso-8859-1?q?Glomsr=F8d?=)
Date: 14 Nov 2000 14:56:57 -0500
Subject: [XML-SIG] PyXML 0.6.2
In-Reply-To: "Martin v. Loewis"'s message of "Tue, 14 Nov 2000 00:12:01 +0100"
References: <200011132312.AAA01465@loewis.home.cs.tu-berlin.de>
Message-ID:
"Martin v. Loewis" writes:
> I just released PyXML 0.6.2, and I'd like to thank all contributors.
>
> ==================
> Version 0.6.2 of the Python/XML distribution is now available. It
> should be considered a beta release, and can be downloaded from
> the following URLs:
>
> http://download.sourceforge.net/pyxml/PyXML-0.6.2.tar.gz
> http://download.sourceforge.net/pyxml/PyXML-0.6.2.win32-py1.5.exe
> http://download.sourceforge.net/pyxml/PyXML-0.6.2.win32-py2.0.exe
> http://download.sourceforge.net/pyxml/PyXML-0.6.2-1.5.2.i586.rpm
> http://download.sourceforge.net/pyxml/PyXML-0.6.2-2.0.i586.rpm
Is it available form anywhere else? Sourceforge seems to be having
problems...
Also:
> Changes in this version, compared to 0.6.1:
>
> * Synchronize with standard library from Python 2.0
But still compatible with Python 1.5.2?
> * Updated to 4DOM from 4Suite 0.9.1. This corrects many
> errors, see the 4Suite ChangeLog for details. Most notably,
> the SAX reader interface has been expanded to support
> arbitrary parsers, and a PyExpat reader class was added.
There seem to be multiple files which are common for these two
packages... any hope of a synchronization soon, so no file is part of
both packages? Also, would the best way to deal with this now be to
include the files from PyXML instead of 4Suite when both contain
(possibly different versions of) it?
--
Trond Eivind Glomsrød
Red Hat, Inc.
From teg@redhat.com Tue Nov 14 20:58:53 2000
From: teg@redhat.com (Trond Eivind =?iso-8859-1?q?Glomsr=F8d?=)
Date: 14 Nov 2000 15:58:53 -0500
Subject: [XML-SIG] Entity tralation in XSLT
Message-ID:
Are there known problems with entity handling in XSLT with PyXML-0.5.5.1 and
4Suite 0.9.1?
[teg@halden teg]$ cat foo.xsl
<MAGIC>=
[teg@halden teg]$ cat foo.xml
Xyzzy!
[teg@halden teg]$ 4xslt -o bar foo.xml foo.xsl
[teg@halden teg]$ cat bar
<MAGIC>=Xyzzy!
[teg@halden teg]$
This is an simple example, but it also happens in more complex
documents - > is translated, < isn't
--
Trond Eivind Glomsrød
Red Hat, Inc.
From martin@loewis.home.cs.tu-berlin.de Tue Nov 14 22:54:06 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Tue, 14 Nov 2000 23:54:06 +0100
Subject: [XML-SIG] PyXML 0.6.2
In-Reply-To: (message from Richard
Brooksby on Tue, 14 Nov 2000 11:51:10 +0000)
References: <200011132312.AAA01465@loewis.home.cs.tu-berlin.de>
Message-ID: <200011142254.XAA00736@loewis.home.cs.tu-berlin.de>
> >I just released PyXML 0.6.2, and I'd like to thank all contributors.
>
> I'd be grateful if someone could supply me with a built version of
> PyXML for Mac, compatible with Mac Python 2.0.
If anybody does so, I'd be happy to upload it to SF. In theory,
anybody with a compiler should just have to say "python setup.py
bdist" (are binary Mac distributions supported by distutils?). If that
fail, "python setup.py install" should suffice, then you just need to
archive site-packages/_xmlplus.
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Tue Nov 14 23:07:42 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Wed, 15 Nov 2000 00:07:42 +0100
Subject: [XML-SIG] PyXML 0.6.2
In-Reply-To: (teg@redhat.com)
References: <200011132312.AAA01465@loewis.home.cs.tu-berlin.de>
Message-ID: <200011142307.AAA00787@loewis.home.cs.tu-berlin.de>
> Is it available form anywhere else? Sourceforge seems to be having
> problems...
Not that I know of. I hope Andrew (or somebody else with access to
python.org) can copy at least the source distribution to the SIG's ftp
area.
Anybody else is encouraged to mirror that stuff; I'll happily include
pointers to mirrors on the topic guide.
> > * Synchronize with standard library from Python 2.0
>
> But still compatible with Python 1.5.2?
Certainly, yes. Actually, I only verified it passes the testsuite. If
you find problems, please report them as bugs.
> There seem to be multiple files which are common for these two
> packages... any hope of a synchronization soon, so no file is part of
> both packages?
I don't know. Personally, I'd be happy to include more of 4Suite in
PyXML (and I think more of the XML-SIG readership agree), but that
isn't just my decision.
> Also, would the best way to deal with this now be to include the
> files from PyXML instead of 4Suite when both contain (possibly
> different versions of) it?
I'd think so. There is no formal guarantee that PyXML is up-to-date
with 4Suite all of the time, but I'm open to suggestions to provide
mechanism: e.g. identify more people that are willing to produce PyXML
releases, either 4Suite people, or from the potential redistributors
(hint hint).
As a packager, I'd remove 4DOM from 4Suite when packaging it, and made
PyXML a prerequisite. I can well understand the reasons why
Fourthought doesn't use that approach, but the same reasons may not be
true for others producing packages.
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Tue Nov 14 23:11:20 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Wed, 15 Nov 2000 00:11:20 +0100
Subject: [XML-SIG] Entity tralation in XSLT
In-Reply-To: (teg@redhat.com)
References:
Message-ID: <200011142311.AAA00835@loewis.home.cs.tu-berlin.de>
> Are there known problems with entity handling in XSLT with
> PyXML-0.5.5.1 and 4Suite 0.9.1?
Not that I know of.
> This is an simple example, but it also happens in more complex
> documents - > is translated, < isn't
Can you please say why you think this is a problem?
Regards,
Martin
From teg@redhat.com Tue Nov 14 23:23:32 2000
From: teg@redhat.com (Trond Eivind =?iso-8859-1?q?Glomsr=F8d?=)
Date: 14 Nov 2000 18:23:32 -0500
Subject: [XML-SIG] Entity tralation in XSLT
In-Reply-To: "Martin v. Loewis"'s message of "Wed, 15 Nov 2000 00:11:20 +0100"
References:
<200011142311.AAA00835@loewis.home.cs.tu-berlin.de>
Message-ID:
"Martin v. Loewis" writes:
> > Are there known problems with entity handling in XSLT with
> > PyXML-0.5.5.1 and 4Suite 0.9.1?
>
> Not that I know of.
>
> > This is an simple example, but it also happens in more complex
> > documents - > is translated, < isn't
>
> Can you please say why you think this is a problem?
Because I need it ("<") in templates - I'm building complex
structures. "<" needs to be specified this way (AFAIK) to
differentiate between this and the start of a tag.
--
Trond Eivind Glomsrød
Red Hat, Inc.
From martin@loewis.home.cs.tu-berlin.de Tue Nov 14 23:52:05 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Wed, 15 Nov 2000 00:52:05 +0100
Subject: [XML-SIG] Entity tralation in XSLT
In-Reply-To: (teg@redhat.com)
References:
<200011142311.AAA00835@loewis.home.cs.tu-berlin.de>
Message-ID: <200011142352.AAA01063@loewis.home.cs.tu-berlin.de>
> Because I need it ("<") in templates - I'm building complex
> structures. "<" needs to be specified this way (AFAIK) to
> differentiate between this and the start of a tag.
=46rom http://www.w3.org/TR/xslt.html#literal-result-element
# In a template, an element in the stylesheet that does not belong to
# the XSLT namespace and that is not an extension element (see [14.1
# Extension Elements]) is instantiated to create an element node with
# the same expanded-name. The content of the element is a template,
# which is instantiated to give the content of the created element
# node. The created element node will have the attribute nodes that
# were present on the element node in the stylesheet tree, other than
# attributes with names in the XSLT namespace.
So if you want a element in the output, you should write
OTOH, if you want a less-than character in the output, you should
write < in the template. However, in the output, < *is* a
less-than character, since the output is also XML. From XSLT spec:
# Note that text is processed at the tree level. Thus, markup of <
# in a template will be represented in the stylesheet tree by a text
# node that includes the character <. This will create a text node in
# the result tree that contains a < character, which will be
# represented by the markup < (or an equivalent character
# reference) when the result tree is externalized as an XML document
# (unless output escaping is disabled as described in [16.4 Disabling
# Output Escaping]).
Seems pretty unambiguous to me.
Regards,
Martin
From uche.ogbuji@fourthought.com Wed Nov 15 01:11:11 2000
From: uche.ogbuji@fourthought.com (Uche Ogbuji)
Date: Tue, 14 Nov 2000 18:11:11 -0700
Subject: [XML-SIG] 4Suite 0.9.2 Release candidate
Message-ID: <3A11E2AF.F27D1F7E@fourthought.com>
We're pretty much ready to go, but are short of time for the final
announcements so we decided to instead send out a release candidate.
Barring any nasty bugs, we should have 4Suite 0.9.2 final out first
thing tomorrow morning.
We've provided Windows binaries as well as source so that the Windows
folks can help shake out any bugs. One note: we're having a stubborn
problem with cDomlette crashing with Windows and Python 2.0. We would
appreciate any help tracking this down, or maybe a report that it works
for someone out of the boz so we can narrow down the problem
configuration. Again to enable cDomlette, simply
set BETA_DOMLETTE=1
Also note that we'll have the revamped 4Suite.org out tonight. It will
still point to the old download files so get the release candidates from
ftp://Fourthought.com/pub/4Suite/
Look for the appropriate 4Suite-0.9.2rc1 package.
Thanks.
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From chaves@computer.org Wed Nov 15 02:39:46 2000
From: chaves@computer.org (John A Chaves)
Date: Tue, 14 Nov 2000 20:39:46 -0600
Subject: [XML-SIG] Re: [4suite] 4Suite 0.9.2 Release candidate
References: <3A11E2AF.F27D1F7E@fourthought.com>
Message-ID: <3A11F772.31B94003@computer.org>
Uche Ogbuji wrote:
>
> We're pretty much ready to go, but are short of time for the final
> announcements so we decided to instead send out a release candidate.
> Barring any nasty bugs, we should have 4Suite 0.9.2 final out first
> thing tomorrow morning.
It doesn't work with PyXML-0.6.2 because the timestamp of
_xmlplus/dom/html/__init__.py is later in PyXML-0.6.2 than in
4Suite-0.9.2, giving it installation preference. The solution
seems to be simply to touch 4Suite-0.9.2/Dom/html/__init__.py
to a later date. There may be other similar conflicts lurking...
John
Traceback (most recent call last):
File "/usr/local/bin/4xslt", line 4, in ?
from xml.xslt import _4xslt
File "/usr/local/lib/python2.0/site-packages/_xmlplus/xslt/_4xslt.py", line
20, in ?
from xml.xslt.Processor import Processor
File "/usr/local/lib/python2.0/site-packages/_xmlplus/xslt/Processor.py", line
20, in ?
from xml.xslt import RtfWriter, OutputHandler, OutputParameters, Error,
XsltException, FtElements
File "/usr/local/lib/python2.0/site-packages/_xmlplus/xslt/OutputHandler.py",
line 3, in ?
from xml.xslt import HtmlWriter, XmlWriter
File "/usr/local/lib/python2.0/site-packages/_xmlplus/xslt/HtmlWriter.py",
line 71, in ?
InitTables()
File "/usr/local/lib/python2.0/site-packages/_xmlplus/xslt/HtmlWriter.py",
line 35, in InitTables
from xml.dom.html import HTML_BOOLEAN_ATTRS
ImportError: cannot import name HTML_BOOLEAN_ATTRS
From wolfgang.grafen@marconi.com Wed Nov 15 09:42:04 2000
From: wolfgang.grafen@marconi.com (Wolfgang Grafen)
Date: Wed, 15 Nov 2000 10:42:04 +0100
Subject: [XML-SIG] w3schools
Message-ID: <3A125A6C.7693748@marconi.com>
Hi all,
following link provides an extremely helpful introduction
into the topic xml and other web-related matters:
http://www.w3schools.com/default.asp
I think this link should be mentioned in the
Python/XML Documentation link archive at:
http://pyxml.sourceforge.net/topics/docs.html
Gra.
From salleydelapretty@yahoo.com Wed Nov 15 09:41:58 2000
From: salleydelapretty@yahoo.com (Jennifer)
Date: Wed, 15 Nov 2000 09:41:58
Subject: [XML-SIG] I used to dress my little brother up like a girl . . .
Message-ID: <20001115144743.380161D13A@dinsdale.python.org>
http://www.usacallgirls.com/Links.html
My parents always wanted me to be nice to my little brother
Alex, but it was so hard. I mean he was such a little sissy
fuck.
What is an older sister supposed to do with a faggy little
brother who is always acting delicate and girly?
Well, I tried being nice, but then . . . he was just SUCH a
fairy.
I made up my mind that I was going to tease him. I did
everything in my power to drive him crazy. I'd walk around in
my underwear with no top, I'd leave the door open when I
peed.
And my god if he ever looked at me, or got a hard on!?! Boy
was he in trouble. I mean how disgusting for a little sissy
boy to look at me and want me. What kind of pathetic little
faggot was he anyway?
Well now its 15 years later . . .and of course my brother and
I get along great. To prove it we put together a web site to
celebrate our little Fetish. Its called Bitchy Sister.
We would love it if you came for a vist and took a look at our
preview pages. If you liked what I just said above, just you
wait until you see an ENTIRE site dedicated to it.
Bye for now and kisses,
Lucy Beil
http://www.usacallgirls.com/Links.html
From uche.ogbuji@fourthought.com Wed Nov 15 19:10:28 2000
From: uche.ogbuji@fourthought.com (uche.ogbuji@fourthought.com)
Date: Wed, 15 Nov 2000 12:10:28 -0700
Subject: [XML-SIG] Entity tralation in XSLT
In-Reply-To: Message from teg@redhat.com (Trond Eivind
=?iso-8859-1?q?Glomsr=F8d?=)
of "14 Nov 2000 15:58:53 EST."
Message-ID: <200011151910.MAA04697@localhost.localdomain>
> [teg@halden teg]$ cat foo.xsl
>
>
>
> <MAGIC>=3D
>
>
> [teg@halden teg]$ cat foo.xml
> Xyzzy!
> [teg@halden teg]$ 4xslt -o bar foo.xml foo.xsl
> [teg@halden teg]$ cat bar
> =
> <MAGIC>=3DXyzzy!
> [teg@halden teg]$
> =
> This is an simple example, but it also happens in more complex
> documents - > is translated, < isn't =
The output is technically correct, but I could understand that it's a bit=
=
confusing.
Our writer chooses not to escape '>' to '>' to improve readability of =
the =
output. This is perfectly legal. Escaping of '<' to '<' is mandatory=
, =
however.
If you let us know what output you want, we can help you get it. Perhaps=
you =
want to use .
-- =
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com =
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From uche.ogbuji@fourthought.com Wed Nov 15 19:15:18 2000
From: uche.ogbuji@fourthought.com (uche.ogbuji@fourthought.com)
Date: Wed, 15 Nov 2000 12:15:18 -0700
Subject: [XML-SIG] Entity tralation in XSLT
In-Reply-To: Message from teg@redhat.com (Trond Eivind
=?iso-8859-1?q?Glomsr=F8d?=)
of "14 Nov 2000 18:23:32 EST."
Message-ID: <200011151915.MAA04709@localhost.localdomain>
> "Martin v. Loewis" writes:
> =
> > > Are there known problems with entity handling in XSLT with
> > > PyXML-0.5.5.1 and 4Suite 0.9.1?
> > =
> > Not that I know of.
> > =
> > > This is an simple example, but it also happens in more complex
> > > documents - > is translated, < isn't =
> > =
> > Can you please say why you think this is a problem?
> =
> Because I need it ("<") in templates - I'm building complex
> structures. "<" needs to be specified this way (AFAIK) to
> differentiate between this and the start of a tag.
Ah, it looks as if you are falling afoul of XML, not 4Suite.
"<" and ";" are the only "normal" characters that _must_ be escaped in =
character data. ">", """, "'", etc. are optional except whe=
re =
they'd cause confusion with attribute quotes or CDATA section markers.
4XSLT uses all the latitude it has to minimize escaping because unnecessa=
ry =
escaping causes bloat and lack of readibility. If you are using other =
conformant XML tools, 4XSLT's output should work just fine.
Maybe I'm still missing something?
-- =
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com =
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From teg@redhat.com Wed Nov 15 19:23:36 2000
From: teg@redhat.com (Trond Eivind =?iso-8859-1?q?Glomsr=F8d?=)
Date: 15 Nov 2000 14:23:36 -0500
Subject: [XML-SIG] Entity tralation in XSLT
In-Reply-To: uche.ogbuji@fourthought.com's message of "Wed, 15 Nov 2000 12:10:28 -0700"
References: <200011151910.MAA04697@localhost.localdomain>
Message-ID:
uche.ogbuji@fourthought.com writes:
> > [teg@halden teg]$ cat foo.xsl
> >
> >
> >
> > <MAGIC>=
> >
> >
> > [teg@halden teg]$ cat foo.xml
> > Xyzzy!
> > [teg@halden teg]$ 4xslt -o bar foo.xml foo.xsl
> > [teg@halden teg]$ cat bar
> >
> > <MAGIC>=Xyzzy!
> > [teg@halden teg]$
> >
> > This is an simple example, but it also happens in more complex
> > documents - > is translated, < isn't
>
> The output is technically correct, but I could understand that it's a bit
> confusing.
>
> Our writer chooses not to escape '>' to '>' to improve readability of the
> output. This is perfectly legal. Escaping of '<' to '<' is mandatory,
> however.
>
> If you let us know what output you want, we can help you get it.
What I'm trying to do, is to have XML input and produce "ordinary"
file output (non-XML) with the template mechanism.
> Perhaps you want to use .
That seems to work just fine... A bit cumbersome, though
--
Trond Eivind Glomsrød
Red Hat, Inc.
From uche.ogbuji@fourthought.com Wed Nov 15 21:30:15 2000
From: uche.ogbuji@fourthought.com (uche.ogbuji@fourthought.com)
Date: Wed, 15 Nov 2000 14:30:15 -0700
Subject: [XML-SIG] Entity tralation in XSLT
In-Reply-To: Message from teg@redhat.com (Trond Eivind
=?iso-8859-1?q?Glomsr=F8d?=)
of "15 Nov 2000 14:23:36 EST."
Message-ID: <200011152130.OAA05891@localhost.localdomain>
> uche.ogbuji@fourthought.com writes:
> =
> > > [teg@halden teg]$ cat foo.xsl
> > >
> > >
> > >
> > > <MAGIC>=3D
> > >
> > >
> > > [teg@halden teg]$ cat foo.xml
> > > Xyzzy!
> > > [teg@halden teg]$ 4xslt -o bar foo.xml foo.xsl
> > > [teg@halden teg]$ cat bar
> > > =
> > > <MAGIC>=3DXyzzy!
> > > [teg@halden teg]$
> > > =
> > > This is an simple example, but it also happens in more complex
> > > documents - > is translated, < isn't =
> > =
> > The output is technically correct, but I could understand that it's a=
bit =
> > confusing.
> > =
> > Our writer chooses not to escape '>' to '>' to improve readability=
of the =
> > output. This is perfectly legal. Escaping of '<' to '<' is manda=
tory, =
> > however.
> > =
> > If you let us know what output you want, we can help you get it.
> =
> What I'm trying to do, is to have XML input and produce "ordinary"
> file output (non-XML) with the template mechanism. =
> =
> > Perhaps you want to use .
> =
> That seems to work just fine... A bit cumbersome, though
Oh, it seems you won't even need to bother. The solution is simple.
If you just want text, use the text output method
Just add =
You the top level of your stylesheet.
Good luck.
-- =
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com =
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From teg@redhat.com Wed Nov 15 21:35:39 2000
From: teg@redhat.com (Trond Eivind =?iso-8859-1?q?Glomsr=F8d?=)
Date: 15 Nov 2000 16:35:39 -0500
Subject: [XML-SIG] Entity tralation in XSLT
In-Reply-To: uche.ogbuji@fourthought.com's message of "Wed, 15 Nov 2000 14:30:15 -0700"
References: <200011152130.OAA05891@localhost.localdomain>
Message-ID:
uche.ogbuji@fourthought.com writes:
> > uche.ogbuji@fourthought.com writes:
> >
> > > Perhaps you want to use .
> >
> > That seems to work just fine... A bit cumbersome, though
>
> Oh, it seems you won't even need to bother. The solution is simple.
>
> If you just want text, use the text output method
>
> Just add
>
>
I already had that...
BTW: I've also made (good :) specfiles for PyXML and 4Suite if anyone is interested
(both can be found in Rawhide: ftp://ftp.redhat.com/rawhide/i386/RedHat/RPMS )
--
Trond Eivind Glomsrød
Red Hat, Inc.
From uche.ogbuji@fourthought.com Wed Nov 15 21:47:57 2000
From: uche.ogbuji@fourthought.com (uche.ogbuji@fourthought.com)
Date: Wed, 15 Nov 2000 14:47:57 -0700
Subject: [XML-SIG] Entity tralation in XSLT
In-Reply-To: Message from teg@redhat.com (Trond Eivind
=?iso-8859-1?q?Glomsr=F8d?=)
of "15 Nov 2000 16:35:39 EST."
Message-ID: <200011152147.OAA05965@localhost.localdomain>
> > Oh, it seems you won't even need to bother. The solution is simple.
> > =
> > If you just want text, use the text output method
> > =
> > Just add =
> > =
> >
> =
> I already had that... =
Hmm. Then _nothing_ should be escaped.
[uogbuji@borgia /tmp]$ cat foo.xml =
Xyzzy!
[uogbuji@borgia /tmp]$ cat foo.xslt =
<MAGIC>=3D
[uogbuji@borgia /tmp]$ 4xslt foo.xml foo.xslt =
=3DXyzzy!
[uogbuji@borgia /tmp]$ =
> BTW: I've also made (good :) specfiles for PyXML and 4Suite if anyone i=
s interested
> (both can be found in Rawhide: ftp://ftp.redhat.com/rawhide/i386/RedHat=
/RPMS )
Wow. Are you guys looking to move PyXML and 4Suite into the Red Hat dist=
ro?
BTW, it will be interesting to compare your spec files to those produced =
by =
distutils. It might help improve distutils.
-- =
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com =
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From bjorn@roguewave.com Wed Nov 15 22:25:58 2000
From: bjorn@roguewave.com (Bjorn Pettersen)
Date: Wed, 15 Nov 2000 15:25:58 -0700
Subject: [XML-SIG] Parsing speed
Message-ID: <3A130D76.9CB954C4@roguewave.com>
With a simple parsing of a xml file (size= 1,579,881 bytes):
from xml.utils.qp_xml import Parser
if __name__=="__main__":
import sys, time
if len(sys.argv) != 2:
print "usage %s " % sys.argv[0]
else:
t1 = time.time()
p = Parser()
p.parse(open(sys.argv[1]))
t2 = time.time()
print t2-t1
I'm seeing very different speeds with Python 1.5.2 and 2.0:
1.5.2: 79.414 secs
2.0 : 185.606 secs
ie. Python 2.0 is about 130% slower. Is this all due to Unicode, or is
there something else also?
I've also developed my own xml->python datastructure parser that isn't
so sensitive to the size of the input (it's also really fast on small
inputs). With this module I get:
1.5.2: 1.792 secs
2.0 : 2.954 secs
for the same file, which makes Python 2.0 about 65% slower.
I've copied the parser part of my module below. Is there anything I'm
missing? (beside namespace support, which isn't useful to me right now
;-) Also, is it kosher to get around the differences in pyexpat the way
I'm doing? (I didn't want to do it inside the start method since it is
called over 3000 times for the file above).
There is of course a cursor type module to go along with the generated
datastructure to make it easy to work with (would it be appropriate to
add something like this to the PyXML distribution?)
-- bjorn
import pyexpat
from cStringIO import StringIO
import sys
class Parser:
def __init__(self):
self.parent = ([],[])
self.root = self.parent
self.stack = []
self.debug = 0
self.cur = None
self.i = 0
self.prev = 0 #init
def parse(self, input):
p = pyexpat.ParserCreate()
p.StartElementHandler = self.start
p.EndElementHandler = self.end
p.CharacterDataHandler = self.cdata
if type(input) == type(''):
p.Parse(input, 1)
else:
while 1:
s = input.read(1024 * 16)
if not s:
p.Parse('', 1)
break
p.Parse(s, 0)
return self.root[1][0]
def _start_2_0(self, name, attrs):
subnodes = ([],[])
node = (name, attrs, subnodes)
if self.prev == 3: #cdata
self.parent[0].append( (self.i,self.cur.getvalue()) )
self.i = self.i + 1
self.parent[1].append( (self.i, node) )
else:
self.parent[1].append( (self.i, node) )
self.i = self.i + 1
self.stack.append((self.i,self.parent))
self.parent = subnodes
self.i = 0
self.cur = node
self.prev = 1 #start
def _start_1_5_2(self, name, a):
i = 0; attrs={}
while i
ANN: 4Suite 0.9.2
Fourthought, Inc. (http://Fourthought.com) announces the release of
4Suite 0.9.2
---------------------------
Open source tools for standards-based XML, DOM, XPath, XSLT, RDF
XPointer, XLink and object-database development in Python
4Suite is a collection of Python tools for XML processing and object
database management. An integrated packaging of several formerly
separately-distributed components: 4DOM, 4XPath and 4XSLT, 4RDF, 4ODS
4XPointer and featuring the new 4XLink and DbDOM.
News
----
- The 4Suite home page has been moved to
http://4Suite.org
- 4Suite has moved to a derivative of the Apache license.
- 4Suite now workd with Python 2.0 as well as Python 1.5.2. Python
1.6 is not supported, although it might work. Python 1.5.2 support
is expected to be dropped in the next release of 4Suite.
- PyXML 0.6.2 is still required even if you are using Python 2.0
http://sourceforge.net/projects/pyxml
- Changes to the software:
* Introduced 4XLink: A processor to expand XLink attributes
* Introduced DbDom: An alpha Dom implmentaiton on top of 4ODS
* ODS: Improved the test suites to handle more cases and conform to protocol
* cDomlette: added support for methods
* 4RDF: Fixes and improvements to serialization, the back end and the API
* All: Many improvements to the docs
* All: Standardized reader interfaces across DOM implementations
* All: Test with python 2.0
* All: PyXML not needed with Python 2.0
* Many misc optimizations
* Many misc bug-fixes
- We have set up a contest for stories of 4Suite usage. See
http://www.4suite.org/contest.epy
More info and Obtaining 4Suite
------------------------------
Please see
http://4Suite.org
From where you can download source, Windows and Linux binaries.
4Suite is distributed under a license similar to that of the
Apache Web Server.
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +01 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From MichaelDyck@home.com Thu Nov 16 05:47:46 2000
From: MichaelDyck@home.com (Michael Dyck)
Date: Wed, 15 Nov 2000 21:47:46 -0800
Subject: [XML-SIG] ANN: 4Suite 0.9.2
References: <200011160253.TAA07753@localhost.localdomain>
Message-ID: <3A137502.FCD5A55D@home.com>
uche.ogbuji@fourthought.com wrote:
>
> ANN: 4Suite 0.9.2
>
> - PyXML 0.6.2 is still required even if you are using Python 2.0
> ...
> - Changes to the software:
> ...
> * All: PyXML not needed with Python 2.0
So is PyXML needed or not?
-Michael Dyck
From uche.ogbuji@fourthought.com Thu Nov 16 05:55:00 2000
From: uche.ogbuji@fourthought.com (Uche Ogbuji)
Date: Wed, 15 Nov 2000 22:55:00 -0700
Subject: [XML-SIG] ANN: 4Suite 0.9.2
References: <200011160253.TAA07753@localhost.localdomain> <3A137502.FCD5A55D@home.com>
Message-ID: <3A1376B4.8FF18346@fourthought.com>
Michael Dyck wrote:
>
> uche.ogbuji@fourthought.com wrote:
> >
> > ANN: 4Suite 0.9.2
> >
> > - PyXML 0.6.2 is still required even if you are using Python 2.0
> > ...
> > - Changes to the software:
> > ...
> > * All: PyXML not needed with Python 2.0
>
> So is PyXML needed or not?
Bah! Yes it is. We discovered so at the last minute but forgot to
update the ChangeLog.
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From Alexandre.Fayolle@logilab.fr Thu Nov 16 14:46:50 2000
From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle)
Date: Thu, 16 Nov 2000 15:46:50 +0100 (CET)
Subject: [XML-SIG] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
Message-ID:
Hello,
I would like to have some clarification about the python 1.52 support in
PyXML 0.6.2 and 4Suite 0.9.2. 4Suite specifies it nees PyXML 0.6.2 to
run. Is it 6.2 for python 2.0 and 5.5.1 for python 1.52 ?
I could not find the xml.unicode package in pyxml 0.6.2...
Alexandre Fayolle
--
http://www.logilab.com
Narval is the first software agent available as free software (GPL).
LOGILAB, Paris (France).
From uche.ogbuji@fourthought.com Thu Nov 16 15:31:33 2000
From: uche.ogbuji@fourthought.com (Uche Ogbuji)
Date: Thu, 16 Nov 2000 08:31:33 -0700
Subject: [XML-SIG] Re: [4suite] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
References:
Message-ID: <3A13FDD5.A02CB400@fourthought.com>
Alexandre Fayolle wrote:
> I would like to have some clarification about the python 1.52 support in
> PyXML 0.6.2 and 4Suite 0.9.2. 4Suite specifies it nees PyXML 0.6.2 to
> run. Is it 6.2 for python 2.0 and 5.5.1 for python 1.52 ?
Oops here. I actually tested using PyXML 0.6.1. I thought I'd upgraded
but I was mistaken.
> I could not find the xml.unicode package in pyxml 0.6.2...
And I also forgot that PyXML 0.6.2 is designed for Python 2.0
So here's the story:
If you are using Python 1.5.2, you need PyXML 0.6.1 and if you use
Python 2.0, you need PyXML 0.6.2
Hopefully all this version confusion goes away soon.
Is there any reason people aren't migrating to Python 2.0?
Thanks.
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From Alexandre.Fayolle@logilab.fr Thu Nov 16 15:43:17 2000
From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle)
Date: Thu, 16 Nov 2000 16:43:17 +0100 (CET)
Subject: [XML-SIG] Re: [4suite] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To: <3A13FDD5.A02CB400@fourthought.com>
Message-ID:
On Thu, 16 Nov 2000, Uche Ogbuji wrote:
> Alexandre Fayolle wrote:
>
> And I also forgot that PyXML 0.6.2 is designed for Python 2.0
Well, if you go to
http://sourceforge.net/project/showfiles.php?group_id=6473
you'll find a version of 0.6.2 for Python 1.5.2... So this gets VERY
confusing, I think.
> Hopefully all this version confusion goes away soon.
>
> Is there any reason people aren't migrating to Python 2.0?
As I told Mike Olson yesterday, Narval depends on 4Suite, and preferably
an official release (and not a snapshot). Unless I'm deeply mistaken,
4Suite0.9.2 is the first release of 4Suite supporting python 2.0. So the
answer is : we were waiting for you ;o)
The same issue exists for a number of dependencies actually (pygtk, for
instance still does not exist for python 2.0...)
Alexandre Fayolle
--
http://www.logilab.com
Narval is the first software agent available as free software (GPL).
LOGILAB, Paris (France).
From akuchlin@mems-exchange.org Thu Nov 16 15:50:59 2000
From: akuchlin@mems-exchange.org (Andrew Kuchling)
Date: Thu, 16 Nov 2000 10:50:59 -0500
Subject: [XML-SIG] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To: ; from Alexandre.Fayolle@logilab.fr on Thu, Nov 16, 2000 at 03:46:50PM +0100
References:
Message-ID: <20001116105059.A23853@kronos.cnri.reston.va.us>
On Thu, Nov 16, 2000 at 03:46:50PM +0100, Alexandre Fayolle wrote:
>I could not find the xml.unicode package in pyxml 0.6.2...
It was dropped, since the Unicode support in Python 2.0 is much more
featureful than the xml.unicode package was, and has had far more
input from the community. In general anyone who wants to do Unicode
should be using 2.0.
--amk
From guenter@ubka.uni-karlsruhe.de Thu Nov 16 15:59:54 2000
From: guenter@ubka.uni-karlsruhe.de (Guenter Radestock)
Date: Thu, 16 Nov 2000 16:59:54 +0100
Subject: [XML-SIG] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To: <20001116105059.A23853@kronos.cnri.reston.va.us>; from Andrew Kuchling on Thu, Nov 16, 2000 at 10:50:59AM -0500
References: <20001116105059.A23853@kronos.cnri.reston.va.us>
Message-ID: <20001116165954.A41413@ubka.uni-karlsruhe.de>
On Thu, Nov 16, 2000 at 10:50:59AM -0500, Andrew Kuchling wrote:
...
> It was dropped, since the Unicode support in Python 2.0 is much more
> featureful than the xml.unicode package was, and has had far more
> input from the community. In general anyone who wants to do Unicode
> should be using 2.0.
What about Python 1.6? I upgraded evrything at our site to 1.6 shortly after
it came out (the append(.,.) was some work), then about a week or two
later came 2.0, but - I don't have the time to keep upgrading every week
or so.
Is 1.6 officially unsupported (seems so)? 1.6 does have some Unicode
support. Will it work more like 1.5 or like 2.0? Will the XML package
work at all (I was able to successfully install, but I did not do
anything with it, yet).
--
Guenter Radestock, Universitaetsbibliothek Karlsruhe
guenter@ubka.uni-karlsruhe.de
http://www.ubka.uni-karlsruhe.de/~guenter
From akuchlin@mems-exchange.org Thu Nov 16 16:02:19 2000
From: akuchlin@mems-exchange.org (Andrew Kuchling)
Date: Thu, 16 Nov 2000 11:02:19 -0500
Subject: [XML-SIG] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To: <20001116165954.A41413@ubka.uni-karlsruhe.de>; from guenter@ubka.uni-karlsruhe.de on Thu, Nov 16, 2000 at 04:59:54PM +0100
References: <20001116105059.A23853@kronos.cnri.reston.va.us> <20001116165954.A41413@ubka.uni-karlsruhe.de>
Message-ID: <20001116110219.A23900@kronos.cnri.reston.va.us>
On Thu, Nov 16, 2000 at 04:59:54PM +0100, Guenter Radestock wrote:
>What about Python 1.6? I upgraded evrything at our site to 1.6 shortly after
1.6's support is the same code as in 2.0 and should behave
identically, but few people are using 1.6, I think, since 2.0 became
available so quickly.
--amk
From uche.ogbuji@fourthought.com Thu Nov 16 16:02:52 2000
From: uche.ogbuji@fourthought.com (uche.ogbuji@fourthought.com)
Date: Thu, 16 Nov 2000 09:02:52 -0700
Subject: [XML-SIG] ANN: 4Suite Server 0.9.2
Message-ID: <200011161602.JAA10083@localhost.localdomain>
Fourthought, Inc. (http://Fourthought.com) announces the release of
4Suite Server 0.9.2
---------------------------
An open source XML data server based on open standards
implemented using 4Suite and other tools
4Suite Server is a platform for handling XML processing needs in
application development. It is an XML data repository with a
rules-based engine. It supports DOM access, XSLT transformation, XPath
and RDF-based indexing and query, XLink resolution and many other XML
services. It also supports other related services such as distributed
transactions, and access control lists. It supports remote,
cross-platform and cross-language access through CORBA and other request
protocols to be added shortly.
4Suite Server is not designed to be a full-blown application server.
It provides highly-specialized services for XML processing that can be
used with other application servers.
4Suite Server is open-source and free to download. Priority support
and customization is available from Fourthought, Inc. For more
information on this the home page (http://FourThought.com/4SuiteServer),
or contact Fourthought at info@fourthought.com or +1 303 583 9900
The 4Suite Server home page is
http://FourThought.com/4SuiteServer
From where you can download the software itself or an executive summary
thereof, read usage scenarios and find other information.
From teg@redhat.com Thu Nov 16 16:51:37 2000
From: teg@redhat.com (Trond Eivind =?iso-8859-1?q?Glomsr=F8d?=)
Date: 16 Nov 2000 11:51:37 -0500
Subject: [XML-SIG] Re: [4suite] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To: Uche Ogbuji's message of "Thu, 16 Nov 2000 08:31:33 -0700"
References:
<3A13FDD5.A02CB400@fourthought.com>
Message-ID:
Uche Ogbuji writes:
> Alexandre Fayolle wrote:
>
> > I would like to have some clarification about the python 1.52 support in
> > PyXML 0.6.2 and 4Suite 0.9.2. 4Suite specifies it nees PyXML 0.6.2 to
> > run. Is it 6.2 for python 2.0 and 5.5.1 for python 1.52 ?
>
> Oops here. I actually tested using PyXML 0.6.1. I thought I'd upgraded
> but I was mistaken.
>
> > I could not find the xml.unicode package in pyxml 0.6.2...
>
> And I also forgot that PyXML 0.6.2 is designed for Python 2.0
>
> So here's the story:
>
> If you are using Python 1.5.2, you need PyXML 0.6.1 and if you use
> Python 2.0, you need PyXML 0.6.2
>
> Hopefully all this version confusion goes away soon.
>
> Is there any reason people aren't migrating to Python 2.0?
Compatibility - we for one won't switch until the next series: Modules
aren't binary compatible or in the same locations.
Red Hat Linux 7 and successors is one development platform, just like
Red Hat Linux 6.x .
In addition you have the licensing worries.
--
Trond Eivind Glomsrød
Red Hat, Inc.
From uche.ogbuji@fourthought.com Thu Nov 16 18:11:30 2000
From: uche.ogbuji@fourthought.com (uche.ogbuji@fourthought.com)
Date: Thu, 16 Nov 2000 11:11:30 -0700
Subject: [XML-SIG] Re: [4suite] Python 1.5 support with PyXML
0.6.2/4Suite0.9.2
In-Reply-To: Message from teg@redhat.com (Trond Eivind
=?iso-8859-1?q?Glomsr=F8d?=)
of "16 Nov 2000 11:51:37 EST."
Message-ID: <200011161811.LAA10394@localhost.localdomain>
> Compatibility - we for one won't switch until the next series: Modules
> aren't binary compatible or in the same locations.
By "the next series", do you mean Python 2.1 or Redhat 7.1?
> Red Hat Linux 7 and successors is one development platform, just like
> Red Hat Linux 6.x . =
> =
> In addition you have the licensing worries.
Curious about any comment you might have as to 4Suite's move to an Apache=
=
license derivative.
-- =
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com =
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From teg@redhat.com Thu Nov 16 19:14:35 2000
From: teg@redhat.com (Trond Eivind =?iso-8859-1?q?Glomsr=F8d?=)
Date: 16 Nov 2000 14:14:35 -0500
Subject: [XML-SIG] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To: uche.ogbuji@fourthought.com's message of "Thu, 16 Nov 2000 11:11:30 -0700"
References: <200011161811.LAA10394@localhost.localdomain>
Message-ID:
uche.ogbuji@fourthought.com writes:
> > Compatibility - we for one won't switch until the next series: Modules
> > aren't binary compatible or in the same locations.
>
> By "the next series", do you mean Python 2.1 or Redhat 7.1?
No, I mean 8.x or whatever it's called - within each series, we
strive to maintain compability. RPMs made on one of them should
install and work on the rest. If we upgraded python, such
compatibility would be broken - so we're not going to upgrade
for some time.
> > Red Hat Linux 7 and successors is one development platform, just like
> > Red Hat Linux 6.x .
> >
> > In addition you have the licensing worries.
>
> Curious about any comment you might have as to 4Suite's move to an Apache
> license derivative.
The Apache license is perfectly OK by us.
--
Trond Eivind Glomsrød
Red Hat, Inc.
From martin@loewis.home.cs.tu-berlin.de Thu Nov 16 19:33:24 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Thu, 16 Nov 2000 20:33:24 +0100
Subject: [XML-SIG] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To: <20001116105059.A23853@kronos.cnri.reston.va.us> (message from
Andrew Kuchling on Thu, 16 Nov 2000 10:50:59 -0500)
References: <20001116105059.A23853@kronos.cnri.reston.va.us>
Message-ID: <200011161933.UAA00779@loewis.home.cs.tu-berlin.de>
> On Thu, Nov 16, 2000 at 03:46:50PM +0100, Alexandre Fayolle wrote:
> >I could not find the xml.unicode package in pyxml 0.6.2...
>
> It was dropped, since the Unicode support in Python 2.0 is much more
> featureful than the xml.unicode package was, and has had far more
> input from the community. In general anyone who wants to do Unicode
> should be using 2.0.
All true - but it was dropped already in PyXML 0.6.0.
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Thu Nov 16 19:29:26 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Thu, 16 Nov 2000 20:29:26 +0100
Subject: [XML-SIG] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To: (message
from Alexandre Fayolle on Thu, 16 Nov 2000 15:46:50 +0100 (CET))
References:
Message-ID: <200011161929.UAA00760@loewis.home.cs.tu-berlin.de>
> I would like to have some clarification about the python 1.52 support in
> PyXML 0.6.2 and 4Suite 0.9.2. 4Suite specifies it nees PyXML 0.6.2 to
> run. Is it 6.2 for python 2.0 and 5.5.1 for python 1.52 ?
PyXML supports both Python 1.5.2, and Python 2.0.
> I could not find the xml.unicode package in pyxml 0.6.2...
There isn't any such package. Why do you think it should be there?
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Thu Nov 16 19:32:38 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Thu, 16 Nov 2000 20:32:38 +0100
Subject: [XML-SIG] Re: [4suite] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To: (message
from Alexandre Fayolle on Thu, 16 Nov 2000 16:43:17 +0100 (CET))
References:
Message-ID: <200011161932.UAA00778@loewis.home.cs.tu-berlin.de>
> As I told Mike Olson yesterday, Narval depends on 4Suite, and preferably
> an official release (and not a snapshot). Unless I'm deeply mistaken,
> 4Suite0.9.2 is the first release of 4Suite supporting python 2.0. So the
> answer is : we were waiting for you ;o)
>
> The same issue exists for a number of dependencies actually (pygtk, for
> instance still does not exist for python 2.0...)
I personally plan to provide 1.5.2 support as long as people ask for
it; I'll regularly will check whether any of the PyXML users continue
to use 1.5.2.
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Thu Nov 16 19:31:19 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Thu, 16 Nov 2000 20:31:19 +0100
Subject: [XML-SIG] Re: [4suite] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To: <3A13FDD5.A02CB400@fourthought.com> (message from Uche Ogbuji on
Thu, 16 Nov 2000 08:31:33 -0700)
References: <3A13FDD5.A02CB400@fourthought.com>
Message-ID: <200011161931.UAA00777@loewis.home.cs.tu-berlin.de>
> Oops here. I actually tested using PyXML 0.6.1. I thought I'd upgraded
> but I was mistaken.
Is there anything that used to work in 0.6.1 that was broken in 0.6.2?
> > I could not find the xml.unicode package in pyxml 0.6.2...
>
> And I also forgot that PyXML 0.6.2 is designed for Python 2.0
Not really. It is designed as a superset of Python 2.0, but it still
provides the same functions under 1.5.2, except that pyexpat won't
produce Unicode strings.
> If you are using Python 1.5.2, you need PyXML 0.6.1 and if you use
> Python 2.0, you need PyXML 0.6.2
Why is that?
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Thu Nov 16 19:37:30 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Thu, 16 Nov 2000 20:37:30 +0100
Subject: [XML-SIG] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To: <20001116165954.A41413@ubka.uni-karlsruhe.de> (message from
Guenter Radestock on Thu, 16 Nov 2000 16:59:54 +0100)
References: <20001116105059.A23853@kronos.cnri.reston.va.us> <20001116165954.A41413@ubka.uni-karlsruhe.de>
Message-ID: <200011161937.UAA00823@loewis.home.cs.tu-berlin.de>
> What about Python 1.6? I upgraded evrything at our site to 1.6
> shortly after it came out (the append(.,.) was some work), then
> about a week or two later came 2.0, but - I don't have the time to
> keep upgrading every week or so.
I don't know of any reason for Python 1.6, except to make CNRI lawyers
happy. I encourage everybody not to install it, and stay with 1.5.2,
or go directly to 2.0.
> Is 1.6 officially unsupported (seems so)?
PyXML does not officially support it. Python 1.6 is officially
unsupported in the sense that there will be no subminor releases
fixing bugs in it.
> 1.6 does have some Unicode support. Will it work more like 1.5 or
> like 2.0? Will the XML package work at all (I was able to
> successfully install, but I did not do anything with it, yet).
It'll work similar to Python 2.0, except perhaps for all the bugs in
Python proper (and no, I don't know any specific bugs - although I'm
sure they are there :-).
Regards,
Martin
From uche.ogbuji@fourthought.com Thu Nov 16 19:53:24 2000
From: uche.ogbuji@fourthought.com (Uche Ogbuji)
Date: Thu, 16 Nov 2000 12:53:24 -0700
Subject: [XML-SIG] Re: [4suite] Python 1.5 support with PyXML
0.6.2/4Suite0.9.2
References: <3A13FDD5.A02CB400@fourthought.com> <200011161931.UAA00777@loewis.home.cs.tu-berlin.de>
Message-ID: <3A143B34.71110B4E@fourthought.com>
"Martin v. Loewis" wrote:
>
> > Oops here. I actually tested using PyXML 0.6.1. I thought I'd upgraded
> > but I was mistaken.
>
> Is there anything that used to work in 0.6.1 that was broken in 0.6.2?
>
> > > I could not find the xml.unicode package in pyxml 0.6.2...
> >
> > And I also forgot that PyXML 0.6.2 is designed for Python 2.0
>
> Not really. It is designed as a superset of Python 2.0, but it still
> provides the same functions under 1.5.2, except that pyexpat won't
> produce Unicode strings.
>
> > If you are using Python 1.5.2, you need PyXML 0.6.1 and if you use
> > Python 2.0, you need PyXML 0.6.2
I guess I got it wrong again. OK, but if there is no unicode package,
the code 4DOM relied on for conversions in Python 1.5.2 pretty much
breaks, viz
from xml.unicode.iso8859 import wstring
So what am I still missing?
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From dieter@handshake.de Thu Nov 16 19:58:19 2000
From: dieter@handshake.de (Dieter Maurer)
Date: Thu, 16 Nov 2000 20:58:19 +0100 (CET)
Subject: [XML-SIG] Re: [4suite] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To: <3A13FDD5.A02CB400@fourthought.com>
References:
<3A13FDD5.A02CB400@fourthought.com>
Message-ID: <14868.15451.632753.41194@lindm.dm>
Uche Ogbuji writes:
> Is there any reason people aren't migrating to Python 2.0?
I fear (maybe unjustified) problems with non-ASCII (latin-1) characters
in my string constants.
Dieter
From tpassin@home.com Thu Nov 16 22:46:38 2000
From: tpassin@home.com (Thomas B. Passin)
Date: Thu, 16 Nov 2000 17:46:38 -0500
Subject: [XML-SIG] Re: [4suite] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
References: <200011161932.UAA00778@loewis.home.cs.tu-berlin.de>
Message-ID: <004401c0501f$14d53820$7cac1218@reston1.va.home.com>
Martin v. Loewis said -
>
> I personally plan to provide 1.5.2 support as long as
people ask for
> it; I'll regularly will check whether any of the PyXML
users continue
> to use 1.5.2.
>
I'm still using 1.5.2 because:
1) I'm also running Zope on the same machine, and both
Zope's python and my regular python installation use the
same pythonpath, etc. I don't want version conflicts when
various things load.
2) I'm running various demos that work, and I don't want to
suddenly find that they don't, then try to fix things or
reinstall 1.5.2. So my upgrade schedule will depend partly
on when I won't need to support these demos for a while.
3) I'm concerned about various C interface modules that
won't work under 2.0. I'll give their makers plenty of time
to get them working under 2.0.
After the last exchange, I'm left unsure whether 4Thought's
stuff should run under 1.5.2 or not. I installed pyXML6.1
last week, and 4Thought passed all the tests that came with
it, running Python 1.5.2.
Cheers,
Tom Passin
From tpassin@home.com Thu Nov 16 22:54:45 2000
From: tpassin@home.com (Thomas B. Passin)
Date: Thu, 16 Nov 2000 17:54:45 -0500
Subject: [XML-SIG] 4DOM Test Suite not in PYXML.
References: <200011161932.UAA00778@loewis.home.cs.tu-berlin.de>
Message-ID: <004801c05020$37494c60$7cac1218@reston1.va.home.com>
In another post, I said that 4Suite from pyXML6.1 passed its
tests. That wasn't quite true. I installed it. Then I
renamed the xml directory. Then I installed a version from
4Thought's site, one for python 1.5.2. This is on WIndows,
by the way. I installed it (it also created an xml
directory). This installation had test modules, but of
course didn't have the other pyXML goodies. I moved the
(new) xml directory elsewhere, renamed the original one back
to xml, then copied the test directories from the 4Thought
version into corresponding places in the pyMXL tree.
Then they ran successfully.
Whew! It shouldn't be so hard. ***Please*** include self
test programs in the pyXML distibution.
But thanks to everyone who worked so hard to get a working,
up-to-date distribution. I appreciate it very much, and I
know a lot of other people do too.
Cheers,
Tom Passin
From bwiegert@learningbyte.com Thu Nov 16 23:08:06 2000
From: bwiegert@learningbyte.com (Ben Wiegert)
Date: Thu, 16 Nov 2000 17:08:06 -0600
Subject: [XML-SIG] Retrieving aggregate data types in elements using SAX
Message-ID: <10227D9D561DD31181E100A0C9655237012E4E36@gofastc3h.gofast.net>
I am trying something out. I parse XML docs using saxlib. I have been
storing a date tuple in an xml document. I can retrieve this as a tuple if
it is an attribute of the element through the attrs.get method. If the
tuple is stored as a tag value, I can't get it as a tuple but only as a
string through the use of the characters function. This is OK because I can
use the eval function on the retrieved value as a workaround and have it as
a tuple again. But is this supposed to be like this, or am I missing
something on how to retrieve aggregates like lists, tuples or dictionaries.
It would be handy to store these in elements in an XML docs, and be able to
retrieve them directly. Any feedback appreciated.
Ben Wiegert
From uche.ogbuji@fourthought.com Fri Nov 17 00:08:54 2000
From: uche.ogbuji@fourthought.com (Uche Ogbuji)
Date: Thu, 16 Nov 2000 17:08:54 -0700
Subject: [XML-SIG] Question re: 4DOM dom.ext.Printer
References: <200011131647.JAA28293@localhost.localdomain> <200011131956.UAA00936@loewis.home.cs.tu-berlin.de>
Message-ID: <3A147716.19F3AC04@fourthought.com>
"Martin v. Loewis" wrote:
>
> > Aside: we really need to get a bug tracker going one of these days.
>
> Feel free to use the PyXML bug tracking on sourceforge.net; we can
> create additional categories (e.g. 4XSLT, ...), whatever you want.
> Tracking with SF is quite convenient - having set-up GNATS myself, I
> can tell that administrating such a system is not fun.
Now that we've gor the 4Suite release out, I'd like to talk furthr about
this. If you could set up a "4Suite" category on the PyXML bug-tracker,
that would be great.
What would you need from us?
Thanks.
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From Alexandre.Fayolle@logilab.fr Fri Nov 17 09:51:25 2000
From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle)
Date: Fri, 17 Nov 2000 10:51:25 +0100 (CET)
Subject: [XML-SIG] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To: <200011161929.UAA00760@loewis.home.cs.tu-berlin.de>
Message-ID:
On Thu, 16 Nov 2000, Martin v. Loewis wrote:
> > I would like to have some clarification about the python 1.52 support in
> > PyXML 0.6.2 and 4Suite 0.9.2. 4Suite specifies it nees PyXML 0.6.2 to
> > run. Is it 6.2 for python 2.0 and 5.5.1 for python 1.52 ?
>
> PyXML supports both Python 1.5.2, and Python 2.0.
>
> > I could not find the xml.unicode package in pyxml 0.6.2...
>
> There isn't any such package. Why do you think it should be there?
Well, just 'cos it was there in PyXML 0.5.5.1 and 4Suite seems to
heavily depend on it when running under python 1.5.2
in Printer.py, there are things like:
try:
#The following stanza courtesy Martin von Loewis
import codecs # Python 1.5 only
from types import UnicodeType
def utf8_to_code(text, encoding):
encoder = codecs.lookup(encoding)[0] # encode,decode,reader,writer
if type(text) is not UnicodeType:
text = unicode(text, "utf-8")
return encoder(text)[0] # result,size
except ImportError:
def utf8_to_code(text, encoding):
encoding = string.upper(encoding)
if encoding == 'UTF-8':
return text
from xml.unicode.iso8859 import wstring
wstring.install_alias('ISO-8859-1', 'ISO_8859-1:1987')
#Note: Pass through to wstrop. This means we don't play nice and
#Escape characters that are not in the target encoding.
ws = wstring.from_utf8(text)
text = ws.encode(encoding)
#This version would skip all untranslatable chars: see wstrop.c
#text = ws.encode(encoding, 1)
return text
There is an error in the comment of line 3 of the above snippet
(codecs are only in python2.0), so Python 1.5 will actually execute the
except statement, and therefore an xml.unicode.iso8859 package seems to be
required.
Alexandre Fayolle
--
http://www.logilab.com
Narval is the first software agent available as free software (GPL).
LOGILAB, Paris (France).
From martin@loewis.home.cs.tu-berlin.de Fri Nov 17 10:11:10 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Fri, 17 Nov 2000 11:11:10 +0100
Subject: [XML-SIG] Re: [4suite] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To: <14868.15451.632753.41194@lindm.dm> (message from Dieter Maurer
on Thu, 16 Nov 2000 20:58:19 +0100 (CET))
References:
<3A13FDD5.A02CB400@fourthought.com> <14868.15451.632753.41194@lindm.dm>
Message-ID: <200011171011.LAA00787@loewis.home.cs.tu-berlin.de>
> I fear (maybe unjustified) problems with non-ASCII (latin-1) characters
> in my string constants.
On one hand, these concerns are justified - most likely, you *will*
have to modify your source here and there if Unicode objects suddenly
pop up.
OTOH, Unicode is one of the core principles of XML, just like elements
and character entities. So those changes will make your code better :-)
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Fri Nov 17 10:08:42 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Fri, 17 Nov 2000 11:08:42 +0100
Subject: [XML-SIG] Re: [4suite] Python 1.5 support with PyXML
0.6.2/4Suite0.9.2
In-Reply-To: <3A143B34.71110B4E@fourthought.com> (message from Uche Ogbuji on
Thu, 16 Nov 2000 12:53:24 -0700)
References: <3A13FDD5.A02CB400@fourthought.com> <200011161931.UAA00777@loewis.home.cs.tu-berlin.de> <3A143B34.71110B4E@fourthought.com>
Message-ID: <200011171008.LAA00784@loewis.home.cs.tu-berlin.de>
> I guess I got it wrong again. OK, but if there is no unicode package,
> the code 4DOM relied on for conversions in Python 1.5.2 pretty much
> breaks, viz
>
> from xml.unicode.iso8859 import wstring
>
> So what am I still missing?
An UTF-8 to Latin-1 converter, I guess :-)
At the moment, if the output encoding is UTF-8, it works, since it
won't even try to import the wstring module. Any other output encoding
fails at the moment. With PyXML 0.5, ISO-8859-1 was also supported (if
you had compiled wstring yourself); anything else fails.
Is that an acceptable restriction? I don't want to restore the wstring
module just to provide Latin-1 conversion, since it is another
extension module (even though I'm the author of the thing).
If you think 4DOM (and PyXML) users are entitled to Latin-1 output
even with Python 1.5, I'd be willing to contribute a UTF-8-to-Latin-1
converter. That one wouldn't go through an intermediate Unicode
representation, and it would be 100% pure Python.
What do you think?
Martin
From martin@loewis.home.cs.tu-berlin.de Fri Nov 17 10:15:19 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Fri, 17 Nov 2000 11:15:19 +0100
Subject: [XML-SIG] 4DOM Test Suite not in PYXML.
In-Reply-To: <004801c05020$37494c60$7cac1218@reston1.va.home.com>
(tpassin@home.com)
References: <200011161932.UAA00778@loewis.home.cs.tu-berlin.de> <004801c05020$37494c60$7cac1218@reston1.va.home.com>
Message-ID: <200011171015.LAA00833@loewis.home.cs.tu-berlin.de>
> In another post, I said that 4Suite from pyXML6.1 passed its
> tests. That wasn't quite true. I installed it. Then I
> renamed the xml directory.
Can you please be more specific? What exactly did you install, how
exactly did you install it? What directory did you rename, and which
was the new name?
> Whew! It shouldn't be so hard. ***Please*** include self
> test programs in the pyXML distibution.
There are self test programs in PyXML, in the test directory.
I'm not using 4Suite myself - what was the reason that you didn't
install it on top of PyXML?
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Fri Nov 17 10:30:48 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Fri, 17 Nov 2000 11:30:48 +0100
Subject: [XML-SIG] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To: (message
from Alexandre Fayolle on Fri, 17 Nov 2000 10:51:25 +0100 (CET))
References:
Message-ID: <200011171030.LAA00973@loewis.home.cs.tu-berlin.de>
> There is an error in the comment of line 3 of the above snippet
> (codecs are only in python2.0), so Python 1.5 will actually execute the
> except statement, and therefore an xml.unicode.iso8859 package seems to be
> required.
It is required if you want Latin-1 output. If you want, say, Latin-2
output, you lose with both releases. If you want UTF-8 output, it
works in both cases.
I could offer a solution restoring the functionality of 0.5.x (if not
the API); provided somebody speaks up and says "yes, I need it, and I
still use 0.5.x because 0.6 does not support Latin-1 output" when used
with 4DOM.
Regards,
Martin
From calvin@cs.uni-sb.de Fri Nov 17 13:06:46 2000
From: calvin@cs.uni-sb.de (Bastian Kleineidam)
Date: Fri, 17 Nov 2000 14:06:46 +0100 (CET)
Subject: [XML-SIG] Incompatible and bugs
Message-ID:
Hello,
I was trying the new PyXML 0.6.2. Currently I am developing with the
0.5.1 version and I have to say that this version is pretty good.
The first thing I noticed was that my programs are not working any more.
A lot of things changed and I am asking you for help:
1) from xml.arch.xmlarch import Prettifier
from xml.dom.sax_builder import SaxBuilder
Both classes are vanished. Where are they?
Ah, I found xml.sax.writer.PrettyPrinter which should be the
Prettifier, so I am only searching for SaxBuilder.
2) All DOM functions have changed?
I was formerly using the SaxBuilder class to build a DOM tree.
Document.get_documentElement() does not exist any more
Node.get_attributes does not exist
Node.get_value does not exist
and so on
Where can I find those functions?
It seems that every function has a leading underscore, so its
now _get_value etc.?
3) The documentation suggests to use xml.dom.ext.reader.Sax2.FromXml,
but in the source it is marked as deprecated.
What functions should I use then to build DOM trees? If you mark
something deprecated you should also write what the new functions
are.
4) The pulldom.py/PullDOM class has the following bugs:
a) in function ignorableWhitespace(self, chars):
the variables 'start' and 'length' are not known
b) in function endDocument the 'node' variable is accessed
outside of the for loop and therefore unknown
In pulldom.py there are several lines commented out
(self.events.append...). Are they needed? If not, you should delete
them.
Greetings from Bastian
From Alexandre.Fayolle@logilab.fr Fri Nov 17 13:44:26 2000
From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle)
Date: Fri, 17 Nov 2000 14:44:26 +0100 (CET)
Subject: [XML-SIG] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To:
Message-ID:
OK,
I finally wept out site-packages/Ft and site-packages/xml, reinstalled
pyxml0.5.5.1 and 4Suite0.9.2. Things seem to have gone back to normal.
I'd be tempted to say that python 1.5.2 support in 4Suite requires
pyXML0.5.5.1, but I may be missing some crucial issue.
We are going to concentrate on stabilizing our apps with this setup before
switching to Python 2.0
Alexandre Fayolle
--
http://www.logilab.com
Narval is the first software agent available as free software (GPL).
LOGILAB, Paris (France).
From Alexandre.Fayolle@logilab.fr Fri Nov 17 13:56:59 2000
From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle)
Date: Fri, 17 Nov 2000 14:56:59 +0100 (CET)
Subject: [XML-SIG] Incompatible and bugs
In-Reply-To:
Message-ID:
On Fri, 17 Nov 2000, Bastian Kleineidam wrote:
> 2) All DOM functions have changed?
Yes, the dom implementation in pyXML changed. It's now 4DOM, by
Fourthought, Inc. 4DOM is part of 4Suite, which features many other libs
(xpath, xslt... see http://www.4suite.org for details).
> I was formerly using the SaxBuilder class to build a DOM tree.
> Document.get_documentElement() does not exist any more
> Node.get_attributes does not exist
> Node.get_value does not exist
> and so on
>
> Where can I find those functions?
> It seems that every function has a leading underscore, so its
> now _get_value etc.?
Well you can do so, since it gains some performance over the method I'm
about to explain. The DOM spec says 'attributes' is an attribute of the
interface. Java and C++ implementations will map these to accessor
methods. 4DOM simply uses python attributes, so you may want can use
Node.attributes or Node.value, Document.documentElement to achiev the
same thing (please note that these are direct references to the attribute,
and not function calls). For a detailed specification of the API, check
http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html
> 3) The documentation suggests to use xml.dom.ext.reader.Sax2.FromXml,
> but in the source it is marked as deprecated.
>
> What functions should I use then to build DOM trees? If you mark
> something deprecated you should also write what the new functions
> are.
You can still use the Sax2.FromXml function for now. If you want to avoid
problems later, the issue was discussed in this list, see
http://www.python.org/pipermail/xml-sig/2000-November/005267.html
To output the tree as text you can use xml.dom.ext.Print or
xml.dom.ext.PrettyPrint
Alexandre Fayolle
--
http://www.logilab.com
Narval is the first software agent available as free software (GPL).
LOGILAB, Paris (France).
From uche.ogbuji@fourthought.com Fri Nov 17 15:38:56 2000
From: uche.ogbuji@fourthought.com (Uche Ogbuji)
Date: Fri, 17 Nov 2000 08:38:56 -0700
Subject: [4suite] Re: [XML-SIG] Python 1.5 support with PyXML
0.6.2/4Suite0.9.2
References:
Message-ID: <3A155110.74C2B527@fourthought.com>
Alexandre Fayolle wrote:
>
> On Thu, 16 Nov 2000, Martin v. Loewis wrote:
>
> > > I would like to have some clarification about the python 1.52 support in
> > > PyXML 0.6.2 and 4Suite 0.9.2. 4Suite specifies it nees PyXML 0.6.2 to
> > > run. Is it 6.2 for python 2.0 and 5.5.1 for python 1.52 ?
> >
> > PyXML supports both Python 1.5.2, and Python 2.0.
> >
> > > I could not find the xml.unicode package in pyxml 0.6.2...
> >
> > There isn't any such package. Why do you think it should be there?
>
> Well, just 'cos it was there in PyXML 0.5.5.1 and 4Suite seems to
> heavily depend on it when running under python 1.5.2
>
> in Printer.py, there are things like:
>
> try:
> #The following stanza courtesy Martin von Loewis
> import codecs # Python 1.5 only
> from types import UnicodeType
> def utf8_to_code(text, encoding):
> encoder = codecs.lookup(encoding)[0] # encode,decode,reader,writer
> if type(text) is not UnicodeType:
> text = unicode(text, "utf-8")
> return encoder(text)[0] # result,size
> except ImportError:
> def utf8_to_code(text, encoding):
> encoding = string.upper(encoding)
> if encoding == 'UTF-8':
> return text
> from xml.unicode.iso8859 import wstring
> wstring.install_alias('ISO-8859-1', 'ISO_8859-1:1987')
> #Note: Pass through to wstrop. This means we don't play nice and
> #Escape characters that are not in the target encoding.
> ws = wstring.from_utf8(text)
> text = ws.encode(encoding)
> #This version would skip all untranslatable chars: see wstrop.c
> #text = ws.encode(encoding, 1)
> return text
>
> There is an error in the comment of line 3 of the above snippet
> (codecs are only in python2.0), so Python 1.5 will actually execute the
> except statement, and therefore an xml.unicode.iso8859 package seems to be
> required.
Yes. I too am trying to clarify the sitruation with the unicode
package. Martin von Loewis actually helped with the code you quote, so
I'm surprised that he is surprised that we should be expecting the
xml.unicode package to still be in PyXML.
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From uche.ogbuji@fourthought.com Fri Nov 17 15:42:46 2000
From: uche.ogbuji@fourthought.com (Uche Ogbuji)
Date: Fri, 17 Nov 2000 08:42:46 -0700
Subject: [XML-SIG] Re: [4suite] Python 1.5 support with PyXML
0.6.2/4Suite0.9.2
References: <3A13FDD5.A02CB400@fourthought.com> <200011161931.UAA00777@loewis.home.cs.tu-berlin.de> <3A143B34.71110B4E@fourthought.com> <200011171008.LAA00784@loewis.home.cs.tu-berlin.de>
Message-ID: <3A1551F6.1A9CD90D@fourthought.com>
"Martin v. Loewis" wrote:
>
> > I guess I got it wrong again. OK, but if there is no unicode package,
> > the code 4DOM relied on for conversions in Python 1.5.2 pretty much
> > breaks, viz
> >
> > from xml.unicode.iso8859 import wstring
> >
> > So what am I still missing?
>
> An UTF-8 to Latin-1 converter, I guess :-)
>
> At the moment, if the output encoding is UTF-8, it works, since it
> won't even try to import the wstring module. Any other output encoding
> fails at the moment. With PyXML 0.5, ISO-8859-1 was also supported (if
> you had compiled wstring yourself); anything else fails.
>
> Is that an acceptable restriction? I don't want to restore the wstring
> module just to provide Latin-1 conversion, since it is another
> extension module (even though I'm the author of the thing).
Actually, it provided more than just Latin-1. It provided all the
ISO-8859-X conversions. And we did used to receive questions about
ISO-8859-7, for instance.
> If you think 4DOM (and PyXML) users are entitled to Latin-1 output
> even with Python 1.5, I'd be willing to contribute a UTF-8-to-Latin-1
> converter. That one wouldn't go through an intermediate Unicode
> representation, and it would be 100% pure Python.
>
> What do you think?
Well, we at Fourthought have moved on to Python 1.5.2, but as we all
heard from the responses to my question yesterday, some have reasons to
stick to Python 1.5.2 for now.
So I guess the big question is: for those sticking with Python 1.5.2, is
the old ISO conversion facility from xml.unicode still needed?
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From uche.ogbuji@fourthought.com Fri Nov 17 15:45:59 2000
From: uche.ogbuji@fourthought.com (Uche Ogbuji)
Date: Fri, 17 Nov 2000 08:45:59 -0700
Subject: [4suite] Re: [XML-SIG] Python 1.5 support with PyXML
0.6.2/4Suite0.9.2
References: <200011171030.LAA00973@loewis.home.cs.tu-berlin.de>
Message-ID: <3A1552B7.E0DF0096@fourthought.com>
"Martin v. Loewis" wrote:
>
> > There is an error in the comment of line 3 of the above snippet
> > (codecs are only in python2.0), so Python 1.5 will actually execute the
> > except statement, and therefore an xml.unicode.iso8859 package seems to be
> > required.
>
> It is required if you want Latin-1 output. If you want, say, Latin-2
> output, you lose with both releases. If you want UTF-8 output, it
> works in both cases.
I'm ever more confused now. As I mentioned, I know of at least one
person who used the code to convert to ISO-8859-7. Of course, if
they're still out there, they should speak up now...
> I could offer a solution restoring the functionality of 0.5.x (if not
> the API); provided somebody speaks up and says "yes, I need it, and I
> still use 0.5.x because 0.6 does not support Latin-1 output" when used
> with 4DOM.
Exactly. Let's hear from those whom this would affect. Possibly
there's no problem. My personal feelings are that if character
conversions are a big need, it should make it all the more urgent to
migrate to Python 2.0.
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From Alexandre.Fayolle@logilab.fr Fri Nov 17 15:49:48 2000
From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle)
Date: Fri, 17 Nov 2000 16:49:48 +0100 (CET)
Subject: [XML-SIG] Re: [4suite] Python 1.5 support with PyXML
0.6.2/4Suite0.9.2
In-Reply-To: <3A1551F6.1A9CD90D@fourthought.com>
Message-ID:
On Fri, 17 Nov 2000, Uche Ogbuji wrote:
> So I guess the big question is: for those sticking with Python 1.5.2, is
> the old ISO conversion facility from xml.unicode still needed?
As far as I'm concerned, yes, definitely.
Alexandre Fayolle
--
http://www.logilab.com
Narval is the first software agent available as free software (GPL).
LOGILAB, Paris (France).
From akuchlin@mems-exchange.org Fri Nov 17 15:50:18 2000
From: akuchlin@mems-exchange.org (Andrew Kuchling)
Date: Fri, 17 Nov 2000 10:50:18 -0500
Subject: [XML-SIG] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To: <3A155110.74C2B527@fourthought.com>; from uche.ogbuji@fourthought.com on Fri, Nov 17, 2000 at 08:38:56AM -0700
References: <3A155110.74C2B527@fourthought.com>
Message-ID: <20001117105018.C25735@kronos.cnri.reston.va.us>
On Fri, Nov 17, 2000 at 08:38:56AM -0700, Uche Ogbuji wrote:
>Yes. I too am trying to clarify the sitruation with the unicode
>package. Martin von Loewis actually helped with the code you quote, so
>I'm surprised that he is surprised that we should be expecting the
>xml.unicode package to still be in PyXML.
The xml.unicode package was dropped in PyXML 0.6.0 back in September,
so this isn't really news. That was the major reason for the version
number change; 0.5.x was the last series compatible with Python 1.5.2,
and 0.6.x would require the Unicode type from Python 1.6/2.0.
--amk
From odeckmyn.list@teaser.fr Fri Nov 17 15:54:38 2000
From: odeckmyn.list@teaser.fr (Olivier Deckmyn)
Date: Fri, 17 Nov 2000 16:54:38 +0100
Subject: [4suite] Re: [XML-SIG] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
References: <200011171030.LAA00973@loewis.home.cs.tu-berlin.de> <3A1552B7.E0DF0096@fourthought.com>
Message-ID: <015801c050ae$b0a2e150$0d00000a@ODECKMYN2K>
Uche, please note that people using both your great libs and Zope HAVE TO
keep on using Python 1.5.2 !
(as far as Py2 is not supported by Zope)
Thanx !
----- Original Message -----
From: "Uche Ogbuji"
To: "Martin v. Loewis"
Cc: ; ;
<4suite@dollar.fourthought.com>
Sent: Friday, November 17, 2000 4:45 PM
Subject: Re: [4suite] Re: [XML-SIG] Python 1.5 support with PyXML
0.6.2/4Suite0.9.2
> "Martin v. Loewis" wrote:
> >
> > > There is an error in the comment of line 3 of the above snippet
> > > (codecs are only in python2.0), so Python 1.5 will actually execute
the
> > > except statement, and therefore an xml.unicode.iso8859 package seems
to be
> > > required.
> >
> > It is required if you want Latin-1 output. If you want, say, Latin-2
> > output, you lose with both releases. If you want UTF-8 output, it
> > works in both cases.
>
> I'm ever more confused now. As I mentioned, I know of at least one
> person who used the code to convert to ISO-8859-7. Of course, if
> they're still out there, they should speak up now...
>
> > I could offer a solution restoring the functionality of 0.5.x (if not
> > the API); provided somebody speaks up and says "yes, I need it, and I
> > still use 0.5.x because 0.6 does not support Latin-1 output" when used
> > with 4DOM.
>
> Exactly. Let's hear from those whom this would affect. Possibly
> there's no problem. My personal feelings are that if character
> conversions are a big need, it should make it all the more urgent to
> migrate to Python 2.0.
>
>
> --
> Uche Ogbuji Principal Consultant
> uche.ogbuji@fourthought.com +1 303 583 9900 x 101
> Fourthought, Inc. http://Fourthought.com
> 4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
> Software-engineering, knowledge-management, XML, CORBA, Linux, Python
> _______________________________________________
> 4suite mailing list
> 4suite@lists.fourthought.com
> http://lists.fourthought.com/mailman/listinfo/4suite
>
From uche.ogbuji@fourthought.com Fri Nov 17 15:56:24 2000
From: uche.ogbuji@fourthought.com (uche.ogbuji@fourthought.com)
Date: Fri, 17 Nov 2000 08:56:24 -0700
Subject: [XML-SIG] Incompatible and bugs
In-Reply-To: Message from Bastian Kleineidam
of "Fri, 17 Nov 2000 14:06:46 +0100."
Message-ID: <200011171556.IAA14413@localhost.localdomain>
> 3) The documentation suggests to use xml.dom.ext.reader.Sax2.FromXml,
> but in the source it is marked as deprecated.
>
> What functions should I use then to build DOM trees? If you mark
> something deprecated you should also write what the new functions
> are.
This part is my fault. I should have updated the docs.
Basically:
from xml.dom.ext.reader import Sax2
reader = Sax2.Reader(validate=0)
xml = ""
xml_doc = reader.fromStream(stream)
See
http://lists.fourthought.com/pipermail/4suite/2000-November/000619.html
for more details
I'll update the docs.
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From uche.ogbuji@fourthought.com Fri Nov 17 15:59:39 2000
From: uche.ogbuji@fourthought.com (uche.ogbuji@fourthought.com)
Date: Fri, 17 Nov 2000 08:59:39 -0700
Subject: [XML-SIG] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To: Message from Andrew Kuchling
of "Fri, 17 Nov 2000 10:50:18 EST." <20001117105018.C25735@kronos.cnri.reston.va.us>
Message-ID: <200011171559.IAA14424@localhost.localdomain>
> On Fri, Nov 17, 2000 at 08:38:56AM -0700, Uche Ogbuji wrote:
> >Yes. I too am trying to clarify the sitruation with the unicode
> >package. Martin von Loewis actually helped with the code you quote, so
> >I'm surprised that he is surprised that we should be expecting the
> >xml.unicode package to still be in PyXML.
>
> The xml.unicode package was dropped in PyXML 0.6.0 back in September,
> so this isn't really news. That was the major reason for the version
> number change; 0.5.x was the last series compatible with Python 1.5.2,
> and 0.6.x would require the Unicode type from Python 1.6/2.0.
OK. I guess I must have slept through that conversation.
If Alexander finds that PyXML 0.5.5.1 is fine and stable with 4Suite 0.9.2 and
Python 1.5.2, I think all shall be well. We can post simple instructions for
the users given the status quo.
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From uche.ogbuji@fourthought.com Fri Nov 17 16:01:39 2000
From: uche.ogbuji@fourthought.com (Uche Ogbuji)
Date: Fri, 17 Nov 2000 09:01:39 -0700
Subject: [4suite] Re: [XML-SIG] Python 1.5 support with PyXML
0.6.2/4Suite0.9.2
References: <200011171030.LAA00973@loewis.home.cs.tu-berlin.de> <3A1552B7.E0DF0096@fourthought.com> <015801c050ae$b0a2e150$0d00000a@ODECKMYN2K>
Message-ID: <3A155663.9456AB13@fourthought.com>
Olivier Deckmyn wrote:
>
> Uche, please note that people using both your great libs and Zope HAVE TO
> keep on using Python 1.5.2 !
> (as far as Py2 is not supported by Zope)
Don't misunderstand me. I'm not saying we're planning to abandon Python
1.5.2 users. I'm just pointing out that they might have to use a
back-dated version of PyXML.
Would it suffice for you if all was well using PyXML 0.5.5.1?
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From Alexandre.Fayolle@logilab.fr Fri Nov 17 16:03:18 2000
From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle)
Date: Fri, 17 Nov 2000 17:03:18 +0100 (CET)
Subject: [4suite] Re: [XML-SIG] Python 1.5 support with PyXML
0.6.2/4Suite0.9.2
In-Reply-To: <3A1552B7.E0DF0096@fourthought.com>
Message-ID:
On Fri, 17 Nov 2000, Uche Ogbuji wrote:
> Exactly. Let's hear from those whom this would affect. Possibly
> there's no problem. My personal feelings are that if character
> conversions are a big need, it should make it all the more urgent to
> migrate to Python 2.0.
I may be completely missing the point, if so please correct me.
I'm fully aware of what unicode can bring in terms of internationalisation
of a software product, especially since I live in a place where 8bits
character encoding is quite common. However switching to Python 2 right
now seems difficult:
* a huge number of people are using redhat 6.x distros, and upgrading to
python2.0 on such a box is not a trivial task.
* as it has been pointed out before, there are binary compatibility
issues with some utility libraries (programs will still run under linux,
but Win32 platforms will fail completely)
It is important that people providing base libraries (such as 4Suite or
PyXML) do the move first, since people putting up application depend on
these libraries. But I feel that completely abandonning 1.5.2 support now
is too early, because most library providers still don't have make the
step, and since the vast majority of users is still dazzled by the 1.6/2.0
conflicts and may be having problems upgrading to Python 2.0 due to
distribution problems or local administration policies.
Alexandre Fayolle
--
http://www.logilab.com
Narval is the first software agent available as free software (GPL).
LOGILAB, Paris (France).
From tpassin@home.com Fri Nov 17 16:14:07 2000
From: tpassin@home.com (Thomas B. Passin)
Date: Fri, 17 Nov 2000 11:14:07 -0500
Subject: [XML-SIG] Re: [4suite] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
References:
Message-ID: <005201c050b1$69860c40$7cac1218@reston1.va.home.com>
Alexandre Fayolle wrote
> On Fri, 17 Nov 2000, Uche Ogbuji wrote:
>
> > So I guess the big question is: for those sticking with
Python 1.5.2, is
> > the old ISO conversion facility from xml.unicode still
needed?
>
> As far as I'm concerned, yes, definitely.
>
I'd say so, too. I think most people using the python 1.5.2
package expect things to work right - without thinking about
encoding issues - in the same examples they have been using.
Using 6.1, apparently, we get UTF-8 if we don't do anything
about it. It seems to work most of the iime, at least so
far on my own system. Which is fine unless there's a
stumble because of -1 latin encoding that isn't right for
UTF-8 (which someone alluded to).
The upshot seems to be this - provide a means for latin
(8859-1 if I understand correctly) encoding if it's
reasonably possible. I don't think anything else needs to
be supported besides this.
Thanks,
Tom Passin
From Alexandre.Fayolle@logilab.fr Fri Nov 17 16:16:58 2000
From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle)
Date: Fri, 17 Nov 2000 17:16:58 +0100 (CET)
Subject: [XML-SIG] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To: <200011171559.IAA14424@localhost.localdomain>
Message-ID:
On Fri, 17 Nov 2000 uche.ogbuji@fourthought.com wrote:
> > The xml.unicode package was dropped in PyXML 0.6.0 back in September,
> > so this isn't really news. That was the major reason for the version
> > number change; 0.5.x was the last series compatible with Python 1.5.2,
> > and 0.6.x would require the Unicode type from Python 1.6/2.0.
>
> OK. I guess I must have slept through that conversation.
I think I've found where the confusion came from (at least on my part). In
October, there was the announce of the PyXML 0.6.1 release:
http://www.python.org/pipermail/xml-sig/2000-October/005094.html
It states:
"Changes in this version, compared to 0.6.0:
* Support for Python 1.5.2 was restored, as long as no character
set recoding is required"
and
"Changes of version 0.6.0, compared to 0.5.x:
* The proprietary Unicode type has been removed. Instead,
PyXML now relies on the standard Python Unicode type. In turn, PyXML
0.6.0 will not work with Python 1.5. It has been tested with 2.0b1."
I (and maybe others) had overlooked the "as long as no character recoding
is required", and just kept the "support for python 1.5.2 was restored in
mind".
I'm sorry I caused this mess on the mailing list. What consoles me is that
it has enabled us to see what the state of the 1.5.2/2.0 migration really
was.
> If Alexander finds that PyXML 0.5.5.1 is fine and stable with 4Suite
> 0.9.2 and Python 1.5.2, I think all shall be well. We can post simple
> instructions for the users given the status quo.
I confirm this.
Alexandre Fayolle
--
http://www.logilab.com
Narval is the first software agent available as free software (GPL).
LOGILAB, Paris (France).
From akuchlin@mems-exchange.org Fri Nov 17 16:17:24 2000
From: akuchlin@mems-exchange.org (Andrew Kuchling)
Date: Fri, 17 Nov 2000 11:17:24 -0500
Subject: [XML-SIG] Re: [4suite] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To: <005201c050b1$69860c40$7cac1218@reston1.va.home.com>; from tpassin@home.com on Fri, Nov 17, 2000 at 11:14:07AM -0500
References: <005201c050b1$69860c40$7cac1218@reston1.va.home.com>
Message-ID: <20001117111724.F25735@kronos.cnri.reston.va.us>
On Fri, Nov 17, 2000 at 11:14:07AM -0500, Thomas B. Passin wrote:
>The upshot seems to be this - provide a means for latin
>(8859-1 if I understand correctly) encoding if it's
>reasonably possible. I don't think anything else needs to
1.6/2.0 certainly supports Latin-1 conversions:
kronos Python-2.0>./python
Python 2.0 (#80, Nov 1 2000, 15:56:36)
[GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> ustr=u'Élections Canada'
>>> ustr.encode('utf-8')
'\303\211lections Canada'
>>> ustr.encode('latin1')
'\311lections Canada'
--amk
From fdrake@acm.org Fri Nov 17 16:18:54 2000
From: fdrake@acm.org (Fred L. Drake, Jr.)
Date: Fri, 17 Nov 2000 11:18:54 -0500 (EST)
Subject: [XML-SIG] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To: <20001116165954.A41413@ubka.uni-karlsruhe.de>
References:
<20001116105059.A23853@kronos.cnri.reston.va.us>
<20001116165954.A41413@ubka.uni-karlsruhe.de>
Message-ID: <14869.23150.761173.21904@cj42289-a.reston1.va.home.com>
Guenter Radestock writes:
> What about Python 1.6? I upgraded evrything at our site to 1.6
> shortly after it came out (the append(.,.) was some work), then
> about a week or two later came 2.0, but - I don't have the time to
> keep upgrading every week or so.
I wish we had been able to announce at the time of the 1.6 release
that 2.0 was imminent, but we were not able to do so for political
reasons.
> Is 1.6 officially unsupported (seems so)? 1.6 does have some Unicode
> support. Will it work more like 1.5 or like 2.0? Will the XML package
> work at all (I was able to successfully install, but I did not do
> anything with it, yet).
1.6 was released for politcal reasons; 2.0 is the version we
actually care about.
-Fred
--
Fred L. Drake, Jr.
PythonLabs at Digital Creations
From olivier.deckmyn@mail.dotcom.fr Fri Nov 17 16:27:03 2000
From: olivier.deckmyn@mail.dotcom.fr (Olivier Deckmyn)
Date: Fri, 17 Nov 2000 17:27:03 +0100
Subject: [XML-SIG] on leur parle de Delphi ? ;)
Message-ID: <001101c050b3$383c2e10$0d00000a@ODECKMYN2K>
C'est un message de format MIME en plusieurs parties.
------=_NextPart_000_000E_01C050BB.99ED8340
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
ftp://ftp.tummy.com/pub/tummy/Python/netstring/netstring.py
------=_NextPart_000_000E_01C050BB.99ED8340
Content-Type: application/octet-stream;
name="netstring.py.url"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="netstring.py.url"
[DEFAULT]
BASEURL=ftp://ftp.tummy.com/pub/tummy/Python/netstring/netstring.py
[InternetShortcut]
URL=ftp://ftp.tummy.com/pub/tummy/Python/netstring/netstring.py
Modified=10B9B132B350C00170
------=_NextPart_000_000E_01C050BB.99ED8340--
From uche.ogbuji@fourthought.com Fri Nov 17 16:27:25 2000
From: uche.ogbuji@fourthought.com (Uche Ogbuji)
Date: Fri, 17 Nov 2000 09:27:25 -0700
Subject: [4suite] Re: [XML-SIG] Python 1.5 support with PyXML
0.6.2/4Suite0.9.2
References:
Message-ID: <3A155C6D.7D9F1F89@fourthought.com>
Alexandre Fayolle wrote:
>
> On Fri, 17 Nov 2000, Uche Ogbuji wrote:
>
> > Exactly. Let's hear from those whom this would affect. Possibly
> > there's no problem. My personal feelings are that if character
> > conversions are a big need, it should make it all the more urgent to
> > migrate to Python 2.0.
>
> I may be completely missing the point, if so please correct me.
>
> I'm fully aware of what unicode can bring in terms of internationalisation
> of a software product, especially since I live in a place where 8bits
> character encoding is quite common. However switching to Python 2 right
> now seems difficult:
>
> * a huge number of people are using redhat 6.x distros, and upgrading to
> python2.0 on such a box is not a trivial task.
> * as it has been pointed out before, there are binary compatibility
> issues with some utility libraries (programs will still run under linux,
> but Win32 platforms will fail completely)
>
> It is important that people providing base libraries (such as 4Suite or
> PyXML) do the move first, since people putting up application depend on
> these libraries. But I feel that completely abandonning 1.5.2 support now
> is too early, because most library providers still don't have make the
> step, and since the vast majority of users is still dazzled by the 1.6/2.0
> conflicts and may be having problems upgrading to Python 2.0 due to
> distribution problems or local administration policies.
OK, so all together now. How hard would it be to continue updating
PyXML 0.5.5.x with bug fixes and new features in all other areas of the
package?
I'm going back and forth on this one. I guess it's because I'm still
neutral. However, given that Red Hat will not be moving to Python 2.0
until Red Hat 8.0, which could be a year away, and given Alexandre's
comments, we'll most likely be maintaining Python 1.5.2 support for a
while yet in 4Suite.
The questions then is: what about PyXML?
To be fair to those such as Andrew and Martin who clearly want to move
on, is there someone who still relies on Python 1.5.2 that could
volunteer to maintain a 1.5.2-friendly version of PyXML?
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From uche.ogbuji@fourthought.com Fri Nov 17 16:29:53 2000
From: uche.ogbuji@fourthought.com (Uche Ogbuji)
Date: Fri, 17 Nov 2000 09:29:53 -0700
Subject: [4suite] Re: [XML-SIG] Python 1.5 support with PyXML
0.6.2/4Suite0.9.2
References:
Message-ID: <3A155D01.321AB147@fourthought.com>
Alexandre Fayolle wrote:
> > If Alexander finds that PyXML 0.5.5.1 is fine and stable with 4Suite
> > 0.9.2 and Python 1.5.2, I think all shall be well. We can post simple
> > instructions for the users given the status quo.
>
> I confirm this.
Good. That helps. I'll update our FAQ with all of these particulars.
The remaining question is whether there will be any on-going maintenance
of Python 0.5.5.1. There should probably be at least another CVS branch
for Python 1.5.2 support.
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From uche.ogbuji@fourthought.com Fri Nov 17 16:39:25 2000
From: uche.ogbuji@fourthought.com (uche.ogbuji@fourthought.com)
Date: Fri, 17 Nov 2000 09:39:25 -0700
Subject: [XML-SIG] Re: [4suite] Python 1.5 support with PyXML
0.6.2/4Suite0.9.2
In-Reply-To: Message from Andrew Kuchling
of "Fri, 17 Nov 2000 11:17:24 EST." <20001117111724.F25735@kronos.cnri.reston.va.us>
Message-ID: <200011171639.JAA14554@localhost.localdomain>
> On Fri, Nov 17, 2000 at 11:14:07AM -0500, Thomas B. Passin wrote:
> >The upshot seems to be this - provide a means for latin
> >(8859-1 if I understand correctly) encoding if it's
> >reasonably possible. I don't think anything else needs to
> =
> 1.6/2.0 certainly supports Latin-1 conversions:
> =
> kronos Python-2.0>./python
> Python 2.0 (#80, Nov 1 2000, 15:56:36)
> [GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2
> Type "copyright", "credits" or "license" for more information.
> >>> ustr=3Du'=C9lections Canada'
> >>> ustr.encode('utf-8')
> '\303\211lections Canada'
> >>> ustr.encode('latin1')
> '\311lections Canada'
Yes, but Alexandre gives very good reason why this is not a perfect world=
=
where the above answer suffices.
As I read it I remembered back when I was first trying to use Python to d=
eploy =
a Web app, and my ISP (Mikita, I think), only provided Python 1.4, wherea=
s I =
needed Python 1.5 for my CGI code.
Even though I explicitly made Python support a reason for choosing Mikita=
, =
they refused to hear all my begging, pleading and screaming to upgrade th=
e =
package. They cited understandable but unhelpful reasons about the diffi=
culty =
of changing a system used by so many people.
Well, those of us who are now in complete control of our Python systems s=
hould =
not forget that not everyone is. Just the fact that Red Hat will not be =
putting out a Python 2.0 release for a while (for quite understandable =
reasons) will prevent a lot of migrations. Of course that particular mat=
ter =
is not helped by the fact that the BeOpen Python 2.0 RPMs are so horrid =
(where's Oliver Andrich when you need him?)
But anyway, let's be mindful of people who are not as quick to jump onto =
the =
latest versions.
-- =
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com =
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From tpassin@home.com Fri Nov 17 17:42:52 2000
From: tpassin@home.com (Thomas B. Passin)
Date: Fri, 17 Nov 2000 12:42:52 -0500
Subject: [XML-SIG] 4DOM Test Suite not in PYXML.
References: <200011161932.UAA00778@loewis.home.cs.tu-berlin.de> <004801c05020$37494c60$7cac1218@reston1.va.home.com> <200011171015.LAA00833@loewis.home.cs.tu-berlin.de>
Message-ID: <008b01c050bd$cfe97b00$7cac1218@reston1.va.home.com>
This is a multi-part message in MIME format.
------=_NextPart_000_0088_01C05093.E6D97740
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
I just did a complete new install of pyXML on my Windows
machine. I got the same results. More details below:
Martin v. Loewis wrote -
> > In another post, I said that 4Suite from pyXML6.1 passed
its
> > tests. That wasn't quite true. I installed it. Then I
> > renamed the xml directory.
>
> Can you please be more specific? What exactly did you
install, how
> exactly did you install it? What directory did you rename,
and which
> was the new name?
>
It doesn't matter what I renamed it to ( it may have been
"xxxxml"). I knew the install would go into python/xml, and
I didn't want to mix up the new files with the pyXML6.1
files. By renaming my xml directory, I caused the
installer to create a new, originally empty xml directory to
load its files into.
I again installed pyXML from the Sourceforge site,
downloaded today. The exact filename is:
PyXML-0.6.1.win32-py1.5.exe
The date on the the file is today, which isn't helpful.
Its size is 308,530 bytes.
Attached is a complete directory listing of all diectories
and subdirectories of
c:\Program Files\Python\xml
which is where the installer put the files. As I said, this
was a new, clean directory. I defy you to find a "test"
directory or any file that includes the string "test" in its
name.
> > Whew! It shouldn't be so hard. ***Please*** include
self
> > test programs in the pyXML distibution.
>
> There are self test programs in PyXML, in the test
directory.
>
There is no such directory in the version I installed - see
above.
> I'm not using 4Suite myself - what was the reason that you
didn't
> install it on top of PyXML?
>
I didn't know if 4Thought's version was compatible with
pyXML's especially with respect to 1.5.2 operability. So I
wanted to be able to go back if possible. Anyway, I was
looking for documentation and especially test programs, not
necessarily an upgrade. Neither pyXML nor 4Thought's
package allow installation anywhere else but in the
Python/xml directory (I think they should). That's why I
had to engage in all those maneuvers.
BTW, I'm not complaining at all here. I admire the way you
stepped in and helped so much to get the pyXML package ready
for 2.0, and I appreciate all the hard work you did. I'm
just hoping to get the thing a bit better, that's all.
Cheers,
Tom Passin
------=_NextPart_000_0088_01C05093.E6D97740
Content-Type: text/plain;
name="xml_dir_list.txt"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="xml_dir_list.txt"
Volume in drive C is HP_PAVILION Serial number is 3674:1ED2
Directory of C:\Program Files\Python\xml\*
11-17-00 12:20 .=20
11-17-00 12:20 ..
11-17-00 12:20 dom
11-17-00 12:20 marshal
11-17-00 12:20 parsers
11-17-00 12:20 sax
11-17-00 12:20 utils
11-17-00 12:23 0 xml_dir_list.txt
11-17-00 12:20 451 _checkversion.py
11-17-00 12:20 641 _checkversion.pyc
11-17-00 12:20 608 _checkversion.pyo
11-17-00 12:20 146 __init__.py
11-17-00 12:20 277 __init__.pyc
11-17-00 12:20 265 __init__.pyo
2,388 bytes in 7 files and 7 dirs 98,304 bytes allocated
Directory of C:\Program Files\Python\xml\dom\*
11-17-00 12:20 .=20
11-17-00 12:20 ..
11-17-00 12:20 ext
11-17-00 12:20 html
11-17-00 12:20 3,218 Attr.py
11-17-00 12:20 4,194 Attr.pyc
11-17-00 12:20 4,014 Attr.pyo
11-17-00 12:20 1,161 CDATASection.py
11-17-00 12:20 1,443 CDATASection.pyc
11-17-00 12:20 1,392 CDATASection.pyo
11-17-00 12:20 3,489 CharacterData.py
11-17-00 12:20 4,784 CharacterData.pyc
11-17-00 12:20 4,559 CharacterData.pyo
11-17-00 12:20 1,240 Comment.py
11-17-00 12:20 1,394 Comment.pyc
11-17-00 12:20 1,340 Comment.pyo
11-17-00 12:20 13,077 Document.py
11-17-00 12:20 16,323 Document.pyc
11-17-00 12:20 15,534 Document.pyo
11-17-00 12:20 1,476 DocumentFragment.py
11-17-00 12:20 1,749 DocumentFragment.pyc
11-17-00 12:20 1,689 DocumentFragment.pyo
11-17-00 12:20 4,083 DocumentType.py
11-17-00 12:20 4,784 DocumentType.pyc
11-17-00 12:20 4,586 DocumentType.pyo
11-17-00 12:20 2,609 DOMImplementation.py
11-17-00 12:20 3,478 DOMImplementation.pyc
11-17-00 12:20 3,295 DOMImplementation.pyo
11-17-00 12:20 8,536 Element.py
11-17-00 12:20 10,682 Element.pyc
11-17-00 12:20 10,154 Element.pyo
11-17-00 12:20 2,649 Entity.py
11-17-00 12:20 3,041 Entity.pyc
11-17-00 12:20 2,927 Entity.pyo
11-17-00 12:20 1,515 EntityReference.py
11-17-00 12:20 1,707 EntityReference.pyc
11-17-00 12:20 1,647 EntityReference.pyo
11-17-00 12:20 3,259 Event.py
11-17-00 12:20 5,514 Event.pyc
11-17-00 12:20 5,262 Event.pyo
11-17-00 12:20 20,364 javadom.py
11-17-00 12:20 37,587 javadom.pyc
11-17-00 12:20 35,446 javadom.pyo
11-17-00 12:20 15,008 minidom.py
11-17-00 12:20 25,120 minidom.pyc
11-17-00 12:20 23,638 minidom.pyo
11-17-00 12:20 4,037 NamedNodeMap.py
11-17-00 12:20 6,281 NamedNodeMap.pyc
11-17-00 12:20 5,960 NamedNodeMap.pyo
11-17-00 12:20 16,520 Node.py
11-17-00 12:20 17,732 Node.pyc
11-17-00 12:20 16,778 Node.pyo
11-17-00 12:20 1,324 NodeFilter.py
11-17-00 12:20 1,421 NodeFilter.pyc
11-17-00 12:20 1,349 NodeFilter.pyo
11-17-00 12:20 4,855 NodeIterator.py
11-17-00 12:20 6,193 NodeIterator.pyc
11-17-00 12:20 5,860 NodeIterator.pyo
11-17-00 12:20 2,563 NodeList.py
11-17-00 12:20 3,431 NodeList.pyc
11-17-00 12:20 3,245 NodeList.pyo
11-17-00 12:20 2,111 Notation.py
11-17-00 12:20 2,550 Notation.pyc
11-17-00 12:20 2,451 Notation.pyo
11-17-00 12:20 2,312 ProcessingInstruction.py
11-17-00 12:20 2,943 ProcessingInstruction.pyc
11-17-00 12:20 2,832 ProcessingInstruction.pyo
11-17-00 12:20 7,369 pulldom.py
11-17-00 12:20 9,963 pulldom.pyc
11-17-00 12:20 9,185 pulldom.pyo
11-17-00 12:20 2,875 Text.py
11-17-00 12:20 2,924 Text.pyc
11-17-00 12:20 2,747 Text.pyo
11-17-00 12:20 7,220 TreeWalker.py
11-17-00 12:20 8,966 TreeWalker.pyc
11-17-00 12:20 8,513 TreeWalker.pyo
11-17-00 12:20 1,531 __init__.py
11-17-00 12:20 1,650 __init__.pyc
11-17-00 12:20 1,554 __init__.pyo
496,212 bytes in 75 files and 4 dirs 1,392,640 bytes =
allocated
Directory of C:\Program Files\Python\xml\dom\ext\*
11-17-00 12:20 .=20
11-17-00 12:20 ..
11-17-00 12:20 reader
11-17-00 12:20 15,656 Printer.py
11-17-00 12:20 18,118 Printer.pyc
11-17-00 12:20 17,059 Printer.pyo
11-17-00 12:20 2,487 Visitor.py
11-17-00 12:20 3,349 Visitor.pyc
11-17-00 12:20 3,187 Visitor.pyo
11-17-00 12:20 3,065 XHtmlPrinter.py
11-17-00 12:20 4,045 XHtmlPrinter.pyc
11-17-00 12:20 3,826 XHtmlPrinter.pyo
11-17-00 12:20 9,540 __init__.py
11-17-00 12:20 10,612 __init__.pyc
11-17-00 12:20 10,030 __init__.pyo
100,974 bytes in 12 files and 3 dirs 229,376 bytes allocated
Directory of C:\Program Files\Python\xml\dom\ext\reader\*
11-17-00 12:20 .=20
11-17-00 12:20 ..
11-17-00 12:20 4,241 HtmlLib.py
11-17-00 12:20 5,775 HtmlLib.pyc
11-17-00 12:20 5,460 HtmlLib.pyo
11-17-00 12:20 3,366 HtmlSax.py
11-17-00 12:20 4,859 HtmlSax.pyc
11-17-00 12:20 4,511 HtmlSax.pyo
11-17-00 12:20 6,148 Sax.py
11-17-00 12:20 8,486 Sax.pyc
11-17-00 12:20 8,004 Sax.pyo
11-17-00 12:20 11,476 Sax2.py
11-17-00 12:20 14,080 Sax2.pyc
11-17-00 12:20 13,267 Sax2.pyo
11-17-00 12:20 8,587 Sax2Lib.py
11-17-00 12:20 11,306 Sax2Lib.pyc
11-17-00 12:20 10,889 Sax2Lib.pyo
11-17-00 12:20 190 __init__.py
11-17-00 12:20 117 __init__.pyc
11-17-00 12:20 114 __init__.pyo
120,876 bytes in 18 files and 2 dirs 294,912 bytes allocated
Total for: C:\Program Files\Python\xml\dom\ext\*
221,850 bytes in 30 files and 5 dirs 524,288 bytes allocated
Directory of C:\Program Files\Python\xml\dom\html\*
11-17-00 12:20 .=20
11-17-00 12:20 ..
11-17-00 12:20 11,325 generateHtml.py
11-17-00 12:20 12,339 generateHtml.pyc
11-17-00 12:20 11,595 generateHtml.pyo
11-17-00 12:20 4,017 HTMLAnchorElement.py
11-17-00 12:20 7,559 HTMLAnchorElement.pyc
11-17-00 12:20 7,141 HTMLAnchorElement.pyo
11-17-00 12:20 3,621 HTMLAppletElement.py
11-17-00 12:20 6,678 HTMLAppletElement.pyc
11-17-00 12:20 6,429 HTMLAppletElement.pyo
11-17-00 12:20 3,145 HTMLAreaElement.py
11-17-00 12:20 5,365 HTMLAreaElement.pyc
11-17-00 12:20 5,155 HTMLAreaElement.pyo
11-17-00 12:20 1,637 HTMLBaseElement.py
11-17-00 12:20 2,291 HTMLBaseElement.pyc
11-17-00 12:20 2,204 HTMLBaseElement.pyo
11-17-00 12:20 1,850 HTMLBaseFontElement.py
11-17-00 12:20 2,806 HTMLBaseFontElement.pyc
11-17-00 12:20 2,701 HTMLBaseFontElement.pyo
11-17-00 12:20 2,529 HTMLBodyElement.py
11-17-00 12:20 4,218 HTMLBodyElement.pyc
11-17-00 12:20 4,059 HTMLBodyElement.pyo
11-17-00 12:20 1,435 HTMLBRElement.py
11-17-00 12:20 1,833 HTMLBRElement.pyc
11-17-00 12:20 1,764 HTMLBRElement.pyo
11-17-00 12:20 2,861 HTMLButtonElement.py
11-17-00 12:20 4,537 HTMLButtonElement.pyc
11-17-00 12:20 4,345 HTMLButtonElement.pyo
11-17-00 12:20 2,151 HTMLCollection.py
11-17-00 12:20 3,177 HTMLCollection.pyc
11-17-00 12:20 3,015 HTMLCollection.pyo
11-17-00 12:20 1,536 HTMLDirectoryElement.py
11-17-00 12:20 1,939 HTMLDirectoryElement.pyc
11-17-00 12:20 1,864 HTMLDirectoryElement.pyo
11-17-00 12:20 1,644 HTMLDivElement.py
11-17-00 12:20 2,307 HTMLDivElement.pyc
11-17-00 12:20 2,220 HTMLDivElement.pyo
11-17-00 12:20 1,523 HTMLDListElement.py
11-17-00 12:20 1,902 HTMLDListElement.pyc
11-17-00 12:20 1,827 HTMLDListElement.pyo
11-17-00 12:20 11,333 HTMLDocument.py
11-17-00 12:20 13,687 HTMLDocument.pyc
11-17-00 12:20 13,072 HTMLDocument.pyo
11-17-00 12:20 1,125 HTMLDOMImplementation.py
11-17-00 12:20 1,656 HTMLDOMImplementation.pyc
11-17-00 12:20 1,587 HTMLDOMImplementation.pyo
11-17-00 12:20 2,469 HTMLElement.py
11-17-00 12:20 3,925 HTMLElement.pyc
11-17-00 12:20 3,769 HTMLElement.pyo
11-17-00 12:20 1,429 HTMLFieldSetElement.py
11-17-00 12:20 1,709 HTMLFieldSetElement.pyc
11-17-00 12:20 1,634 HTMLFieldSetElement.pyo
11-17-00 12:20 1,834 HTMLFontElement.py
11-17-00 12:20 2,750 HTMLFontElement.pyc
11-17-00 12:20 2,645 HTMLFontElement.pyo
11-17-00 12:20 3,581 HTMLFormElement.py
11-17-00 12:20 5,649 HTMLFormElement.pyc
11-17-00 12:20 5,304 HTMLFormElement.pyo
11-17-00 12:20 3,754 HTMLFrameElement.py
11-17-00 12:20 6,196 HTMLFrameElement.pyc
11-17-00 12:20 5,956 HTMLFrameElement.pyo
11-17-00 12:20 1,637 HTMLFrameSetElement.py
11-17-00 12:20 2,325 HTMLFrameSetElement.pyc
11-17-00 12:20 2,238 HTMLFrameSetElement.pyo
11-17-00 12:20 1,440 HTMLHeadElement.py
11-17-00 12:20 1,832 HTMLHeadElement.pyc
11-17-00 12:20 1,763 HTMLHeadElement.pyo
11-17-00 12:20 1,445 HTMLHeadingElement.py
11-17-00 12:20 1,868 HTMLHeadingElement.pyc
11-17-00 12:20 1,799 HTMLHeadingElement.pyo
11-17-00 12:20 2,164 HTMLHRElement.py
11-17-00 12:20 3,310 HTMLHRElement.pyc
11-17-00 12:20 3,181 HTMLHRElement.pyo
11-17-00 12:20 1,440 HTMLHtmlElement.py
11-17-00 12:20 1,832 HTMLHtmlElement.pyc
11-17-00 12:20 1,763 HTMLHtmlElement.pyo
11-17-00 12:20 4,104 HTMLIFrameElement.py
11-17-00 12:20 7,135 HTMLIFrameElement.pyc
11-17-00 12:20 6,865 HTMLIFrameElement.pyo
11-17-00 12:20 4,113 HTMLImageElement.py
11-17-00 12:20 7,652 HTMLImageElement.pyc
11-17-00 12:20 7,361 HTMLImageElement.pyo
11-17-00 12:20 6,974 HTMLInputElement.py
11-17-00 12:20 11,815 HTMLInputElement.pyc
11-17-00 12:20 10,944 HTMLInputElement.pyo
11-17-00 12:20 1,693 HTMLIsIndexElement.py
11-17-00 12:20 2,204 HTMLIsIndexElement.pyc
11-17-00 12:20 2,108 HTMLIsIndexElement.pyo
11-17-00 12:20 1,930 HTMLLabelElement.py
11-17-00 12:20 2,684 HTMLLabelElement.pyc
11-17-00 12:20 2,570 HTMLLabelElement.pyo
11-17-00 12:20 1,945 HTMLLegendElement.py
11-17-00 12:20 2,726 HTMLLegendElement.pyc
11-17-00 12:20 2,612 HTMLLegendElement.pyo
11-17-00 12:20 1,695 HTMLLIElement.py
11-17-00 12:20 2,349 HTMLLIElement.pyc
11-17-00 12:20 2,253 HTMLLIElement.pyo
11-17-00 12:20 3,235 HTMLLinkElement.py
11-17-00 12:20 5,686 HTMLLinkElement.pyc
11-17-00 12:20 5,467 HTMLLinkElement.pyo
11-17-00 12:20 1,531 HTMLMapElement.py
11-17-00 12:20 2,140 HTMLMapElement.pyc
11-17-00 12:20 2,059 HTMLMapElement.pyo
11-17-00 12:20 1,522 HTMLMenuElement.py
11-17-00 12:20 1,895 HTMLMenuElement.pyc
11-17-00 12:20 1,820 HTMLMenuElement.pyo
11-17-00 12:20 2,113 HTMLMetaElement.py
11-17-00 12:20 3,281 HTMLMetaElement.pyc
11-17-00 12:20 3,158 HTMLMetaElement.pyo
11-17-00 12:20 1,649 HTMLModElement.py
11-17-00 12:20 2,293 HTMLModElement.pyc
11-17-00 12:20 2,206 HTMLModElement.pyo
11-17-00 12:20 5,505 HTMLObjectElement.py
11-17-00 12:20 10,343 HTMLObjectElement.pyc
11-17-00 12:20 9,935 HTMLObjectElement.pyo
11-17-00 12:20 2,015 HTMLOListElement.py
11-17-00 12:20 2,934 HTMLOListElement.pyc
11-17-00 12:20 2,814 HTMLOListElement.pyo
11-17-00 12:20 1,760 HTMLOptGroupElement.py
11-17-00 12:20 2,423 HTMLOptGroupElement.pyc
11-17-00 12:20 2,330 HTMLOptGroupElement.pyo
11-17-00 12:20 3,835 HTMLOptionElement.py
11-17-00 12:20 5,836 HTMLOptionElement.pyc
11-17-00 12:20 5,563 HTMLOptionElement.pyo
11-17-00 12:20 1,455 HTMLParagraphElement.py
11-17-00 12:20 1,895 HTMLParagraphElement.pyc
11-17-00 12:20 1,826 HTMLParagraphElement.pyo
11-17-00 12:20 2,102 HTMLParamElement.py
11-17-00 12:20 3,302 HTMLParamElement.pyc
11-17-00 12:20 3,179 HTMLParamElement.pyo
11-17-00 12:20 1,494 HTMLPreElement.py
11-17-00 12:20 1,897 HTMLPreElement.pyc
11-17-00 12:20 1,819 HTMLPreElement.pyo
11-17-00 12:20 1,412 HTMLQuoteElement.py
11-17-00 12:20 1,808 HTMLQuoteElement.pyc
11-17-00 12:20 1,739 HTMLQuoteElement.pyo
11-17-00 12:20 3,345 HTMLScriptElement.py
11-17-00 12:20 5,431 HTMLScriptElement.pyc
11-17-00 12:20 5,200 HTMLScriptElement.pyo
11-17-00 12:20 4,981 HTMLSelectElement.py
11-17-00 12:20 7,775 HTMLSelectElement.pyc
11-17-00 12:20 7,406 HTMLSelectElement.pyo
11-17-00 12:20 1,953 HTMLStyleElement.py
11-17-00 12:20 2,855 HTMLStyleElement.pyc
11-17-00 12:20 2,744 HTMLStyleElement.pyo
11-17-00 12:20 1,470 HTMLTableCaptionElement.py
11-17-00 12:20 1,928 HTMLTableCaptionElement.pyc
11-17-00 12:20 1,859 HTMLTableCaptionElement.pyo
11-17-00 12:20 4,929 HTMLTableCellElement.py
11-17-00 12:20 8,849 HTMLTableCellElement.pyc
11-17-00 12:20 8,507 HTMLTableCellElement.pyo
11-17-00 12:20 2,596 HTMLTableColElement.py
11-17-00 12:20 4,404 HTMLTableColElement.pyc
11-17-00 12:20 4,236 HTMLTableColElement.pyo
11-17-00 12:20 9,342 HTMLTableElement.py
11-17-00 12:20 13,278 HTMLTableElement.pyc
11-17-00 12:20 12,591 HTMLTableElement.pyo
11-17-00 12:20 3,981 HTMLTableRowElement.py
11-17-00 12:20 6,199 HTMLTableRowElement.pyc
11-17-00 12:20 5,923 HTMLTableRowElement.pyo
11-17-00 12:20 3,054 HTMLTableSectionElement.py
11-17-00 12:20 4,826 HTMLTableSectionElement.pyc
11-17-00 12:20 4,628 HTMLTableSectionElement.pyo
11-17-00 12:20 5,246 HTMLTextAreaElement.py
11-17-00 12:20 8,573 HTMLTextAreaElement.pyc
11-17-00 12:20 6,898 HTMLTextAreaElement.pyo
11-17-00 12:20 1,983 HTMLTitleElement.py
11-17-00 12:20 2,496 HTMLTitleElement.pyc
11-17-00 12:20 2,379 HTMLTitleElement.pyo
11-17-00 12:20 1,747 HTMLUListElement.py
11-17-00 12:20 2,405 HTMLUListElement.pyc
11-17-00 12:20 2,312 HTMLUListElement.pyo
11-17-00 12:20 5,510 __init__.py
11-17-00 12:20 6,428 __init__.pyc
11-17-00 12:20 6,254 __init__.pyo
685,174 bytes in 174 files and 2 dirs 2,850,816 bytes =
allocated
Total for: C:\Program Files\Python\xml\dom\*
1,403,236 bytes in 279 files and 11 dirs 4,767,744 bytes =
allocated
Directory of C:\Program Files\Python\xml\marshal\*
11-17-00 12:20 .=20
11-17-00 12:20 ..
11-17-00 12:20 18,985 generic.py
11-17-00 12:20 23,188 generic.pyc
11-17-00 12:20 21,511 generic.pyo
11-17-00 12:20 5,970 wddx.py
11-17-00 12:20 9,372 wddx.pyc
11-17-00 12:20 8,833 wddx.pyo
11-17-00 12:20 4,228 xmlrpc.py
11-17-00 12:20 6,538 xmlrpc.pyc
11-17-00 12:20 6,068 xmlrpc.pyo
11-17-00 12:20 43 __init__.py
11-17-00 12:20 172 __init__.pyc
11-17-00 12:20 166 __init__.pyo
105,074 bytes in 12 files and 2 dirs 245,760 bytes allocated
Directory of C:\Program Files\Python\xml\parsers\*
11-17-00 12:20 .=20
11-17-00 12:20 ..
11-17-00 12:20 xmlproc
11-17-00 12:20 116 expat.py
11-17-00 12:20 260 expat.pyc
11-17-00 12:20 248 expat.pyo
11-17-00 12:20 118,784 pyexpat.pyd
11-17-00 12:20 19,967 sgmllib.py
11-17-00 12:20 21,008 sgmllib.pyc
11-17-00 12:20 19,114 sgmllib.pyo
11-17-00 12:20 24,576 sgmlop.pyd
11-17-00 12:20 48 __init__.py
11-17-00 12:20 175 __init__.pyc
11-17-00 12:20 169 __init__.pyo
204,465 bytes in 11 files and 3 dirs 360,448 bytes allocated
Directory of C:\Program Files\Python\xml\parsers\xmlproc\*
11-17-00 12:20 .=20
11-17-00 12:20 ..
11-17-00 12:20 9,324 catalog.py
11-17-00 12:20 16,228 catalog.pyc
11-17-00 12:20 14,584 catalog.pyo
11-17-00 12:20 6,841 charconv.py
11-17-00 12:20 8,116 charconv.pyc
11-17-00 12:20 7,708 charconv.pyo
11-17-00 12:20 21,730 dtdparser.py
11-17-00 12:20 25,001 dtdparser.pyc
11-17-00 12:20 23,255 dtdparser.pyo
11-17-00 12:20 12,650 errors.py
11-17-00 12:20 12,319 errors.pyc
11-17-00 12:20 12,271 errors.pyo
11-17-00 12:20 5,184 namespace.py
11-17-00 12:20 7,637 namespace.pyc
11-17-00 12:20 7,250 namespace.pyo
11-17-00 12:20 5,353 utils.py
11-17-00 12:20 12,350 utils.pyc
11-17-00 12:20 11,123 utils.pyo
11-17-00 12:20 2,194 xcatalog.py
11-17-00 12:20 3,668 xcatalog.pyc
11-17-00 12:20 3,497 xcatalog.pyo
11-17-00 12:20 6,805 xmlapp.py
11-17-00 12:20 12,203 xmlapp.pyc
11-17-00 12:20 11,699 xmlapp.pyo
11-17-00 12:20 27,892 xmldtd.py
11-17-00 12:20 41,506 xmldtd.pyc
11-17-00 12:20 39,258 xmldtd.pyo
11-17-00 12:20 19,593 xmlproc.py
11-17-00 12:20 21,064 xmlproc.pyc
11-17-00 12:20 19,642 xmlproc.pyo
11-17-00 12:20 23,970 xmlutils.py
11-17-00 12:20 31,361 xmlutils.pyc
11-17-00 12:20 29,627 xmlutils.pyo
11-17-00 12:20 9,285 xmlval.py
11-17-00 12:20 16,784 xmlval.pyc
11-17-00 12:20 15,998 xmlval.pyo
11-17-00 12:20 23 __init__.py
11-17-00 12:20 163 __init__.pyc
11-17-00 12:20 157 __init__.pyo
555,313 bytes in 39 files and 2 dirs 884,736 bytes allocated
Total for: C:\Program Files\Python\xml\parsers\*
759,778 bytes in 50 files and 5 dirs 1,245,184 bytes =
allocated
Directory of C:\Program Files\Python\xml\sax\*
11-17-00 12:20 .=20
11-17-00 12:20 ..
11-17-00 12:20 drivers
11-17-00 12:20 drivers2
11-17-00 12:20 7,824 expatreader.py
11-17-00 12:20 10,896 expatreader.pyc
11-17-00 12:20 10,386 expatreader.pyo
11-17-00 12:20 13,534 handler.py
11-17-00 12:20 13,419 handler.pyc
11-17-00 12:20 13,143 handler.pyo
11-17-00 12:20 637 sax2exts.py
11-17-00 12:20 770 sax2exts.pyc
11-17-00 12:20 737 sax2exts.pyo
11-17-00 12:20 6,752 saxexts.py
11-17-00 12:20 9,048 saxexts.pyc
11-17-00 12:20 8,685 saxexts.pyo
11-17-00 12:20 15,924 saxlib.py
11-17-00 12:20 22,950 saxlib.pyc
11-17-00 12:20 22,263 saxlib.pyo
11-17-00 12:20 20,318 saxutils.py
11-17-00 12:20 36,368 saxutils.pyc
11-17-00 12:20 34,549 saxutils.pyo
11-17-00 12:20 18,715 writer.py
11-17-00 12:20 23,048 writer.pyc
11-17-00 12:20 21,806 writer.pyo
11-17-00 12:20 13,018 xmlreader.py
11-17-00 12:20 21,669 xmlreader.pyc
11-17-00 12:20 19,848 xmlreader.pyo
11-17-00 12:20 4,392 _exceptions.py
11-17-00 12:20 6,555 _exceptions.pyc
11-17-00 12:20 6,345 _exceptions.pyo
11-17-00 12:20 1,657 __init__.py
11-17-00 12:20 2,128 __init__.pyc
11-17-00 12:20 2,050 __init__.pyo
389,434 bytes in 30 files and 4 dirs 688,128 bytes allocated
Directory of C:\Program Files\Python\xml\sax\drivers\*
11-17-00 12:20 .=20
11-17-00 12:20 ..
11-17-00 12:20 1,100 drv_htmllib.py
11-17-00 12:20 2,424 drv_htmllib.pyc
11-17-00 12:20 2,177 drv_htmllib.pyo
11-17-00 12:20 3,278 drv_ltdriver.py
11-17-00 12:20 6,801 drv_ltdriver.pyc
11-17-00 12:20 6,116 drv_ltdriver.pyo
11-17-00 12:20 949 drv_ltdriver_val.py
11-17-00 12:20 2,325 drv_ltdriver_val.pyc
11-17-00 12:20 2,223 drv_ltdriver_val.pyo
11-17-00 12:20 6,035 drv_pyexpat.py
11-17-00 12:20 10,979 drv_pyexpat.pyc
11-17-00 12:20 10,120 drv_pyexpat.pyo
11-17-00 12:20 1,037 drv_sgmllib.py
11-17-00 12:20 2,352 drv_sgmllib.pyc
11-17-00 12:20 2,105 drv_sgmllib.pyo
11-17-00 12:20 2,774 drv_sgmlop.py
11-17-00 12:20 5,691 drv_sgmlop.pyc
11-17-00 12:20 5,277 drv_sgmlop.pyo
11-17-00 12:20 3,974 drv_xmldc.py
11-17-00 12:20 7,563 drv_xmldc.pyc
11-17-00 12:20 7,036 drv_xmldc.pyo
11-17-00 12:20 1,800 drv_xmllib.py
11-17-00 12:20 4,309 drv_xmllib.pyc
11-17-00 12:20 3,973 drv_xmllib.pyo
11-17-00 12:20 4,485 drv_xmlproc.py
11-17-00 12:20 9,475 drv_xmlproc.pyc
11-17-00 12:20 8,816 drv_xmlproc.pyo
11-17-00 12:20 1,884 drv_xmlproc_val.py
11-17-00 12:20 3,566 drv_xmlproc_val.pyc
11-17-00 12:20 3,395 drv_xmlproc_val.pyo
11-17-00 12:20 2,473 drv_xmltoolkit.py
11-17-00 12:20 5,817 drv_xmltoolkit.pyc
11-17-00 12:20 5,118 drv_xmltoolkit.pyo
11-17-00 12:20 3,436 pylibs.py
11-17-00 12:20 6,546 pylibs.pyc
11-17-00 12:20 6,255 pylibs.pyo
11-17-00 12:20 40 __init__.py
11-17-00 12:20 176 __init__.pyc
11-17-00 12:20 170 __init__.pyo
164,070 bytes in 39 files and 2 dirs 638,976 bytes allocated
Directory of C:\Program Files\Python\xml\sax\drivers2\*
11-17-00 12:20 .=20
11-17-00 12:20 ..
11-17-00 12:20 658 drv_pyexpat.py
11-17-00 12:20 326 drv_pyexpat.pyc
11-17-00 12:20 317 drv_pyexpat.pyo
11-17-00 12:20 12,782 drv_xmlproc.py
11-17-00 12:20 18,899 drv_xmlproc.pyc
11-17-00 12:20 18,023 drv_xmlproc.pyo
11-17-00 12:20 40 __init__.py
11-17-00 12:20 177 __init__.pyc
11-17-00 12:20 171 __init__.pyo
51,393 bytes in 9 files and 2 dirs 180,224 bytes allocated
Total for: C:\Program Files\Python\xml\sax\*
604,897 bytes in 78 files and 8 dirs 1,507,328 bytes =
allocated
Directory of C:\Program Files\Python\xml\utils\*
11-17-00 12:20 .=20
11-17-00 12:20 ..
11-17-00 12:20 5,893 iso8601.py
11-17-00 12:20 6,952 iso8601.pyc
11-17-00 12:20 6,535 iso8601.pyo
11-17-00 12:20 6,382 qp_xml.py
11-17-00 12:20 8,246 qp_xml.pyc
11-17-00 12:20 7,703 qp_xml.pyo
11-17-00 12:20 27 __init__.py
11-17-00 12:20 144 __init__.pyc
11-17-00 12:20 138 __init__.pyo
42,020 bytes in 9 files and 2 dirs 147,456 bytes allocated
Total for: C:\Program Files\Python\xml\*
2,917,393 bytes in 435 files and 35 dirs 8,011,776 bytes =
allocated
1,820,901,376 bytes free
------=_NextPart_000_0088_01C05093.E6D97740--
From tpassin@home.com Fri Nov 17 17:48:31 2000
From: tpassin@home.com (Thomas B. Passin)
Date: Fri, 17 Nov 2000 12:48:31 -0500
Subject: Status of pyXML for python 1.5.2 (was Re: [XML-SIG] 4DOM Test Suite not in PYXML.)
References: <200011161932.UAA00778@loewis.home.cs.tu-berlin.de> <004801c05020$37494c60$7cac1218@reston1.va.home.com> <200011171015.LAA00833@loewis.home.cs.tu-berlin.de>
Message-ID: <008f01c050be$99727f80$7cac1218@reston1.va.home.com>
One other question about the pyXML package with regards to
1.5.2 compatibility.
The pyXML package, vintage 5.5.1, I think, used to have its
own version of the xmllib parser. I have code that uses it.
This version knows to use sgmlop for speed.
This parser isn't in the pyXML 6.1 package. I copied my
version from 5.5.1 to the python\xml directory so the
modules importing it could find it.
I've lost track of whether it's supposed to be in the pyXML
package or not. SInce we're now talking about maintaining a
python 1.5.2-compatible version for some time, I suggest
that this parser be put back into the package, for the
benefit of people like me whose code uses it.
What do you think?
Cheers,
Tom Passin
From tpassin@home.com Fri Nov 17 17:58:42 2000
From: tpassin@home.com (Thomas B. Passin)
Date: Fri, 17 Nov 2000 12:58:42 -0500
Subject: [4suite] Re: [XML-SIG] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
References: <3A155C6D.7D9F1F89@fourthought.com>
Message-ID: <00ad01c050c0$05dbaec0$7cac1218@reston1.va.home.com>
Uche Ogbuji asked -
"To be fair to those such as Andrew and Martin who clearly
want to move
on, is there someone who still relies on Python 1.5.2 that
could
volunteer to maintain a 1.5.2-friendly version of PyXML?"
I don't have the developer's level of code understanding nor
the resources to do this alone, but I'll volunteer to
partner with someone else. Anyone want to collaborate with
me on maintaining a version for python 1.5.2? Say for six
months or so to see how it goes?
I run Windows 95/98, I don't have any compilers running, and
I have access to a Linux box (Red Hat 6.1, needs upgrading
from python 1.5 to 1.5.2).
Cheers,
Tom Passin
From akuchlin@mems-exchange.org Fri Nov 17 18:02:20 2000
From: akuchlin@mems-exchange.org (Andrew Kuchling)
Date: Fri, 17 Nov 2000 13:02:20 -0500
Subject: [XML-SIG] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To: <00ad01c050c0$05dbaec0$7cac1218@reston1.va.home.com>; from tpassin@home.com on Fri, Nov 17, 2000 at 12:58:42PM -0500
References: <3A155C6D.7D9F1F89@fourthought.com> <00ad01c050c0$05dbaec0$7cac1218@reston1.va.home.com>
Message-ID: <20001117130220.B7763@kronos.cnri.reston.va.us>
On Fri, Nov 17, 2000 at 12:58:42PM -0500, Thomas B. Passin wrote:
>partner with someone else. Anyone want to collaborate with
>me on maintaining a version for python 1.5.2? Say for six
Write access to the CVS tree will be readily granted to anyone who
wants to work on this; just let me know what your SourceForge ID is.
--amk
From martin@loewis.home.cs.tu-berlin.de Fri Nov 17 20:10:57 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Fri, 17 Nov 2000 21:10:57 +0100
Subject: [XML-SIG] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To: (message
from Alexandre Fayolle on Fri, 17 Nov 2000 14:44:26 +0100 (CET))
References:
Message-ID: <200011172010.VAA00996@loewis.home.cs.tu-berlin.de>
> I finally wept out site-packages/Ft and site-packages/xml,
> reinstalled pyxml0.5.5.1 and 4Suite0.9.2. Things seem to have gone
> back to normal.
I assume the xml.unicode problem was then something that actually
occured in your application? Any other problems?
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Fri Nov 17 20:09:14 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Fri, 17 Nov 2000 21:09:14 +0100
Subject: [XML-SIG] Question re: 4DOM dom.ext.Printer
In-Reply-To: <3A147716.19F3AC04@fourthought.com> (message from Uche Ogbuji on
Thu, 16 Nov 2000 17:08:54 -0700)
References: <200011131647.JAA28293@localhost.localdomain> <200011131956.UAA00936@loewis.home.cs.tu-berlin.de> <3A147716.19F3AC04@fourthought.com>
Message-ID: <200011172009.VAA00991@loewis.home.cs.tu-berlin.de>
> Now that we've gor the 4Suite release out, I'd like to talk furthr
> about this. If you could set up a "4Suite" category on the PyXML
> bug-tracker, that would be great.
Done. I created a number of PyXML bug categories in the process.
> What would you need from us?
Currently, bug reports are automatically sent to xml-sig@python.org,
on initial submission only. I don't know how this is normally handled,
but if traffic increases (or if you want email sent on every update),
it may be better to have a separate list. Any opinions?
Anyway, all you need to do is to advertise
https://sourceforge.net/bugs/?func=addbug&group_id=6473 as bug
reporting address (or the "Bugs" link on
http://sourceforge.net/projects/pyxml), and to assign all 4Suite bugs
to yourself(*).
I think we need to advertise the bug reporting procedure as part of
the PyXML releases as well.
Regards,
Martin
(*) GNATS has an auto-assign feature, where each report is
automatically assigned to some developer based on the bug category;
perhaps we should propose such a feature to SF.
From martin@loewis.home.cs.tu-berlin.de Fri Nov 17 20:14:11 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Fri, 17 Nov 2000 21:14:11 +0100
Subject: [4suite] Re: [XML-SIG] Python 1.5 support with PyXML
0.6.2/4Suite0.9.2
In-Reply-To: <3A155110.74C2B527@fourthought.com> (message from Uche Ogbuji on
Fri, 17 Nov 2000 08:38:56 -0700)
References: <3A155110.74C2B527@fourthought.com>
Message-ID: <200011172014.VAA01042@loewis.home.cs.tu-berlin.de>
> Yes. I too am trying to clarify the sitruation with the unicode
> package. Martin von Loewis actually helped with the code you quote, so
> I'm surprised that he is surprised that we should be expecting the
> xml.unicode package to still be in PyXML.
When I suggested such an approach, I had 2.0+0.6.0 and 1.5.2+0.5.x as
supported scenarios in mind. However, I'd be interested to remove any
remaining reason to use 0.5.x - basically since I cannot offer support
for that, and apparently nobody else does.
Regards,
Martin
From fdrake@acm.org Fri Nov 17 20:18:04 2000
From: fdrake@acm.org (Fred L. Drake, Jr.)
Date: Fri, 17 Nov 2000 15:18:04 -0500 (EST)
Subject: [XML-SIG] Question re: 4DOM dom.ext.Printer
In-Reply-To: <200011172009.VAA00991@loewis.home.cs.tu-berlin.de>
References: <200011131647.JAA28293@localhost.localdomain>
<200011131956.UAA00936@loewis.home.cs.tu-berlin.de>
<3A147716.19F3AC04@fourthought.com>
<200011172009.VAA00991@loewis.home.cs.tu-berlin.de>
Message-ID: <14869.37500.203466.917774@cj42289-a.reston1.va.home.com>
Martin v. Loewis writes:
> (*) GNATS has an auto-assign feature, where each report is
> automatically assigned to some developer based on the bug category;
> perhaps we should propose such a feature to SF.
This would definately be useful for the main Python bug & patch
managers, where the Documentation category should be auto-assigned to
me. I'll make a request.
-Fred
--
Fred L. Drake, Jr.
PythonLabs at Digital Creations
From dieter@handshake.de Fri Nov 17 19:28:43 2000
From: dieter@handshake.de (Dieter Maurer)
Date: Fri, 17 Nov 2000 20:28:43 +0100 (CET)
Subject: [XML-SIG] Re: [4suite] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To: <3A1551F6.1A9CD90D@fourthought.com>
References:
<3A1551F6.1A9CD90D@fourthought.com>
Message-ID: <14869.34539.46684.292560@lindm.dm>
Uche Ogbuji writes:
> Well, we at Fourthought have moved on to Python 1.5.2, but as we all
> heard from the responses to my question yesterday, some have reasons to
> stick to Python 1.5.2 for now.
>
> So I guess the big question is: for those sticking with Python 1.5.2, is
> the old ISO conversion facility from xml.unicode still needed?
I will need continued Latin-1 support.
But I can install and maintain it on my own.
Dieter
From martin@loewis.home.cs.tu-berlin.de Fri Nov 17 22:06:23 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Fri, 17 Nov 2000 23:06:23 +0100
Subject: [XML-SIG] Re: [4suite] Python 1.5 support with PyXML
0.6.2/4Suite0.9.2
In-Reply-To: (message
from Alexandre Fayolle on Fri, 17 Nov 2000 16:49:48 +0100 (CET))
References:
Message-ID: <200011172206.XAA01349@loewis.home.cs.tu-berlin.de>
--Multipart_Fri_Nov_17_23:06:23_2000-1
Content-Type: text/plain; charset=US-ASCII
> > So I guess the big question is: for those sticking with Python 1.5.2, is
> > the old ISO conversion facility from xml.unicode still needed?
>
> As far as I'm concerned, yes, definitely.
Can you please try the attached implementation with PyXML 0.6.2? Just
unpack the tar file on top of the PyXML installation. It is intended
for use with Python 1.5 only.
Regards,
Martin
P.S. This code has seen *very* little testing, let me know of any
problems you have with it.
--Multipart_Fri_Nov_17_23:06:23_2000-1
Content-Type: application/octet-stream; type=tar+gzip
Content-Disposition: attachment; filename="unicode.tgz"
Content-Transfer-Encoding: base64
H4sIAKGqFToAA+1ba3PbNhbNZ/0KjDLZSlvbBQG+4Dxmsm22k9mm7TTp7s54NR5ZomNOZEpDUrG9
3f73xTkgKVGi3Db1pnVX+IDIFA5wgXPuxb3U5Ppy9tkySyfzafLZ6WmapeXp6dHi5sFdNk/K0PfF
AyFEFLb/ZVM6tE+UDLQKlBcI4Wml9AMh79SKHW1ZlONciAeX47xMs4+x4u+q9fv9NxdpIRbjybvx
20Qk12lRFuJ8novJ/HIxLtOzdJaWN+IqLS/Etzf/fPWVkEfB0fWReFkWvfNlNinTeTbmGDtPsVwk
+SSZJlNxdiPKi8Riyot5JtSRFN87oYnyZpE8Fmkpiov5cjbtnSViWVjEPJvdAOZ/8c2rI2tZ77c+
nT9+u17z/7SYx3Fg7tr9f8r/tef5jf/LSFn/V6He+/9HabX/X86ny1kixtNpIcbizEaDq3E+LQ7b
QaCc06Xns2mSi6uizNPsbQU96r0sEQDSrEwyuD9CiPVq+vPrZVomdO/HYjoX2bzkVzYCpJm4mS9z
Mb/KBERIt++ll4t5bsMDF6j/Wpbn8anVaK93WubjrBBPqwFHl+N3CR8N+qeHx/2DvlVVf9ibJufi
NJvnlzY6/TsZYPoiKYfHPaiu+ms1yWx+leTNoO4xXGQ2LpvJDoSzxY3Pk3KZZzWs15vMxkUhTv/h
0Pac3NL9F5dLO4k9H5yRPcyNo+xzFK2vbuRBkczOK8PR8OeR3dW4SIqnP/zYawBpZuU8m53yO6IO
RJZcZePL5AAr4cOOeU7WjqqCDEd262uP6wlW653n88tTEFOthY9r81cH8v2bv8avucMBB/R69Yaf
rp/OYFgf2QrQdWKQYD0BrpId57VlDXeLZ3ZZ/LPaRpKBswrV1klbBx1yakal56uBT0XfriDi/mqS
tfNoDOnAnhzHI+Kt0gXC8cYUW5q0x5IOqs/FwrppY9mJGg1b2DRbLIncWh9tvizd1/1+6/nVRWoj
A7FtU9DARwovtl7wNhnMkmzAkcPh9thqo/N86sacpKPhM0/F3SPRzvJk/G7rWztHiiOS3cDJxTg/
aPZaRw3u97Scn5Lpxn2dsZ3zNOdRffiUM28NTWZF0m3I9gRu28fpqPtsKpOrwzkedWnHzdV8U+Y3
7cXJbaXnq1oilYdXu15TRXI9SRal+Fty8yLP5/mGWsepDdLNAX4+z94necmBg/4ye5chaHMpu4iN
t7/1XbZvv7yt538N0x+1/lNhiJrP5X9+qCXrvyjY538fo23kf4t8/j61QQI38GFsLxu4fGELPOR1
c/Hy9TeHuJMOWf7ZdK+3wLHZjONGvE2yJLepUVP4sdRLrpPJEg+vLpJsbQxKRXuLlfOedyTe2NGV
AUWSv09uqT9ZS3q2AFVVOuke9RQSyryoKkpml7ChrjjPxxNMkyYFU6RkPLUbyPDY3gEYWI7PZknR
Wxl4MX6fIN+1tenq4boRyqWqD8WX7mtrMQ7jsbBzpu/tcJyD3WOJNKWeAjN6uC5LHHphM9+JO6ij
Zml7AcieveLqv11MrnJgDJ0ULnGxnsqAbgEn7qrYuIy9AyXXruGtqwK5nHCZhmP10bQvHol0K9+Y
FDY7nr9bLgYu/WtdWpUVR+PFwib+GyOq++UrojuumE301/OsTi8X9uoqRR9f49q2QerpCb4+6Dd7
JbV2u/Usx5v5FGQGTHvRaua1yVabzSxdy6TXHvrJyScHzSMubBOBtXNW8YEKwmHnKo+mBzhUJD1V
nB1MLmydYWcYHuDP4fBgY7n+qDKr/rNf58WtK/jv49ky4cdq5YUdAkG+sofJ3BiadnVY5QbsFnM7
awElNsRfr39zZKewCYGtA/Okud5Ftrw8s0Xf4HpIh8lWLk5Uzy5RZ1eOp9GfleyxBmsoRJ1QT2jz
7Mps60a7RuCQxOGzuhDE6OoIxIS1x8o+ux2gH6/VHDaAVQlQv0ppJ0jGLBMTp1Co5EkrAa0rODC0
GrOS4Em93mhbWi5duj1LWkVQ52v182FjXudiJ5NDa+aoMUg8EfI6lrLTcHk9keI/YjB59iwcDpm2
4mHsHoo/Wag+H7YrVo5IapintnButga8e1Yy3sq1V3xaNlac3zIGlDOLz5OibLE+bhML1mvokfjO
bQbCPE/zoqwqgXE2xbNqv5djWyJapJvm7Ka0waeWhz1aOy+rr/7W0dpvXODh1E5H9tmJHDVC4Vdt
QT0UL6eJDSrlzeHleCGev/785cuOme0sB/jHO25IXnOo21T30N4xCW5Xu8VcXCXu4soT3NuJmKZ5
whe0m5HxZ+j5bjSN1r2Vp+KHH9tRtQrnTVTdiKh2mt0OYp+ONkdvL3pin46qST61K7SZg+esn6wn
r9ludfF0Nju01l/a9ICa6g83J03ak1azbs/+fjyzpg0GTmHwKO98+OSJdTvrYrXcvFHjhWs6KqoX
AieqElAyqw1grDjfMMGt3Zjwc2yBKTYwMBh0GLNpp7rdTt3YWfxECK0yUevKNrGyErcFcGFTVPGX
V99WR91KbNYiWrcC7M5G9g5rQsvOErjTmPoibcx5dM3XmcVygQQNmW3Wcoh/7Xy5YdsjMbDmHKxc
xsbPh60mvnzx9Yvvnr958YX49vl3b8TDXa23nSj1TgRSE9sZ22mJzkOn0Gl0ProAXYguQgeEBsIH
wgfCB8IHwgfCB8IHwgfCB8IHIgAiACIAIgAiACIAIgAiACIAIgAiBCIEIgQiBCIEIgQiBCIEIgQi
BCICIgIiAiICIgIiAiICIgIiAiICIgYiBiIGIgYiBiIGIgYiBiIGIgbCAGGAMEAYIAwQBggDhAHC
AGEsQkmJzkOn0Gl0ProAXYguQhejA8IDwgPCA8IDwgPCA8IDwgPCA8IDQgGhgFBAKCAUEAoIBYQC
ApwrcK7AuQLnCpwrcK7AuQLnCpwrcK7AuQLnCpwrcK7AuQLnCpwrcK7AuQLnCpwrcK7AuQLnCpwr
cK7AuQLno3sjQoUugqVaeZUINQjQfkuEGpNqrKExlXZas2toKExTcBChgqgjbFUrVYlQg0sNcyPP
q0SoYZ+GuRpWacg20pwPCxHGM2hEqGg4RKgpGjoORRjGtQhjWYswVi0RwnsUHEdDPpp6aUSoqYhG
hBrnrMOwEqHm9I0INUnmLNTLSoSBqUSoOVWoaxGGphZh7NUijHVLhHBsxeOEsjWl3IhQc1wjQg0J
aDBDEWpO34hQg+4IqrtHIgS/FOFGJFSMQysRSr8SoUL40jJej4RrImS86oiEimpqIqGGQChChUio
pVmPhBThzkioKBBaejeRMI5bkTD2uyOhpocyDt0eCSkQHuLdRMLYtCJhHHRHQh3Shcz9E2HIUIUt
cCGcs3LhJtiKhCritwyHtQgZCVfX8VokpM2MTbg+NS65jUioIqqd8cXA42UdCUkebb71OtZUXVck
jOKWCE3cREIQBRa0U+KO61gzdm6KkF1zHQfRDhE217GmLV2RMDItEdKZXCTE4rwS6CS7rmPN2Lkp
QpwkYsk9E6EncYq2D9lH7GP2GCJpuaTpkrZLGi9pvaT5kvZH7jGh3IHkFiT3ILkJyV1IbkNyH5Ib
kdyJ5FYk9yK5GcndSG5Hcj+SG5LckeSWJPckuSnJXUm3Lea6kne2ZIyXDJ2S+a5kwivpYpIpr2TO
K5n0Sma9kmmvdPti4ivpapKpr2Q+IhnyJWO+ZPSW9EnJBFgy7kumwJI5sGQSLJkFS6bBktFfMhGW
zIQlLwBJ55P0Pkn3k/Q/SQeUTIglpGtLTMneY6/YW2zsR+55wD5kH7GP2RPrcQxDg+cRC4e0vc+e
WK/JyzyPUO9+KfwDq57Ab132v6rsCbjyRt0TcGmyHXDtgIsHbnWqL+DyAdcPaEAQuW1yn7QhoBEB
rQhoRkA7AhoS0JKApgTOltidEbG0JnDmUH2Bs4fqC5gF7yqJ7OHydCm8kMILpXvOE6bwQgovpPBC
Ci+k8ELPMUMshRdSeCGFF7oL0AnPI9ZrJah/+Cop5k0YK7f5Dy/WY16wXbI1YM+APCNr2RowZ0Cc
kXW1bmStWgPODCgzYMxgZgO+DOgyMNjAXgOuDGRjIBsD2RjIxkA2BvmjwaVjcOcYXDkGlBhV56gG
lBhQYkCJASUGlBhQYkCJASUGlBhQYkCJASUGlBhQYkCJASUGlBhQYkCJASUGlBhQYkCJASUGlBhQ
YkCJASUGlBhQYhBHDOKIASEGhBgQYkCIASEGhBgQYkCIASEGhBgQYqL7p8NfFDyZwnWrkCv94uBJ
576P74xidxQ+rfZptk+7fRru03Kfpvu03afxPq33ab5vHHWOO5LHSBvQWwNG2oCRNmCkDeixASNt
QJ8NGGkDzxFPLCNtwJAQcD/3P1L+P73UjMNfJ9C11xn/k5eaMe/iD3+pufZ65H6JkKX8qkR3Na8r
5WUlQhb1rg52bzbjpoDXVWnLInxVyq9KdFejulLeq0TIot7Vre4tnKkKeHflsxa981q+CZOrWr5L
hazWd9bym6/W77CWb14orWr5LhWyWt9Zy69CIV/OWBW6X3nu1W89sVLbcTHmqa8Co3IZtqnfQHUF
RkapjsAYk8uNyMgzZWSsXkFtR0YXVvg6h6oLKHe1rkmnP3pTo0m+/3dy5Eswr3Yz+pVzKfemPag0
WamzFRkpR/7uoJ0OVB0ZI1O5o9MkX+fIRp18tb7SZNx4Z6NJ/p7g5MiXal7ttvRT56LuTXtYabJS
ZysyUo78HYO/XtCJXWSM6/dzria4P6ExCmG17XWlxOo9Nn6cCU0dHaNY1nd0FHuE4Rgj1g3rb9zx
JjPiAL7QdC+xIa4ogvW2DypBRhEWshPzS7cIIFHESViM2CeKvebzph6/uztbR/z2tjs7iniv35pV
6qj+EeiuL20dUYa3XdrWwJ8ssjXd4X7d2hupY6yb3JHxxF3bnOvDckd3vbcjpHafWrmjxta1I4NK
+30XN/flB/H1W3u9H+3/A8W+7du+7du+7du+7du+7du+7du+7du+7du+3XX7LzfLLRoAUAAA
--Multipart_Fri_Nov_17_23:06:23_2000-1
Content-Type: text/plain; charset=US-ASCII
--Multipart_Fri_Nov_17_23:06:23_2000-1--
From martin@loewis.home.cs.tu-berlin.de Fri Nov 17 22:10:34 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Fri, 17 Nov 2000 23:10:34 +0100
Subject: [XML-SIG] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To: <20001117105018.C25735@kronos.cnri.reston.va.us> (message from
Andrew Kuchling on Fri, 17 Nov 2000 10:50:18 -0500)
References: <3A155110.74C2B527@fourthought.com> <20001117105018.C25735@kronos.cnri.reston.va.us>
Message-ID: <200011172210.XAA01396@loewis.home.cs.tu-berlin.de>
> The xml.unicode package was dropped in PyXML 0.6.0 back in September,
> so this isn't really news. That was the major reason for the version
> number change; 0.5.x was the last series compatible with Python 1.5.2,
> and 0.6.x would require the Unicode type from Python 1.6/2.0.
Right. It then turned out that it is actually easy to continue to
support 1.5, as long as no charset conversion is needed. I'm now
thinking about adding even that capability back, but not as a C
extension module.
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Fri Nov 17 22:08:56 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Fri, 17 Nov 2000 23:08:56 +0100
Subject: [XML-SIG] Re: [4suite] Python 1.5 support with PyXML
0.6.2/4Suite0.9.2
In-Reply-To: <3A1551F6.1A9CD90D@fourthought.com> (message from Uche Ogbuji on
Fri, 17 Nov 2000 08:42:46 -0700)
References: <3A13FDD5.A02CB400@fourthought.com> <200011161931.UAA00777@loewis.home.cs.tu-berlin.de> <3A143B34.71110B4E@fourthought.com> <200011171008.LAA00784@loewis.home.cs.tu-berlin.de> <3A1551F6.1A9CD90D@fourthought.com>
Message-ID: <200011172208.XAA01393@loewis.home.cs.tu-berlin.de>
> Actually, it provided more than just Latin-1. It provided all the
> ISO-8859-X conversions. And we did used to receive questions about
> ISO-8859-7, for instance.
Ah, I remember. My replacement currently does ISO-8859-x for x up to
15; it does not (yet) have the full list of aliases that the old
module had, nor does it have UCS-x facilities - I really don't think
they are needed, though.
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Fri Nov 17 22:15:01 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Fri, 17 Nov 2000 23:15:01 +0100
Subject: [4suite] Re: [XML-SIG] Python 1.5 support with PyXML
0.6.2/4Suite0.9.2
In-Reply-To: (message
from Alexandre Fayolle on Fri, 17 Nov 2000 17:03:18 +0100 (CET))
References:
Message-ID: <200011172215.XAA01443@loewis.home.cs.tu-berlin.de>
> I may be completely missing the point, if so please correct me.
I think you are missing part of the point, yes. It is not that either
4Suite or PyXML stopped supporting 1.5.x.
It's rather that they only offer degraded functionality on this Python
version, in areas where such degradation is expected, e.g. Unicode
support. The question is now: how much degradation is acceptable?
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Fri Nov 17 22:11:42 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Fri, 17 Nov 2000 23:11:42 +0100
Subject: [4suite] Re: [XML-SIG] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To: <015801c050ae$b0a2e150$0d00000a@ODECKMYN2K>
(odeckmyn.list@teaser.fr)
References: <200011171030.LAA00973@loewis.home.cs.tu-berlin.de> <3A1552B7.E0DF0096@fourthought.com> <015801c050ae$b0a2e150$0d00000a@ODECKMYN2K>
Message-ID: <200011172211.XAA01398@loewis.home.cs.tu-berlin.de>
> Uche, please note that people using both your great libs and Zope HAVE TO
> keep on using Python 1.5.2 !
Sure. But do they *also* need to produce ISO-8859-x output from
PrettyPrint? If so, for what values of x?
Regards,
Martin
From fdrake@acm.org Fri Nov 17 22:17:52 2000
From: fdrake@acm.org (Fred L. Drake, Jr.)
Date: Fri, 17 Nov 2000 17:17:52 -0500 (EST)
Subject: [XML-SIG] Question re: 4DOM dom.ext.Printer
In-Reply-To: <14869.37500.203466.917774@cj42289-a.reston1.va.home.com>
References: <200011131647.JAA28293@localhost.localdomain>
<200011131956.UAA00936@loewis.home.cs.tu-berlin.de>
<3A147716.19F3AC04@fourthought.com>
<200011172009.VAA00991@loewis.home.cs.tu-berlin.de>
<14869.37500.203466.917774@cj42289-a.reston1.va.home.com>
Message-ID: <14869.44688.836801.235122@cj42289-a.reston1.va.home.com>
Martin v. Loewis writes:
> (*) GNATS has an auto-assign feature, where each report is
> automatically assigned to some developer based on the bug category;
> perhaps we should propose such a feature to SF.
Fred L. Drake, Jr. responded:
> This would definately be useful for the main Python bug & patch
> managers, where the Documentation category should be auto-assigned to
> me. I'll make a request.
Ok, it turns out that this is already on the task list for the
SourceForge developers:
http://sourceforge.net/pm/task.php?func=detailtask&project_task_id=14415&group_id=1&group_project_id=2
They've bumped the priority up a little, but I don't really know
what that means in terms of turn-around time. In the past, we've had
good experiences with these guys and feature requests, so their
reaction gives me good vibes.
-Fred
--
Fred L. Drake, Jr.
PythonLabs at Digital Creations
From martin@loewis.home.cs.tu-berlin.de Fri Nov 17 22:21:58 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Fri, 17 Nov 2000 23:21:58 +0100
Subject: [4suite] Re: [XML-SIG] Python 1.5 support with PyXML
0.6.2/4Suite0.9.2
In-Reply-To: <3A155C6D.7D9F1F89@fourthought.com> (message from Uche Ogbuji on
Fri, 17 Nov 2000 09:27:25 -0700)
References: <3A155C6D.7D9F1F89@fourthought.com>
Message-ID: <200011172221.XAA01490@loewis.home.cs.tu-berlin.de>
> OK, so all together now. How hard would it be to continue updating
> PyXML 0.5.5.x with bug fixes and new features in all other areas of the
> package?
I'd rather not spent a second even thinking about it. Of course,
anybody who wants is free to do so - just create a branch in the CVS.
I'd prefer the alternative route, adding everything to 0.6.x that
stops people from migrating to that release.
> To be fair to those such as Andrew and Martin who clearly want to move
> on, is there someone who still relies on Python 1.5.2 that could
> volunteer to maintain a 1.5.2-friendly version of PyXML?
If a volunteer steps forward, it'd be fine with me to continue 0.5.x.
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Fri Nov 17 22:29:04 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Fri, 17 Nov 2000 23:29:04 +0100
Subject: [4suite] Re: [XML-SIG] Python 1.5 support with PyXML 0.6.2/4Suite0.9.2
In-Reply-To: <00ad01c050c0$05dbaec0$7cac1218@reston1.va.home.com>
(tpassin@home.com)
References: <3A155C6D.7D9F1F89@fourthought.com> <00ad01c050c0$05dbaec0$7cac1218@reston1.va.home.com>
Message-ID: <200011172229.XAA01535@loewis.home.cs.tu-berlin.de>
> I don't have the developer's level of code understanding nor
> the resources to do this alone, but I'll volunteer to
> partner with someone else. Anyone want to collaborate with
> me on maintaining a version for python 1.5.2?
I'd like to point out that PyXML 0.6.2 also supports Python 1.5 -
it just doesn't have the same set of libraries as 0.5.x did.
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Fri Nov 17 22:27:24 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Fri, 17 Nov 2000 23:27:24 +0100
Subject: Status of pyXML for python 1.5.2 (was Re: [XML-SIG] 4DOM Test Suite not in PYXML.)
In-Reply-To: <008f01c050be$99727f80$7cac1218@reston1.va.home.com>
(tpassin@home.com)
References: <200011161932.UAA00778@loewis.home.cs.tu-berlin.de> <004801c05020$37494c60$7cac1218@reston1.va.home.com> <200011171015.LAA00833@loewis.home.cs.tu-berlin.de> <008f01c050be$99727f80$7cac1218@reston1.va.home.com>
Message-ID: <200011172227.XAA01520@loewis.home.cs.tu-berlin.de>
> I've lost track of whether it's supposed to be in the pyXML
> package or not. SInce we're now talking about maintaining a
> python 1.5.2-compatible version for some time, I suggest
> that this parser be put back into the package, for the
> benefit of people like me whose code uses it.
>
> What do you think?
Is that version of xmllib still maintained? I don't see the Python
1.5.2 compatibility issue here - Python 1.5.2 does have xmllib, just
as Python 2.0 does.
I'd rather not add unmaintained software back into the
distribution. Is there a problem to directly use sgmlop? Or,
alternatively, to incorporate the version of xmllib into your
application (preferably under a different name)?
Regards,
Martin
From noreply@sourceforge.net Sat Nov 18 00:44:54 2000
From: noreply@sourceforge.net (noreply@sourceforge.net)
Date: Fri, 17 Nov 2000 16:44:54 -0800
Subject: [XML-SIG] [Patch #102428] xml/parsers/sgmllib.py chokes on CR/LF
Message-ID: <200011180044.QAA30197@sf-web3.vaspecialprojects.com>
Patch #102428 has been updated.
Project: pyxml
Category: None
Status: Open
Summary: xml/parsers/sgmllib.py chokes on CR/LF
-------------------------------------------------------
For more info, visit:
http://sourceforge.net/patch/?func=detailpatch&patch_id=102428&group_id=6473
From martin@loewis.home.cs.tu-berlin.de Sun Nov 19 10:20:03 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Sun, 19 Nov 2000 11:20:03 +0100
Subject: [XML-SIG] w3schools
In-Reply-To: <3A125A6C.7693748@marconi.com> (message from Wolfgang Grafen on
Wed, 15 Nov 2000 10:42:04 +0100)
References: <3A125A6C.7693748@marconi.com>
Message-ID: <200011191020.LAA00867@loewis.home.cs.tu-berlin.de>
> I think this link should be mentioned in the
> Python/XML Documentation link archive at:
Done.
Martin
From noreply@sourceforge.net Sun Nov 19 15:33:20 2000
From: noreply@sourceforge.net (noreply@sourceforge.net)
Date: Sun, 19 Nov 2000 07:33:20 -0800
Subject: [XML-SIG] [Bug #122912] unparsed-entity-uri not implemented
Message-ID: <200011191533.HAA25250@sf-web3.vaspecialprojects.com>
Bug #122912, was updated on 2000-Nov-19 07:33
Here is a current snapshot of the bug.
Project: Python/XML
Category: 4Suite
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Summary: unparsed-entity-uri not implemented
Details: Looks as if implementing the XSLT function unparsed-entity-uri was overlooked.
For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=122912&group_id=6473
From uche.ogbuji@fourthought.com Sun Nov 19 15:39:07 2000
From: uche.ogbuji@fourthought.com (Uche Ogbuji)
Date: Sun, 19 Nov 2000 08:39:07 -0700
Subject: [XML-SIG] Bug-tracking for 4Suite
Message-ID: <3A17F41B.25432FAD@fourthought.com>
This should help everyone who sends bug reports that get lost in 4Suite
developers' enormous in-boxes.
Martin von Loewis has kindly set up for us an area on PyXML's
Sourceforge account for bug-tracking. To submit aa bug, go here:
https://sourceforge.net/bugs/?func=addbug&group_id=6473
And be sure to select the category "4Suite". You can track 4Suite bugs
here
https://sourceforge.net/bugs/?func=browse&group_id=6473&set=open
This morning I added posted a report: something I discovered this week.
I'll keep going through and assigning bugs for FIXME comments in the
code for which tracking makes sense.
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From uche.ogbuji@fourthought.com Sun Nov 19 15:46:36 2000
From: uche.ogbuji@fourthought.com (Uche Ogbuji)
Date: Sun, 19 Nov 2000 08:46:36 -0700
Subject: [XML-SIG] Question re: 4DOM dom.ext.Printer
References: <200011131647.JAA28293@localhost.localdomain> <200011131956.UAA00936@loewis.home.cs.tu-berlin.de> <3A147716.19F3AC04@fourthought.com> <200011172009.VAA00991@loewis.home.cs.tu-berlin.de>
Message-ID: <3A17F5DC.88B0C65F@fourthought.com>
"Martin v. Loewis" wrote:
> Done. I created a number of PyXML bug categories in the process.
>
> > What would you need from us?
>
> Currently, bug reports are automatically sent to xml-sig@python.org,
> on initial submission only. I don't know how this is normally handled,
> but if traffic increases (or if you want email sent on every update),
> it may be better to have a separate list. Any opinions?
I can easily set up 4Suite-admin@lists.fourthought.com for the purpose
(all these auto-notifications).
> Anyway, all you need to do is to advertise
> https://sourceforge.net/bugs/?func=addbug&group_id=6473 as bug
> reporting address (or the "Bugs" link on
> http://sourceforge.net/projects/pyxml), and to assign all 4Suite bugs
> to yourself(*).
Will do. The auto-assign feature would be nice if SF comes through.
My next questions is about patches. I actually didn't know I had admin
privileges in PyXML/SF. I could have added the bug category. So now
I'd like to add a 4Suite patch category, if no-one objects. I ask
because of their ominous warning: "Once you add a patch category, it
cannot be deleted ", and also, I noted that there are no othr patch
categories. Should I add the same ones as in the PyXML bug area? (sax,
expat, xmlproc)
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From fdrake@acm.org Sun Nov 19 16:13:07 2000
From: fdrake@acm.org (Fred L. Drake, Jr.)
Date: Sun, 19 Nov 2000 11:13:07 -0500 (EST)
Subject: [XML-SIG] Question re: 4DOM dom.ext.Printer
In-Reply-To: <3A17F5DC.88B0C65F@fourthought.com>
References: <200011131647.JAA28293@localhost.localdomain>
<200011131956.UAA00936@loewis.home.cs.tu-berlin.de>
<3A147716.19F3AC04@fourthought.com>
<200011172009.VAA00991@loewis.home.cs.tu-berlin.de>
<3A17F5DC.88B0C65F@fourthought.com>
Message-ID: <14871.64531.999526.991619@cj42289-a.reston1.va.home.com>
Uche Ogbuji writes:
> categories. Should I add the same ones as in the PyXML bug area? (sax,
> expat, xmlproc)
I think this would be good. I just added the "Documentation"
category for bugs & patches. Our experiance with Python is that
patches often correlate to specific bugs, so having the same
categories makes a lot of sense.
-Fred
--
Fred L. Drake, Jr.
PythonLabs at Digital Creations
From liam_herron@hotmail.com Mon Nov 20 02:48:24 2000
From: liam_herron@hotmail.com (test e mail)
Date: Sun, 19 Nov 2000 21:48:24 -0500
Subject: [XML-SIG] XML to Object translation
Message-ID: <3A1890F8.ADCEEE17@hotmail.com>
What is the best way to map XML to objects? I am designing a program
that needs to
transfer objects via XML. What is the best approach for this? Is
there an existing
framework for this?
Liam
From tpassin@home.com Mon Nov 20 04:40:08 2000
From: tpassin@home.com (Thomas B. Passin)
Date: Sun, 19 Nov 2000 23:40:08 -0500
Subject: [XML-SIG] Proposal: PEP-like Approach for pyXML
References: <200011131647.JAA28293@localhost.localdomain><200011131956.UAA00936@loewis.home.cs.tu-berlin.de><3A147716.19F3AC04@fourthought.com><200011172009.VAA00991@loewis.home.cs.tu-berlin.de><3A17F5DC.88B0C65F@fourthought.com> <14871.64531.999526.991619@cj42289-a.reston1.va.home.com>
Message-ID: <005201c052ab$f6994920$7cac1218@reston1.va.home.com>
I've noticed several times lately that people have not been
able to remember or find the state of agreements on
code/API/packaging and so forth. This certainly applies t0
me. It's easy for bugs and documentation errors to creep in
this way, and it causes everyone to spend more time than
they would like trying to track down and unify all the
various postings on a subject.
The Python main development process now uses PEPs, similar,
they say, to RFCs. I'd like to suggest that pyXML start
using some less formal version. Perhaps XRFCs (XML RFC)? I
say less formal because there are fewer people working on
pyXM than on Python itself, and so it's probably more of a
burden to have an individual take on the entire role of
sheparding and advocating an XRFC, as the PEP process is
said to work.
If there were a place in SourceForge, maybe a branch of the
CVS tree, XRFCs could be placed there. From time to time
they could be updated, and they would always be available as
a record of the discussions and results.
Once an issue were closed out, that XRFC would be frozen,
just as RFCs are. The PEP distinction of action vs
informational PEPs might work out very well.
We could try out the process by making the first XRFC cover
the topic of XRFC procedures. Some issues are who keeps an
XRFC up-to-date, what should be included, and who votes on
them.
PEPs are supposed to be written in some kind of structured
text, which is programatically converted to HTML. Should we
take this as a challenge to do the same in XML for XRFCs?
Comments, anyone? Suggestions? Names instead of XRFC? Too
much work?
Regards,
Tom Passin
From fdrake@acm.org Mon Nov 20 06:10:31 2000
From: fdrake@acm.org (Fred L. Drake, Jr.)
Date: Mon, 20 Nov 2000 01:10:31 -0500 (EST)
Subject: [XML-SIG] Proposal: PEP-like Approach for pyXML
In-Reply-To: <005201c052ab$f6994920$7cac1218@reston1.va.home.com>
References: <200011131647.JAA28293@localhost.localdomain>
<200011131956.UAA00936@loewis.home.cs.tu-berlin.de>
<3A147716.19F3AC04@fourthought.com>
<200011172009.VAA00991@loewis.home.cs.tu-berlin.de>
<3A17F5DC.88B0C65F@fourthought.com>
<14871.64531.999526.991619@cj42289-a.reston1.va.home.com>
<005201c052ab$f6994920$7cac1218@reston1.va.home.com>
Message-ID: <14872.49239.643000.744864@cj42289-a.reston1.va.home.com>
Thomas B. Passin writes:
> they say, to RFCs. I'd like to suggest that pyXML start
> using some less formal version. Perhaps XRFCs (XML RFC)? I
...
> Once an issue were closed out, that XRFC would be frozen,
> just as RFCs are. The PEP distinction of action vs
> informational PEPs might work out very well.
I think this is a good idea. I'd propose that a separate "product"
(to use SourceForge terminology) be created parallel to the "xml"
directory in CVS.
> We could try out the process by making the first XRFC cover
> the topic of XRFC procedures. Some issues are who keeps an
> XRFC up-to-date, what should be included, and who votes on
> them.
Sounds good.
> PEPs are supposed to be written in some kind of structured
> text, which is programatically converted to HTML. Should we
> take this as a challenge to do the same in XML for XRFCs?
These should definately be XML documents. There's already a DTD for
IETF RFCs, and tools to perform the conversions to HTML and text;
perhaps we could use that DTD and XSLT to perform the conversions (the
existing tools are probably not in Python ;).
-Fred
--
Fred L. Drake, Jr.
PythonLabs at Digital Creations
From Alexandre.Fayolle@logilab.fr Mon Nov 20 09:37:18 2000
From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle)
Date: Mon, 20 Nov 2000 10:37:18 +0100 (CET)
Subject: [XML-SIG] XML to Object translation
In-Reply-To: <3A1890F8.ADCEEE17@hotmail.com>
Message-ID:
On Sun, 19 Nov 2000, test e mail wrote:
^^^^^^^^^^^
May I suggest that you change the config of your mail client? My first
reaction upon seeing your message was to delete it without opening it
> What is the best way to map XML to objects? I am designing a program
> that needs to transfer objects via XML. What is the best approach for
> this? Is there an existing framework for this?
Why do you make XML a requirement for this? I mean, if you want to setup a
distributed application, CORBA seems reasonable.
If you need a human-readable xml serialisation of your objects, that's
different. Since python objects are basically dictionnaries, putting up
an XML marshaller should not be difficult. If you just need an XML
serialisation, you could use Pickle to produce a string representation of
the object, encode it using base64, and enclose it in a text node.
You may also want to look at XML RPC, and SOAP, which provide transparent
RPC mechanisms based on XML representation of data. Python implementations
can be found at http://www.pythonware.com/products.htm
If you tell us a bit more about your needs, maybe we'll be able to help
you further.
Alexandre Fayolle
--
http://www.logilab.com
Narval is the first software agent available as free software (GPL).
LOGILAB, Paris (France).
From martin@loewis.home.cs.tu-berlin.de Mon Nov 20 09:59:18 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Mon, 20 Nov 2000 10:59:18 +0100
Subject: [XML-SIG] XML to Object translation
In-Reply-To: <3A1890F8.ADCEEE17@hotmail.com> (message from test e mail on Sun,
19 Nov 2000 21:48:24 -0500)
References: <3A1890F8.ADCEEE17@hotmail.com>
Message-ID: <200011200959.KAA00645@loewis.home.cs.tu-berlin.de>
> What is the best way to map XML to objects?
That's the Document Object Model, or DOM. See the W3C pages for an
exact specifcation. PyXML offers two DOM implementations, minidom and
4DOM.
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Mon Nov 20 09:57:46 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Mon, 20 Nov 2000 10:57:46 +0100
Subject: [XML-SIG] Question re: 4DOM dom.ext.Printer
In-Reply-To: <3A17F5DC.88B0C65F@fourthought.com> (message from Uche Ogbuji on
Sun, 19 Nov 2000 08:46:36 -0700)
References: <200011131647.JAA28293@localhost.localdomain> <200011131956.UAA00936@loewis.home.cs.tu-berlin.de> <3A147716.19F3AC04@fourthought.com> <200011172009.VAA00991@loewis.home.cs.tu-berlin.de> <3A17F5DC.88B0C65F@fourthought.com>
Message-ID: <200011200957.KAA00616@loewis.home.cs.tu-berlin.de>
> I can easily set up 4Suite-admin@lists.fourthought.com for the
> purpose (all these auto-notifications).
Good. Personally, I'm happy with bug report messages being sent to
xml-sig, so I'd with that wait until somebody complains. Please note
that those messages have [Bug #xxx] in their subject - so it should be
easy to filter them.
> Should I add the same ones as in the PyXML bug area? (sax, expat,
> xmlproc)
Sounds reasonable.
Martin
From martin@loewis.home.cs.tu-berlin.de Mon Nov 20 10:04:50 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Mon, 20 Nov 2000 11:04:50 +0100
Subject: [XML-SIG] Proposal: PEP-like Approach for pyXML
In-Reply-To: <005201c052ab$f6994920$7cac1218@reston1.va.home.com>
(tpassin@home.com)
References: <200011131647.JAA28293@localhost.localdomain><200011131956.UAA00936@loewis.home.cs.tu-berlin.de><3A147716.19F3AC04@fourthought.com><200011172009.VAA00991@loewis.home.cs.tu-berlin.de><3A17F5DC.88B0C65F@fourthought.com> <14871.64531.999526.991619@cj42289-a.reston1.va.home.com> <005201c052ab$f6994920$7cac1218@reston1.va.home.com>
Message-ID: <200011201004.LAA00693@loewis.home.cs.tu-berlin.de>
> I've noticed several times lately that people have not been able to
> remember or find the state of agreements on code/API/packaging and
> so forth.
PyXML currently does not have any comprehensive API
documentation. Contributions are definitely welcome, ideally following
the Python library documentation. Starting point would be modules that
are only in PyXML but not in Python 2; later we'd also need to
document extensions to Python 2 modules.
> Comments, anyone?
I'm not exactly sure where you are heading here, but if you think this
is a good thing, just go ahead in implement it. You can either create
a new CVS module (by doing "cvs import"), or modify the www module
(probably creating a new directory next to /topics).
Of course, by doing so, you also volunteer to maintain it :-)
Regards,
Martin
From Nicolas.Chauvat@logilab.fr Mon Nov 20 12:13:54 2000
From: Nicolas.Chauvat@logilab.fr (Nicolas Chauvat)
Date: Mon, 20 Nov 2000 13:13:54 +0100 (CET)
Subject: [XML-SIG] Proposal: PEP-like Approach for pyXML
In-Reply-To: <005201c052ab$f6994920$7cac1218@reston1.va.home.com>
Message-ID:
On Sun, 19 Nov 2000, Thomas B. Passin wrote:
> Comments, anyone? Suggestions? Names instead of XRFC? Too
> much work?
I think it's a good idea. I do think it is more work to do, but no group
ever got away writing code collaboratively without maintaining good
documentation (well, not without increasing time and decreasing quality,
that is...).
I think XML is the mandatory format. DocBook/article may do, but=20
http://www.memory.palace.org/authoring/writing-rfcs.html may be more
suited.
I suggest we put a page on the PyXML website with a table for the list of
XRFCs: Name of the RFC. one-liner subect. Dates (creation/update). Status
(to be written, in discussion, closed). Maintainer. on-line html version.
link to ftp site where ps/pdf/text versions are available.
Maintainers will have write access to that part of the repository. On
check-ins, a script will produce the ps/pdf/text versions out of the
updated RFCs and post an announce on the PyXML list. Discussions about the
RFCs would take place on the PyXML list. On each RFC webpage, the
maintainer could add links to the e-mails in the archive discussing the
subject, so that one could easily browse thru previous posts and avoid
repetitions.
I think this would make it much easier to use, develop and contribute
to the PyXML package. Did I forget something?
--=20
Nicolas Chauvat
http://www.logilab.com - "Mais o=F9 est donc Ornicar ?" - LOGILAB, Paris (F=
rance)
PS: I can't help but mention that Narval (www.logilab.org/narval) will
soon help to automate/improve several tasks in the above list.
From fdrake@acm.org Mon Nov 20 14:11:13 2000
From: fdrake@acm.org (Fred L. Drake, Jr.)
Date: Mon, 20 Nov 2000 09:11:13 -0500 (EST)
Subject: [XML-SIG] Proposal: PEP-like Approach for pyXML
In-Reply-To: <200011201004.LAA00693@loewis.home.cs.tu-berlin.de>
References: <200011131647.JAA28293@localhost.localdomain>
<200011131956.UAA00936@loewis.home.cs.tu-berlin.de>
<3A147716.19F3AC04@fourthought.com>
<200011172009.VAA00991@loewis.home.cs.tu-berlin.de>
<3A17F5DC.88B0C65F@fourthought.com>
<14871.64531.999526.991619@cj42289-a.reston1.va.home.com>
<005201c052ab$f6994920$7cac1218@reston1.va.home.com>
<200011201004.LAA00693@loewis.home.cs.tu-berlin.de>
Message-ID: <14873.12545.994792.866675@cj42289-a.reston1.va.home.com>
Martin v. Loewis writes:
> PyXML currently does not have any comprehensive API
> documentation. Contributions are definitely welcome, ideally following
> the Python library documentation. Starting point would be modules that
> are only in PyXML but not in Python 2; later we'd also need to
> document extensions to Python 2 modules.
For the record, I'll be working on the DOM documentation in the
Library Reference today. Not next week, not later this week,
*today*. ;) If anyone has any specific suggestions or text to send
along, this is a great time to do it!
-Fred
--
Fred L. Drake, Jr.
PythonLabs at Digital Creations
From akuchlin@mems-exchange.org Mon Nov 20 15:08:44 2000
From: akuchlin@mems-exchange.org (Andrew Kuchling)
Date: Mon, 20 Nov 2000 10:08:44 -0500
Subject: [XML-SIG] Proposal: PEP-like Approach for pyXML
In-Reply-To: <005201c052ab$f6994920$7cac1218@reston1.va.home.com>; from tpassin@home.com on Sun, Nov 19, 2000 at 11:40:08PM -0500
References: <200011131647.JAA28293@localhost.localdomain><200011131956.UAA00936@loewis.home.cs.tu-berlin.de><3A147716.19F3AC04@fourthought.com><200011172009.VAA00991@loewis.home.cs.tu-berlin.de><3A17F5DC.88B0C65F@fourthought.com> <14871.64531.999526.991619@cj42289-a.reston1.va.home.com> <005201c052ab$f6994920$7cac1218@reston1.va.home.com>
Message-ID: <20001120100844.B19479@kronos.cnri.reston.va.us>
On Sun, Nov 19, 2000 at 11:40:08PM -0500, Thomas B. Passin wrote:
>PEPs are supposed to be written in some kind of structured
>text, which is programatically converted to HTML. Should we
>take this as a challenge to do the same in XML for XRFCs?
Why not just reuse the plaintext PEP format? Two advantages are that
we don't need to write any new software to convert them to HTML, and
the source document are easier to write, since you won't have to
escape < and >, which are quite likely to occur in documents about
XML.
I'd suggest adding them to the Web tree as Martin suggested.
--amk
From Nicolas.Chauvat@logilab.fr Mon Nov 20 15:08:13 2000
From: Nicolas.Chauvat@logilab.fr (Nicolas Chauvat)
Date: Mon, 20 Nov 2000 16:08:13 +0100 (CET)
Subject: [XML-SIG] Proposal: PEP-like Approach for pyXML
In-Reply-To: <20001120100844.B19479@kronos.cnri.reston.va.us>
Message-ID:
On Mon, 20 Nov 2000, Andrew Kuchling wrote:
> On Sun, Nov 19, 2000 at 11:40:08PM -0500, Thomas B. Passin wrote:
> >PEPs are supposed to be written in some kind of structured
> >text, which is programatically converted to HTML. Should we
> >take this as a challenge to do the same in XML for XRFCs?
>=20
> Why not just reuse the plaintext PEP format? Two advantages are that
> we don't need to write any new software to convert them to HTML, and
No need to write software. XSL are perfectly good for that.
> the source document are easier to write, since you won't have to
> escape < and >, which are quite likely to occur in documents about
> XML.
If you want to quote a lot of XML in a XML doc, you can just use
]]>
--=20
Nicolas Chauvat
http://www.logilab.com - "Mais o=F9 est donc Ornicar ?" - LOGILAB, Paris (F=
rance)
From ke@suse.de Tue Nov 21 09:53:37 2000
From: ke@suse.de (Karl Eichwalder)
Date: 21 Nov 2000 10:53:37 +0100
Subject: [XML-SIG] RPM spec file available?
Message-ID:
I'm just in the progress to update pyxml for SuSE Linux. Binary RPMs
are offered from the official download page -- but there are not Source
RPM and thus no spec files.
I didn't find them in the CVS, too.
Is it possible to make the spec files available?
--
Linux Frechet 2.2.16 #1 Wed Sep 20 19:11:23 GMT 2000 i686 unknown
10:50am up 20 days, 15:26, 9 users, load average: 1.27, 1.11, 1.03
work : ke@suse.de
Karl Eichwalder home : keichwa@gmx.net
From mal@lemburg.com Tue Nov 21 10:11:46 2000
From: mal@lemburg.com (M.-A. Lemburg)
Date: Tue, 21 Nov 2000 11:11:46 +0100
Subject: [XML-SIG] RPM spec file available?
References:
Message-ID: <3A1A4A62.4664B5AE@lemburg.com>
Karl Eichwalder wrote:
>
> I'm just in the progress to update pyxml for SuSE Linux. Binary RPMs
> are offered from the official download page -- but there are not Source
> RPM and thus no spec files.
>
> I didn't find them in the CVS, too.
>
> Is it possible to make the spec files available?
They should be easy to generate since PyXML uses Python's new
distutils package for creating the distribution archives.
Just download the source and run "setup.py bdist_rpm" ...
you should then find the SPEC files in the build subdir.
--
Marc-Andre Lemburg
______________________________________________________________________
Company: http://www.egenix.com/
Consulting: http://www.lemburg.com/
Python Pages: http://www.lemburg.com/python/
From teg@redhat.com Tue Nov 21 14:54:14 2000
From: teg@redhat.com (Trond Eivind =?iso-8859-1?q?Glomsr=d8d?=)
Date: Tue, 21 Nov 2000 09:54:14 -0500 (EST)
Subject: [XML-SIG] RPM spec file available?
In-Reply-To:
References:
Message-ID: <20001121145414.6961F282A2@halden.devel.redhat.com>
Karl Eichwalder writes:
> I'm just in the progress to update pyxml for SuSE Linux. Binary RPMs
> are offered from the official download page -- but there are not Source
> RPM and thus no spec files.
>
> I didn't find them in the CVS, too.
>
> Is it possible to make the spec files available?
The ones for these files are generated with distutils, for a manually
created one I recommend you take a look at the ones in Rawhide
--
Trond Eivind Glomsrød
Red Hat, Inc.
From noreply@sourceforge.net Tue Nov 21 19:32:02 2000
From: noreply@sourceforge.net (noreply@sourceforge.net)
Date: Tue, 21 Nov 2000 11:32:02 -0800
Subject: [XML-SIG] [Bug #123095] [4ODS] Problems with --package option in OdlParse
Message-ID: <200011211932.LAA27164@sf-web2.i.sourceforge.net>
Bug #123095, was updated on 2000-Nov-21 11:32
Here is a current snapshot of the bug.
Project: Python/XML
Category: 4Suite
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Summary: [4ODS] Problems with --package option in OdlParse
Details: Hi;
I just started playing with 4ODS last night and it looks very nice! Thanks for the work so far on it.
I was having a bit of problem with the stubs generated via OdlParse with the --package option. With the following odl file:
module Top {
class Two;
class One {
relationship list my_twos inverse Two::my_one;
};
class Two {
relationship One my_one inverse One::my_twos;
};
};
I generated stubs using:
$ OdlParse --package=Foo -ifp test_top top.odl
If you look at the stubs generated:
$ more Top/One/__init__.py
[...]
def add_my_twos(self,target,inverse=1):
from Foo.Top import Two
self._4ods_addRelationship('my_twos',Top.Two.Two_stub,'my_one','form',target,inverse)
The import just imports the class as Two, but it is still trying to use the class as if it was imported from Top.Two This leads to import errors when you try to import these stubs to subclass them.
I traced the places where both lines are generated, but couldn't find a decent fix since I wasn't sure how to set whether or not --package was specified. Apologies.
I hope this helps and is not already known. Thanks again for all your hard work on this code.
Brad
For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=123095&group_id=6473
From uche.ogbuji@fourthought.com Tue Nov 21 20:37:19 2000
From: uche.ogbuji@fourthought.com (uche.ogbuji@fourthought.com)
Date: Tue, 21 Nov 2000 13:37:19 -0700
Subject: [XML-SIG] Sourceforge
Message-ID: <200011212037.NAA12199@localhost.localdomain>
A bug appeared not too long ago which Mike has already handled, but he can't
mark this as so because he's not listed as a developer. His sourceforge ID is
mikeolson. I was going to add him as a developer, but this looks like
somethign only an admin can do (makes sense).
But does it make sense for us to make Jeremy (jkloth), Mike (mikeolson) or me
(uche) an admin? Only one of us need be. I'd nominate Jeremy, as I always
do. (Hi, Jeremy).
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From fdrake@acm.org Tue Nov 21 20:57:17 2000
From: fdrake@acm.org (Fred L. Drake, Jr.)
Date: Tue, 21 Nov 2000 15:57:17 -0500 (EST)
Subject: [XML-SIG] Sourceforge
In-Reply-To: <200011212037.NAA12199@localhost.localdomain>
References: <200011212037.NAA12199@localhost.localdomain>
Message-ID: <14874.57773.631351.417361@cj42289-a.reston1.va.home.com>
uche.ogbuji@fourthought.com writes:
> A bug appeared not too long ago which Mike has already handled, but
> he can't mark this as so because he's not listed as a developer.
> His sourceforge ID is mikeolson. I was going to add him as a
> developer, but this looks like somethign only an admin can do
> (makes sense).
Hmm... looks like someone made him a developer by the time I got
there, but hadn't set up the permissions to let him manage bugs.
I've made that adjustment.
Yes, someone from 4Thought should probably be an admin.
-Fred
--
Fred L. Drake, Jr.
PythonLabs at Digital Creations
From keichwa@gmx.net Wed Nov 22 05:56:52 2000
From: keichwa@gmx.net (Karl Eichwalder)
Date: Wed, 22 Nov 2000 06:56:52 +0100 (CET)
Subject: [XML-SIG] setup.py / test
Message-ID: <20001122055652.E1EA5DD02D@tux.gnu.franken.de>
Not a real bug, but anyway:
setup.py claims to support the 'test' target (line 4) that isn't true.
--
work : ke@suse.de | ,__o
: http://www.suse.de/~ke/ | _-\_<,
home : keichwa@gmx.net | (*)/'(*)
From ke@suse.de Wed Nov 22 05:46:02 2000
From: ke@suse.de (Karl Eichwalder)
Date: Wed, 22 Nov 2000 06:46:02 +0100 (CET)
Subject: [XML-SIG] Re: RPM spec file available?
In-Reply-To: <3A1A4A62.4664B5AE@lemburg.com>
References: <3A1A4A62.4664B5AE@lemburg.com>
Message-ID: <20001122054602.C7A7EDD02C@tux.gnu.franken.de>
"M.-A. Lemburg" writes:
> They should be easy to generate since PyXML uses Python's new
> distutils package for creating the distribution archives.
> Just download the source and run "setup.py bdist_rpm" ...
Thanks for advise (also to Trond! and to people sending private mails)
-- that's tooooo easy!
I've a small proposal to make it even better; the automagic may consider
to install some doc material, too:
%doc ANNOUNCE CREDITS LICENCE MANIFEST MANIFEST.in README README.dom
%doc README.pyexpat README.sgmlop TODO
%doc demo
%doc doc
%doc test
Other small changes I've done are vendor specific.
> you should then find the SPEC files in the build subdir.
--
work : ke@suse.de | ,__o
: http://www.suse.de/~ke/ | _-\_<,
home : keichwa@gmx.net | (*)/'(*)
From keichwa@gmx.net Wed Nov 22 07:19:31 2000
From: keichwa@gmx.net (Karl Eichwalder)
Date: Wed, 22 Nov 2000 08:19:31 +0100 (CET)
Subject: [XML-SIG] Re: RPM spec file available?
In-Reply-To:
References: <3A1A4A62.4664B5AE@lemburg.com>
Message-ID: <20001122071931.BCAFCDD02C@tux.gnu.franken.de>
Karl Eichwalder writes:
> Other small changes I've done are vendor specific.
There's another problem. The %files list is created on the fly
("dynamically") but directories are missing form the list and thus will
never be removed if the user decides to deinstall the package.
You better may use wildcards to catch the directories, too; or list them
with the %dir marker.
--
work : ke@suse.de | ,__o
: http://www.suse.de/~ke/ | _-\_<,
home : keichwa@gmx.net | (*)/'(*)
From Joakim.Hove@phys.ntnu.no Wed Nov 22 09:50:09 2000
From: Joakim.Hove@phys.ntnu.no (Joakim Hove)
Date: 22 Nov 2000 10:50:09 +0100
Subject: [XML-SIG] Getting the line number from an XML file
Message-ID:
Hello,
I'm in the process of teaching myself some XML by writing a simple
program for handling bibliographic references. I have started with the
"qtfmt.py" example in the demo/quotes/ directory of the PyXML
distribution, and hence "drv_pyexpat.py" driver [Currently I have no
clue in how to chose in the myriad of different drivers - but that
will probably come ...].
Now, I want to get the line-number where a certain entity is defined,
so during parsing the program should write to stdout:
Found on line nnn ...
Fount on line nnn ...
The driver I'm using has the locator routines getLineNumber and
getColumnNumber, but according to comments in the code they are only
usable after an error. I would like to call these methods irrespective
of whether an error has occured. Is this possible??
Joakim
--=20
=3D=3D=3D Joakim Hove www.phys.ntnu.no/~hove/ =3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
# Institutt for fysikk (735) 93637 / E3-166 | Sk=F8yensgate 10D #
# N - 7491 Trondheim hove@phys.ntnu.no | N - 7030 Trondheim #
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 73 93=
31 68 =3D=3D=3D=3D=3D=3D=3D=3D
From noreply@sourceforge.net Wed Nov 22 16:10:04 2000
From: noreply@sourceforge.net (noreply@sourceforge.net)
Date: Wed, 22 Nov 2000 08:10:04 -0800
Subject: [XML-SIG] [Bug #123172] 4XSLT does not process xsl:text correctly 4Suite 0.9.2
Message-ID: <200011221610.IAA14327@sf-web2.i.sourceforge.net>
Bug #123172, was updated on 2000-Nov-22 08:10
Here is a current snapshot of the bug.
Project: Python/XML
Category: 4Suite
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Summary: 4XSLT does not process xsl:text correctly 4Suite 0.9.2
Details: I am using XSLT to transform data stored in XML files into viewable
HTML files.
In the attached test example, I stored in an XML file (test.xml) my
address book and I want to see a list of all my friends (i.e. people in my
address book).
To deal with this, I use an XSL Transformation (test.xslt). To have
better rendering, I insert a space between the first and the last name
with an node :
Unfortunately, 4XSLT seems to ignore completely my node as
it produces the following HTML code (you can notice that there is no
space between "Alexandre" and "FAYOLLE"):
AlexandreFAYOLLE
Did I forget something very important in my XSLT or is this a bug of 4XSLT processor ?
Olivier Cayrol
olivier.cayrol@logilab.fr
---------------8<-------------------------------
file test.xslt:
Address Book Test
My friends are:
----------------------------8<----------------------------
file test.xml
AlexandreFAYOLLENicolasCHAUVAT
--------------------------8<---------------------------
file test.html
My friends are:
* AlexandreFAYOLLE
* NicolasCHAUVAT
--------------------------8<---------------------------
For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=123172&group_id=6473
From fdrake@acm.org Wed Nov 22 19:23:30 2000
From: fdrake@acm.org (Fred L. Drake, Jr.)
Date: Wed, 22 Nov 2000 14:23:30 -0500 (EST)
Subject: [XML-SIG] DOM API conundrum
Message-ID: <14876.7474.577812.703813@cj42289-a.reston1.va.home.com>
For a long time, many of us have felt bound to the _get_/_set_
accessors for attributes defined in the DOM specification because the
Python CORBA mapping required that. (I have certainly been a big
proponent of supporting the CORBA mapping.)
Unfortunately, using the accessors makes using the DOM feel
incredibly awkward and "un-Pythonic". xml.dom.minidom only provides
accessors for a few attributes, and uses that to ease implementation
of computed attributes rather than as the preferred way to access the
attributes.
As I'm working on the API documentation, I'm finding that I'd like
to document the nice, Pythonic interface and not the accessors. Is
there anyone who would have problems if I deprecate the accessors in
the documentation, and encourage direct access to the attributes? The
only issue for DOM-over-CORBA that I can see is that a wrapper would
be needed to call the _get_/_set_ methods on the surrogate when the
attributes are accessed; just a little __getattr__/__setattr__ magic
would be needed. Once the Document object is wrapped, the wrapper
could handle wrapping of other objects from the tree automatically, so
the infliction of wrappers would not need to permeate client code.
Any objections to deprecating the _get_/_set_ methods?
-Fred
--
Fred L. Drake, Jr.
PythonLabs at Digital Creations
From fdrake@acm.org Wed Nov 22 20:37:52 2000
From: fdrake@acm.org (Fred L. Drake, Jr.)
Date: Wed, 22 Nov 2000 15:37:52 -0500 (EST)
Subject: [XML-SIG] minidom/pulldom connection
Message-ID: <14876.11936.725389.726400@cj42289-a.reston1.va.home.com>
In the standard library, there are two modules which deal with the
DOM: xml.dom.minidom, which provides a collection of DOM classes, and
xml.dom.pulldom, which can actually build a DOM tree, and relies on
xml.dom.minidom to provide a the Document class. Aside from one
reference to minidom.Document in PullDOM.startDocument(), there are no
references from pulldom to minidom.
There is some concern that the minidom implementation does not
perform as many safety checks as it could; there is a competing
concern that adding the checks would cause it to be slow. This seems
a perfect opportunity to support multiple DOM implementations; one
that's fast & light and another that's heavier but includes all the
safety checks.
I'm proposing the attached patch to pulldom. This modifies
PullDOM.__init__() to accept a Document object as a parameter, and
changes PullDOM.startDocument() to use that object or create a one
using minidom if necessary. This allows all existing client code to
continue to work unchanged.
Objections? Comments? Am I just being to weird about this?
-Fred
--
Fred L. Drake, Jr.
PythonLabs at Digital Creations
From fdrake@acm.org Wed Nov 22 20:40:07 2000
From: fdrake@acm.org (Fred L. Drake, Jr.)
Date: Wed, 22 Nov 2000 15:40:07 -0500 (EST)
Subject: [XML-SIG] minidom/pulldom connection
In-Reply-To: <14876.11936.725389.726400@cj42289-a.reston1.va.home.com>
References: <14876.11936.725389.726400@cj42289-a.reston1.va.home.com>
Message-ID: <14876.12071.287744.635219@cj42289-a.reston1.va.home.com>
--32TdKUcSAf
Content-Type: text/plain; charset=us-ascii
Content-Description: message body and .signature
Content-Transfer-Encoding: 7bit
Fred L. Drake, Jr. writes:
> I'm proposing the attached patch to pulldom.
Which I'm actually attaching this time...
-Fred
--
Fred L. Drake, Jr.
PythonLabs at Digital Creations
--32TdKUcSAf
Content-Type: text/plain
Content-Description: patch to xml.dom.pulldom
Content-Disposition: inline;
filename="pulldom.diff"
Content-Transfer-Encoding: 7bit
Index: pulldom.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/xml/dom/pulldom.py,v
retrieving revision 1.11
diff -c -r1.11 pulldom.py
*** pulldom.py 2000/10/23 18:09:50 1.11
--- pulldom.py 2000/11/22 20:38:20
***************
*** 1,4 ****
- import minidom
import xml.sax,xml.sax.handler
START_ELEMENT = "START_ELEMENT"
--- 1,3 ----
***************
*** 11,17 ****
CHARACTERS = "CHARACTERS"
class PullDOM(xml.sax.ContentHandler):
! def __init__(self):
self.firstEvent = [None, None]
self.lastEvent = self.firstEvent
self._ns_contexts = [{}] # contains uri -> prefix dicts
--- 10,17 ----
CHARACTERS = "CHARACTERS"
class PullDOM(xml.sax.ContentHandler):
! def __init__(self, document=None):
! self.document = document
self.firstEvent = [None, None]
self.lastEvent = self.firstEvent
self._ns_contexts = [{}] # contains uri -> prefix dicts
***************
*** 121,127 ****
self.lastEvent = self.lastEvent[1]
def startDocument(self):
! node = self.curNode = self.document = minidom.Document()
node.parentNode = None
self.lastEvent[1] = [(START_DOCUMENT, node), None]
self.lastEvent = self.lastEvent[1]
--- 121,130 ----
self.lastEvent = self.lastEvent[1]
def startDocument(self):
! if self.document is None:
! import xml.dom.minidom
! self.document = xml.dom.minidom.Document()
! node = self.curNode = self.document
node.parentNode = None
self.lastEvent[1] = [(START_DOCUMENT, node), None]
self.lastEvent = self.lastEvent[1]
--32TdKUcSAf--
From gstein@lyra.org Wed Nov 22 22:56:31 2000
From: gstein@lyra.org (Greg Stein)
Date: Wed, 22 Nov 2000 14:56:31 -0800
Subject: [XML-SIG] DOM API conundrum
In-Reply-To: <14876.7474.577812.703813@cj42289-a.reston1.va.home.com>; from fdrake@acm.org on Wed, Nov 22, 2000 at 02:23:30PM -0500
References: <14876.7474.577812.703813@cj42289-a.reston1.va.home.com>
Message-ID: <20001122145631.G21426@lyra.org>
On Wed, Nov 22, 2000 at 02:23:30PM -0500, Fred L. Drake, Jr. wrote:
>...
> Any objections to deprecating the _get_/_set_ methods?
I've always felt that stuff was rather bogus (ergo, qp_xml's existence).
So yah... +1 on deprecating them.
Cheers,
-g
--
Greg Stein, http://www.lyra.org/
From gstein@lyra.org Wed Nov 22 22:55:14 2000
From: gstein@lyra.org (Greg Stein)
Date: Wed, 22 Nov 2000 14:55:14 -0800
Subject: [XML-SIG] minidom/pulldom connection
In-Reply-To: <14876.12071.287744.635219@cj42289-a.reston1.va.home.com>; from fdrake@acm.org on Wed, Nov 22, 2000 at 03:40:07PM -0500
References: <14876.11936.725389.726400@cj42289-a.reston1.va.home.com> <14876.12071.287744.635219@cj42289-a.reston1.va.home.com>
Message-ID: <20001122145514.F21426@lyra.org>
Before: each time you called startDocument(), it would start a new document.
Now, it will only do so the first time.
I would recommend passing a class (a constructor, really) object to __init__
and storing that constructor. startDocument() can then call it
unconditionally like before.
def __init__(self, cls=xml.dom.minidom.Document):
...
[ this does imply moving the import back to the global scope ]
Cheers,
-g
On Wed, Nov 22, 2000 at 03:40:07PM -0500, Fred L. Drake, Jr. wrote:
Content-Description: message body and .signature
>
> Fred L. Drake, Jr. writes:
> > I'm proposing the attached patch to pulldom.
>
> Which I'm actually attaching this time...
>
>
> -Fred
>
> --
> Fred L. Drake, Jr.
> PythonLabs at Digital Creations
>
Content-Description: patch to xml.dom.pulldom
> Index: pulldom.py
> ===================================================================
> RCS file: /cvsroot/python/python/dist/src/Lib/xml/dom/pulldom.py,v
> retrieving revision 1.11
> diff -c -r1.11 pulldom.py
> *** pulldom.py 2000/10/23 18:09:50 1.11
> --- pulldom.py 2000/11/22 20:38:20
> ***************
> *** 1,4 ****
> - import minidom
> import xml.sax,xml.sax.handler
>
> START_ELEMENT = "START_ELEMENT"
> --- 1,3 ----
> ***************
> *** 11,17 ****
> CHARACTERS = "CHARACTERS"
>
> class PullDOM(xml.sax.ContentHandler):
> ! def __init__(self):
> self.firstEvent = [None, None]
> self.lastEvent = self.firstEvent
> self._ns_contexts = [{}] # contains uri -> prefix dicts
> --- 10,17 ----
> CHARACTERS = "CHARACTERS"
>
> class PullDOM(xml.sax.ContentHandler):
> ! def __init__(self, document=None):
> ! self.document = document
> self.firstEvent = [None, None]
> self.lastEvent = self.firstEvent
> self._ns_contexts = [{}] # contains uri -> prefix dicts
> ***************
> *** 121,127 ****
> self.lastEvent = self.lastEvent[1]
>
> def startDocument(self):
> ! node = self.curNode = self.document = minidom.Document()
> node.parentNode = None
> self.lastEvent[1] = [(START_DOCUMENT, node), None]
> self.lastEvent = self.lastEvent[1]
> --- 121,130 ----
> self.lastEvent = self.lastEvent[1]
>
> def startDocument(self):
> ! if self.document is None:
> ! import xml.dom.minidom
> ! self.document = xml.dom.minidom.Document()
> ! node = self.curNode = self.document
> node.parentNode = None
> self.lastEvent[1] = [(START_DOCUMENT, node), None]
> self.lastEvent = self.lastEvent[1]
--
Greg Stein, http://www.lyra.org/
From kens@sightreader.com Wed Nov 22 21:46:58 2000
From: kens@sightreader.com (Ken)
Date: Wed, 22 Nov 2000 15:46:58 -0600
Subject: [XML-SIG] Child nodes and lazy evaluation (Generators)
Message-ID: <001f01c054cd$bdd89310$04090a0a@devup.upcast.com>
This is a multi-part message in MIME format.
------=_NextPart_000_001C_01C0549B.72947590
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I've written a Generator class which puts lazy evaluation functionality =
into a sequence object. Seems to me that this would be a good thing use =
as an iterator for streaming XML/DOM child nodes. I don't have time =
right now to integrate it myself, but it would be a fairly easy task.
The result would be to hide the details of event driven streaming =
protocol within a pythonic interface that syntactically behaves like a =
fully loaded tree (thus solving the old "tree vs. events" dillemma).
An example of how I have used generators is a readlines method of a =
simulated file object that returns a generator rather than a list. I =
was able to connect a stream 'f' to a serial port or socket (which might =
not have an EOF anytime soon) and then:
for line in f.readlines():
do_something(line)
... which does -not- block on reading the end-of-file as you would =
normally expect.
If you decide to take up this project please let me know.
http://starship.python.net/crew/seehof/Generator.html
- Ken mailto://kens@sightreader.com
------=_NextPart_000_001C_01C0549B.72947590
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I've written a Generator class which =
puts lazy=20
evaluation functionality into a sequence object. Seems to me that =
this=20
would be a good thing use as an iterator for streaming XML/DOM child=20
nodes. I don't have time right now to integrate it myself, but it =
would be=20
a fairly easy task.
The result would be to hide the =
details of event=20
driven streaming protocol within a pythonic interface that syntactically =
behaves=20
like a fully loaded tree (thus solving the old "tree vs. =
events"=20
dillemma).
An example of how I have used =
generators is a=20
readlines method of a simulated file object that returns a generator =
rather than=20
a list. I was able to connect a stream 'f' to a serial port or =
socket=20
(which might not have an EOF anytime soon) and then:
for line in =
f.readlines():
=20
do_something(line)
... which does -not- block on reading the =
end-of-file as you=20
would normally expect.
If you decide to take up this project please let me=20
know.
------=_NextPart_000_001C_01C0549B.72947590--
From uche.ogbuji@fourthought.com Thu Nov 23 00:13:36 2000
From: uche.ogbuji@fourthought.com (uche.ogbuji@fourthought.com)
Date: Wed, 22 Nov 2000 17:13:36 -0700
Subject: [XML-SIG] DOM API conundrum
In-Reply-To: Message from "Fred L. Drake, Jr."
of "Wed, 22 Nov 2000 14:23:30 EST." <14876.7474.577812.703813@cj42289-a.reston1.va.home.com>
Message-ID: <200011230013.RAA16771@localhost.localdomain>
> As I'm working on the API documentation, I'm finding that I'd like
> to document the nice, Pythonic interface and not the accessors. Is
> there anyone who would have problems if I deprecate the accessors in
> the documentation, and encourage direct access to the attributes? The
> only issue for DOM-over-CORBA that I can see is that a wrapper would
> be needed to call the _get_/_set_ methods on the surrogate when the
> attributes are accessed; just a little __getattr__/__setattr__ magic
> would be needed. Once the Document object is wrapped, the wrapper
> could handle wrapping of other objects from the tree automatically, so
> the infliction of wrappers would not need to permeate client code.
> Any objections to deprecating the _get_/_set_ methods?
The main reason to have these was to allow users avoid the performance hit of
__g/setattr__. I don't have a problem giving this up. It would be _really_
nice if Python had computed attributes (any PEPs out there?).
So +1 on deprecating function-based access in the Python/DOM binding. I never
use them anyway.
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From fdrake@acm.org Thu Nov 23 06:22:22 2000
From: fdrake@acm.org (Fred L. Drake, Jr.)
Date: Thu, 23 Nov 2000 01:22:22 -0500 (EST)
Subject: [XML-SIG] minidom/pulldom connection
In-Reply-To: <20001122145514.F21426@lyra.org>
References: <14876.11936.725389.726400@cj42289-a.reston1.va.home.com>
<14876.12071.287744.635219@cj42289-a.reston1.va.home.com>
<20001122145514.F21426@lyra.org>
Message-ID: <14876.47006.382745.707446@cj42289-a.reston1.va.home.com>
Greg Stein writes:
> Before: each time you called startDocument(), it would start a new document.
> Now, it will only do so the first time.
>
> I would recommend passing a class (a constructor, really) object to __init__
> and storing that constructor. startDocument() can then call it
> unconditionally like before.
Excellent point! I've updated the patch on SourceForge:
http://sourceforge.net/patch/?func=detailpatch&patch_id=102477&group_id=5470
> [ this does imply moving the import back to the global scope ]
Actually, no, it doesn't. ;)
-Fred
--
Fred L. Drake, Jr.
PythonLabs at Digital Creations
From Mike.Olson@fourthought.com Thu Nov 23 10:28:09 2000
From: Mike.Olson@fourthought.com (Mike Olson)
Date: Thu, 23 Nov 2000 03:28:09 -0700
Subject: [XML-SIG] minidom/pulldom connection
References: <14876.11936.725389.726400@cj42289-a.reston1.va.home.com> <14876.12071.287744.635219@cj42289-a.reston1.va.home.com> <20001122145514.F21426@lyra.org>
Message-ID: <3A1CF139.6986C87F@FourThought.com>
Greg Stein wrote:
>
> Before: each time you called startDocument(), it would start a new document.
> Now, it will only do so the first time.
>
> I would recommend passing a class (a constructor, really) object to __init__
> and storing that constructor. startDocument() can then call it
> unconditionally like before.
>
> def __init__(self, cls=xml.dom.minidom.Document):
> ...
Why not take it one step further, and pass an instance of a
DOMImplementation into the contructor. The reason I don't like to class
idea, is you limit DOM implementors, now all document contructors must
default all parameters (or not have any). As an example, I'm working on
a persistent DOM implementation that will probably need a database
connection in it contructor.
I don't rememeber if minidom has a DOMImplementation though, however its
trivial to write.
Mike
>
> [ this does imply moving the import back to the global scope ]
>
> Cheers,
> -g
>
> On Wed, Nov 22, 2000 at 03:40:07PM -0500, Fred L. Drake, Jr. wrote:
> Content-Description: message body and .signature
> >
> > Fred L. Drake, Jr. writes:
> > > I'm proposing the attached patch to pulldom.
> >
> > Which I'm actually attaching this time...
> >
> >
> > -Fred
> >
> > --
> > Fred L. Drake, Jr.
> > PythonLabs at Digital Creations
> >
>
> Content-Description: patch to xml.dom.pulldom
> > Index: pulldom.py
> > ===================================================================
> > RCS file: /cvsroot/python/python/dist/src/Lib/xml/dom/pulldom.py,v
> > retrieving revision 1.11
> > diff -c -r1.11 pulldom.py
> > *** pulldom.py 2000/10/23 18:09:50 1.11
> > --- pulldom.py 2000/11/22 20:38:20
> > ***************
> > *** 1,4 ****
> > - import minidom
> > import xml.sax,xml.sax.handler
> >
> > START_ELEMENT = "START_ELEMENT"
> > --- 1,3 ----
> > ***************
> > *** 11,17 ****
> > CHARACTERS = "CHARACTERS"
> >
> > class PullDOM(xml.sax.ContentHandler):
> > ! def __init__(self):
> > self.firstEvent = [None, None]
> > self.lastEvent = self.firstEvent
> > self._ns_contexts = [{}] # contains uri -> prefix dicts
> > --- 10,17 ----
> > CHARACTERS = "CHARACTERS"
> >
> > class PullDOM(xml.sax.ContentHandler):
> > ! def __init__(self, document=None):
> > ! self.document = document
> > self.firstEvent = [None, None]
> > self.lastEvent = self.firstEvent
> > self._ns_contexts = [{}] # contains uri -> prefix dicts
> > ***************
> > *** 121,127 ****
> > self.lastEvent = self.lastEvent[1]
> >
> > def startDocument(self):
> > ! node = self.curNode = self.document = minidom.Document()
> > node.parentNode = None
> > self.lastEvent[1] = [(START_DOCUMENT, node), None]
> > self.lastEvent = self.lastEvent[1]
> > --- 121,130 ----
> > self.lastEvent = self.lastEvent[1]
> >
> > def startDocument(self):
> > ! if self.document is None:
> > ! import xml.dom.minidom
> > ! self.document = xml.dom.minidom.Document()
> > ! node = self.curNode = self.document
> > node.parentNode = None
> > self.lastEvent[1] = [(START_DOCUMENT, node), None]
> > self.lastEvent = self.lastEvent[1]
>
> --
> Greg Stein, http://www.lyra.org/
>
> _______________________________________________
> XML-SIG maillist - XML-SIG@python.org
> http://www.python.org/mailman/listinfo/xml-sig
--
Mike Olson Principal Consultant
mike.olson@fourthought.com (303)583-9900 x 102
Fourthought, Inc. http://Fourthought.com
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From gstein@lyra.org Thu Nov 23 09:40:47 2000
From: gstein@lyra.org (Greg Stein)
Date: Thu, 23 Nov 2000 01:40:47 -0800
Subject: [XML-SIG] minidom/pulldom connection
In-Reply-To: <14876.47006.382745.707446@cj42289-a.reston1.va.home.com>; from fdrake@acm.org on Thu, Nov 23, 2000 at 01:22:22AM -0500
References: <14876.11936.725389.726400@cj42289-a.reston1.va.home.com> <14876.12071.287744.635219@cj42289-a.reston1.va.home.com> <20001122145514.F21426@lyra.org> <14876.47006.382745.707446@cj42289-a.reston1.va.home.com>
Message-ID: <20001123014047.U21426@lyra.org>
On Thu, Nov 23, 2000 at 01:22:22AM -0500, Fred L. Drake, Jr. wrote:
>
> Greg Stein writes:
> > Before: each time you called startDocument(), it would start a new document.
> > Now, it will only do so the first time.
> >
> > I would recommend passing a class (a constructor, really) object to __init__
> > and storing that constructor. startDocument() can then call it
> > unconditionally like before.
>
> Excellent point! I've updated the patch on SourceForge:
>
> http://sourceforge.net/patch/?func=detailpatch&patch_id=102477&group_id=5470
>
> > [ this does imply moving the import back to the global scope ]
>
> Actually, no, it doesn't. ;)
Ah. heh... I had presumed a documentFactory=minidom.Document type of default
in the constructor which would need it. Guess it works your way, too :-)
[ albeit with a bit more complexity, but okay... ]
Cheers,
-g
--
Greg Stein, http://www.lyra.org/
From gstein@lyra.org Thu Nov 23 09:45:45 2000
From: gstein@lyra.org (Greg Stein)
Date: Thu, 23 Nov 2000 01:45:45 -0800
Subject: [XML-SIG] minidom/pulldom connection
In-Reply-To: <3A1CF139.6986C87F@FourThought.com>; from Mike.Olson@fourthought.com on Thu, Nov 23, 2000 at 03:28:09AM -0700
References: <14876.11936.725389.726400@cj42289-a.reston1.va.home.com> <14876.12071.287744.635219@cj42289-a.reston1.va.home.com> <20001122145514.F21426@lyra.org> <3A1CF139.6986C87F@FourThought.com>
Message-ID: <20001123014545.W21426@lyra.org>
On Thu, Nov 23, 2000 at 03:28:09AM -0700, Mike Olson wrote:
> Greg Stein wrote:
> >
> > Before: each time you called startDocument(), it would start a new document.
> > Now, it will only do so the first time.
> >
> > I would recommend passing a class (a constructor, really) object to __init__
> > and storing that constructor. startDocument() can then call it
> > unconditionally like before.
> >
> > def __init__(self, cls=xml.dom.minidom.Document):
> > ...
>
> Why not take it one step further, and pass an instance of a
> DOMImplementation into the contructor. The reason I don't like to class
> idea, is you limit DOM implementors, now all document contructors must
> default all parameters (or not have any). As an example, I'm working on
> a persistent DOM implementation that will probably need a database
> connection in it contructor.
>
> I don't rememeber if minidom has a DOMImplementation though, however its
> trivial to write.
class DatabaseDOMFactory:
def __init__(self, dbparams):
self.dbparams = dbparams
def __call__(self): # no params as a PullDOM constructor
return DatabaseDOM(self.dbparams)
factory = DatabaseDOMFactory(some_params)
pd = PullDOM(factory)
Not so hard :-)
A callable object is alays more flexible than a single instance. The
startDocument() also needs to be able to *construct* multiple documents (one
per invocation). If you pass a single instance, then you lose that behavior.
(which was the basis of my original comment re: Fred's change)
Cheers,
-g
--
Greg Stein, http://www.lyra.org/
From larsga@garshol.priv.no Thu Nov 23 12:23:08 2000
From: larsga@garshol.priv.no (Lars Marius Garshol)
Date: 23 Nov 2000 13:23:08 +0100
Subject: [XML-SIG] XML to Object translation
In-Reply-To: <3A1890F8.ADCEEE17@hotmail.com>
References: <3A1890F8.ADCEEE17@hotmail.com>
Message-ID:
* test e. mail
|
| What is the best way to map XML to objects?
I had an idea yesterday that is not yet implemented, but which will
probably become an example in my book and probably also something that
can be downloaded and used separately.
The idea is basically that when you have an XML document of a
particular type (say RSS) you make a mapping file that describes how
to create an object structure from the file. For RSS this might look
as shown below.
This would build from any RSS file a single root object (with title,
link and description string attributes) with a list attribute holding
objects with the title, link and description string attributes.
--Lars M.
From mal@lemburg.com Thu Nov 23 12:22:30 2000
From: mal@lemburg.com (M.-A. Lemburg)
Date: Thu, 23 Nov 2000 13:22:30 +0100
Subject: [XML-SIG] XML to Object translation
References: <3A1890F8.ADCEEE17@hotmail.com>
Message-ID: <3A1D0C06.518A3F2B@lemburg.com>
Lars Marius Garshol wrote:
>
> * test e. mail
> |
> | What is the best way to map XML to objects?
>
> I had an idea yesterday that is not yet implemented, but which will
> probably become an example in my book and probably also something that
> can be downloaded and used separately.
>
> The idea is basically that when you have an XML document of a
> particular type (say RSS) you make a mapping file that describes how
> to create an object structure from the file. For RSS this might look
> as shown below.
>
>
>
> rss / channel / title
>
>
>
> rss / channel / link
>
>
>
> rss / channel / description
>
>
>
>
>
> title
> link
> description
>
>
>
>
>
>
> This would build from any RSS file a single root object (with title,
> link and description string attributes) with a list attribute holding
> objects with the title, link and description string attributes.
This sounds really cool :-) I presume though, that the classes
you mention in the transformation must exist somewhere to
be instantiated, right ?
BTW, this scheme looks superior to what we have discussed some
months ago about pickling Python to XML. Even though the above
only describes the unpickling process, I think the idea may
also work the other way around.
In any case, this would go a looong way in helping Python read
XML files into Python objects (rather than DOM trees).
--
Marc-Andre Lemburg
______________________________________________________________________
Company: http://www.egenix.com/
Consulting: http://www.lemburg.com/
Python Pages: http://www.lemburg.com/python/
From larsga@garshol.priv.no Thu Nov 23 13:05:35 2000
From: larsga@garshol.priv.no (Lars Marius Garshol)
Date: 23 Nov 2000 14:05:35 +0100
Subject: [XML-SIG] XML to Object translation
In-Reply-To: <3A1D0C06.518A3F2B@lemburg.com>
References: <3A1890F8.ADCEEE17@hotmail.com> <3A1D0C06.518A3F2B@lemburg.com>
Message-ID:
* mal@lemburg.com
|
| This sounds really cool :-)
Thank you. :-)
| I presume though, that the classes you mention in the transformation
| must exist somewhere to be instantiated, right ?
Not necessarily. Since you know the fields you can perfectly well
create dynamic objects, but it would be good if the declaration could
also be used to instantiate classes that already exist. It should
definitely be possible to do so.
| Even though the above only describes the unpickling process, I think
| the idea may also work the other way around.
Maybe. I have to confess that I was only thinking of the problem of
unpickling from a format designed by someone else or to be independent
of the unpickling process. In other cases, things like SOAP, WDDX and
so on are probably better, since they require no declarations.
| In any case, this would go a looong way in helping Python read XML
| files into Python objects (rather than DOM trees).
I hope so. It also needs to handle references and reuse of classes,
but those shouldn't be too hard to add.
--Lars M.
From Alexandre.Fayolle@logilab.fr Thu Nov 23 12:44:52 2000
From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle)
Date: Thu, 23 Nov 2000 13:44:52 +0100 (CET)
Subject: [XML-SIG] XML to Object translation
In-Reply-To: <3A1D0C06.518A3F2B@lemburg.com>
Message-ID:
Maybe you should check 4ODS, which is in the latest 4Suite release. It
uses the Object Definition Language from the ODMG. So mabe what you need
is a way to describe the ODL in XML, which should not be difficult.
Alexandre Fayolle
--
http://www.logilab.com
Narval is the first software agent available as free software (GPL).
LOGILAB, Paris (France).
From mal@lemburg.com Thu Nov 23 12:57:34 2000
From: mal@lemburg.com (M.-A. Lemburg)
Date: Thu, 23 Nov 2000 13:57:34 +0100
Subject: [XML-SIG] XML to Object translation
References:
Message-ID: <3A1D143E.88E72E1B@lemburg.com>
Alexandre Fayolle wrote:
>
> Maybe you should check 4ODS, which is in the latest 4Suite release. It
> uses the Object Definition Language from the ODMG. So mabe what you need
> is a way to describe the ODL in XML, which should not be difficult.
Hmm, that would be a possibility... looking at the www.odmg.org
site there's also an article about "Using XML as an Object Interchange
Format" which might be interesting (haven't read it yet).
OTOH, I think what Lars had in mind was to convert existing XML
into Python objects. This doesn't handle the other way around
but would provide some very useful technology to read XML data
from various sources into Python for further processing.
--
Marc-Andre Lemburg
______________________________________________________________________
Company: http://www.egenix.com/
Consulting: http://www.lemburg.com/
Python Pages: http://www.lemburg.com/python/
From rsalz@caveosystems.com Thu Nov 23 13:41:37 2000
From: rsalz@caveosystems.com (Rich Salz)
Date: Thu, 23 Nov 2000 08:41:37 -0500
Subject: [XML-SIG] XML to Object translation
References: <3A1890F8.ADCEEE17@hotmail.com>
Message-ID: <3A1D1E91.924AC9BE@caveosystems.com>
> The idea is basically that when you have an XML document of a
> particular type (say RSS) you make a mapping file that describes how
> to create an object structure from the file. For RSS this might look
> as shown below.
I wonder if the syntax of that mapping file could be XSLT?
From larsga@garshol.priv.no Thu Nov 23 13:43:56 2000
From: larsga@garshol.priv.no (Lars Marius Garshol)
Date: 23 Nov 2000 14:43:56 +0100
Subject: [XML-SIG] XML to Object translation
In-Reply-To: <3A1D1E91.924AC9BE@caveosystems.com>
References: <3A1890F8.ADCEEE17@hotmail.com> <3A1D1E91.924AC9BE@caveosystems.com>
Message-ID:
* Lars Marius Garshol
|
| The idea is basically that when you have an XML document of a
| particular type (say RSS) you make a mapping file that describes how
| to create an object structure from the file. For RSS this might look
| as shown below.
* Rich Salz
|
| I wonder if the syntax of that mapping file could be XSLT?
As I wrote it the syntax uses XPath and the concepts (especially the
list thing) certainly owe a lot to XSLT.
I was thinking that one might create an XML application that described
object structures and then use XSLT to map to it, but I think this
idea works better, in the sense that I think it is simpler and easier
to use, being more specific to one purpose.
However, if anyone would do something similar using XSLT I would be
interested to look at it and compare the resulting XML documents (that
is, the mapping I made and the XSLT mapping stylesheet).
--Lars M.
From ken@bitsko.slc.ut.us Thu Nov 23 15:15:48 2000
From: ken@bitsko.slc.ut.us (Ken MacLeod)
Date: 23 Nov 2000 09:15:48 -0600
Subject: [XML-SIG] Child nodes and lazy evaluation (Generators)
In-Reply-To: "Ken"'s message of "Wed, 22 Nov 2000 15:46:58 -0600"
References: <001f01c054cd$bdd89310$04090a0a@devup.upcast.com>
Message-ID:
"Ken" writes:
> I've written a Generator class which puts lazy evaluation
> functionality into a sequence object. Seems to me that this would
> be a good thing use as an iterator for streaming XML/DOM child
> nodes. I don't have time right now to integrate it myself, but it
> would be a fairly easy task.
>
> The result would be to hide the details of event driven streaming
> protocol within a pythonic interface that syntactically behaves like
> a fully loaded tree (thus solving the old "tree vs. events"
> dillemma).
>
> An example of how I have used generators is a readlines method of a
> simulated file object that returns a generator rather than a list.
> I was able to connect a stream 'f' to a serial port or socket (which
> might not have an EOF anytime soon) and then:
>
> for line in f.readlines():
> do_something(line)
>
> ... which does -not- block on reading the end-of-file as you would
> normally expect.
>
> If you decide to take up this project please let me know.
>
> http://starship.python.net/crew/seehof/Generator.html
This sounds like an excellent utility for a "pull DOM parser", where
you receive DOM events as you ask for them, out of a queue. In a
basic "pull DOM parser" though, no real magic is necessary as long as
you have an incremental parser feeding the DOM builder.
James Clark's Jade DSSSL processor uses a similar technique for
manipulating partial groves. Jade had the ability to be parsing the
source file and doing the transform in parallel, if any node requested
was not yet parsed, the node request would block until the parser
thread caught up.
-- Ken
From ken@bitsko.slc.ut.us Thu Nov 23 16:18:00 2000
From: ken@bitsko.slc.ut.us (Ken MacLeod)
Date: 23 Nov 2000 10:18:00 -0600
Subject: [XML-SIG] XML to Object translation
In-Reply-To: Rich Salz's message of "Thu, 23 Nov 2000 08:41:37 -0500"
References: <3A1890F8.ADCEEE17@hotmail.com>
<3A1D1E91.924AC9BE@caveosystems.com>
Message-ID:
Rich Salz writes:
> > The idea is basically that when you have an XML document of a
> > particular type (say RSS) you make a mapping file that describes
> > how to create an object structure from the file. For RSS this
> > might look as shown below.
>
> I wonder if the syntax of that mapping file could be XSLT?
XSLT would work very well as long as it can handle the full
transformation. In the XSLT stylesheet, the "output schema" would
follow a regular pattern, not unlike SOAP or WDDX, that can then
easily be converted to objects.
The one drawback to using XSLT is that many conversions to objects
require a little bit more code to get things to work well, so XSLT +
some embedded scripting would be even better.
I have a Perl module, ToObjects[1], that uses a technique very similar
to Paul Prescod's EasySAX[2], where it has an XML pattern to match
(like an XPath), and what you want to do with it as an argument. In
EasySAX, the goal is to make parsing easier:
Paul Prescod writes in [2]:
> Here are the basic ideas:
>
> * handlers pass DOM nodes. (a la "Marrying" and Pyxie)
> * all parent nodes are available (not really that expensive usually)
> * peer and child nodes are not typically available
> * callbacks are labelled with *full XPaths* (a la XSLT)
> * abuses "docstrings" (a la "spark")
>
> def start_spam( self, textNode ):
> "figure/title/text()"
> print "Figure title:"+`textNode`
> print "tagname:"+textNode.parentNode.tagName
>
> * you can ask for an event to be handed to you as a tree
>
> def start_applets(self,elementNode):
> "object/applet as tree"
> for node in elementNode.childNodes:
> print node
>
> * if you do, then child nodes are available
> * the tree disappears after the end event
> * handles namespaces
It's the "as tree" part that ToObjects is similar to, and ToObjects
goal is building an object tree from XML.
ToObjects has specifiers for creating objects, for storing or
appending the content of elements in a field, for defaulting values,
for "keeping" a DOM tree contents, for taking element content "as
string", etc. You can also provide a procedure to be called when a
pattern matches. The example translation in [1], minus the Perl
syntax, looks something like this:
schema -holder
table -make Schema.Table
name -field name -as-string
summary -field summary -as-string
description -field description -as-dom
column -make Schema.Column -push-field columns
unique -field unique -value 1
non-null -field non_null -value 1
default -field default -as-string
Note, of course, that this can be represented as XML, as Python doc
strings (a la EasySAX), or as XSLT with script extensions. I'm just
suggesting the type of operations that would be common in converting
arbitrary XML into objects.
I used a similar technique to map DocBook, LinuxDoc, and TEI to
"generic document objects" before formatting the GDOs, and it worked
very well.
Although not on the immediate ToDo list, this type of processing is
important to the project I'm currently working on, Orchard[3], where
converting XML into nodes is going to be a common process.
-- Ken
[1]
[2]
[3]
From uche.ogbuji@fourthought.com Thu Nov 23 17:49:04 2000
From: uche.ogbuji@fourthought.com (uche.ogbuji@fourthought.com)
Date: Thu, 23 Nov 2000 10:49:04 -0700
Subject: [XML-SIG] XML to Object translation
In-Reply-To: Message from Lars Marius Garshol
of "23 Nov 2000 13:23:08 +0100."
Message-ID: <200011231749.KAA02833@localhost.localdomain>
> | What is the best way to map XML to objects?
>
> I had an idea yesterday that is not yet implemented, but which will
> probably become an example in my book and probably also something that
> can be downloaded and used separately.
>
> The idea is basically that when you have an XML document of a
> particular type (say RSS) you make a mapping file that describes how
> to create an object structure from the file. For RSS this might look
> as shown below.
[snip]
Paul Prescod presented a paper at one of the XML conferences early this year
that proposed a pretty comprehensive XML vocabulary for purposes similr to
this.
I can't find it on prescod.net. Paul, do you have a link?
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From uche.ogbuji@fourthought.com Thu Nov 23 17:52:27 2000
From: uche.ogbuji@fourthought.com (uche.ogbuji@fourthought.com)
Date: Thu, 23 Nov 2000 10:52:27 -0700
Subject: [XML-SIG] XML to Object translation
In-Reply-To: Message from "M.-A. Lemburg"
of "Thu, 23 Nov 2000 13:57:34 +0100." <3A1D143E.88E72E1B@lemburg.com>
Message-ID: <200011231752.KAA02868@localhost.localdomain>
> Alexandre Fayolle wrote:
> >
> > Maybe you should check 4ODS, which is in the latest 4Suite release. It
> > uses the Object Definition Language from the ODMG. So mabe what you need
> > is a way to describe the ODL in XML, which should not be difficult.
>
> Hmm, that would be a possibility... looking at the www.odmg.org
> site there's also an article about "Using XML as an Object Interchange
> Format" which might be interesting (haven't read it yet).
Just to note. 4ODS supports OIF, but not OIFML (the XML vocab in question).
I don't think adding the latter would be difficult at all...
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From uche.ogbuji@fourthought.com Thu Nov 23 17:54:37 2000
From: uche.ogbuji@fourthought.com (uche.ogbuji@fourthought.com)
Date: Thu, 23 Nov 2000 10:54:37 -0700
Subject: [XML-SIG] XML to Object translation
In-Reply-To: Message from Rich Salz
of "Thu, 23 Nov 2000 08:41:37 EST." <3A1D1E91.924AC9BE@caveosystems.com>
Message-ID: <200011231754.KAA02879@localhost.localdomain>
> > The idea is basically that when you have an XML document of a
> > particular type (say RSS) you make a mapping file that describes how
> > to create an object structure from the file. For RSS this might look
> > as shown below.
>
> I wonder if the syntax of that mapping file could be XSLT?
Easily. We already proposed this for Zope, but there was some worry about
making people learn XSLT in order to map from XML to objects.
Our proposal was basically to use XSLT extension elements that provided the
constructor and state info for "unpickling" the objects.
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From uche.ogbuji@fourthought.com Thu Nov 23 17:57:59 2000
From: uche.ogbuji@fourthought.com (uche.ogbuji@fourthought.com)
Date: Thu, 23 Nov 2000 10:57:59 -0700
Subject: [XML-SIG] Child nodes and lazy evaluation (Generators)
In-Reply-To: Message from Ken MacLeod
of "23 Nov 2000 09:15:48 CST."
Message-ID: <200011231757.KAA02899@localhost.localdomain>
> This sounds like an excellent utility for a "pull DOM parser", where
> you receive DOM events as you ask for them, out of a queue. In a
> basic "pull DOM parser" though, no real magic is necessary as long as
> you have an incremental parser feeding the DOM builder.
>
> James Clark's Jade DSSSL processor uses a similar technique for
> manipulating partial groves. Jade had the ability to be parsing the
> source file and doing the transform in parallel, if any node requested
> was not yet parsed, the node request would block until the parser
> thread caught up.
Yes. If Python gets coroutines, this would be pretty simple to implement as
well. As I've mentioned on the 4Suite lists, if some of the facilities from
Stackless were to move into cpython (which seems likely), a _lot_ of
sophistication will become available for XML processing patterns that I think
would put us way ahead of Java, Perl, etc.
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From uche.ogbuji@fourthought.com Thu Nov 23 18:50:18 2000
From: uche.ogbuji@fourthought.com (uche.ogbuji@fourthought.com)
Date: Thu, 23 Nov 2000 11:50:18 -0700
Subject: [XML-SIG] XML to Object translation
In-Reply-To: Message from Ken MacLeod
of "23 Nov 2000 10:18:00 CST."
Message-ID: <200011231850.LAA03081@localhost.localdomain>
> Rich Salz writes:
>
> > > The idea is basically that when you have an XML document of a
> > > particular type (say RSS) you make a mapping file that describes
> > > how to create an object structure from the file. For RSS this
> > > might look as shown below.
> >
> > I wonder if the syntax of that mapping file could be XSLT?
>
> XSLT would work very well as long as it can handle the full
> transformation. In the XSLT stylesheet, the "output schema" would
> follow a regular pattern, not unlike SOAP or WDDX, that can then
> easily be converted to objects.
>
> The one drawback to using XSLT is that many conversions to objects
> require a little bit more code to get things to work well, so XSLT +
> some embedded scripting would be even better.
I disagree. If we use a similar model as pickle, in most cases, all the user
needs to provide is the equivalent of __getinitargs__. I'd say the cases
where __setstate__ type function is required would be infrequent.
Given this, it could be handled by special XSLT extension arguments that use
its attributes to initialize the corresponding Python objects. I think we
still have this proposal floating somewhere on the Zope XMLObject Wiki. I'll
try to dig it up.
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From Mike.Olson@fourthought.com Thu Nov 23 21:10:15 2000
From: Mike.Olson@fourthought.com (Mike Olson)
Date: Thu, 23 Nov 2000 14:10:15 -0700
Subject: [XML-SIG] XML to Object translation
References: <200011231752.KAA02868@localhost.localdomain>
Message-ID: <3A1D87B7.2CF39C0A@FourThought.com>
uche.ogbuji@fourthought.com wrote:
>
> > Alexandre Fayolle wrote:
> > >
> > > Maybe you should check 4ODS, which is in the latest 4Suite release. It
> > > uses the Object Definition Language from the ODMG. So mabe what you need
> > > is a way to describe the ODL in XML, which should not be difficult.
> >
> > Hmm, that would be a possibility... looking at the www.odmg.org
> > site there's also an article about "Using XML as an Object Interchange
> > Format" which might be interesting (haven't read it yet).
>
> Just to note. 4ODS supports OIF, but not OIFML (the XML vocab in question).
> I don't think adding the latter would be difficult at all...
Nope, infact what I plan on doing(someday??) is modifying the OIF
generator to spit out OIFML, and then a simple stylesheet to spit out
OIF.
Mike
>
> --
> Uche Ogbuji Principal Consultant
> uche.ogbuji@fourthought.com +1 303 583 9900 x 101
> Fourthought, Inc. http://Fourthought.com
> 4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
> Software-engineering, knowledge-management, XML, CORBA, Linux, Python
>
> _______________________________________________
> XML-SIG maillist - XML-SIG@python.org
> http://www.python.org/mailman/listinfo/xml-sig
--
Mike Olson Principal Consultant
mike.olson@fourthought.com (303)583-9900 x 102
Fourthought, Inc. http://Fourthought.com
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From martin@loewis.home.cs.tu-berlin.de Thu Nov 23 21:54:31 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Thu, 23 Nov 2000 22:54:31 +0100
Subject: [XML-SIG] DOM API conundrum
In-Reply-To: <14876.7474.577812.703813@cj42289-a.reston1.va.home.com>
(fdrake@acm.org)
References: <14876.7474.577812.703813@cj42289-a.reston1.va.home.com>
Message-ID: <200011232154.WAA01130@loewis.home.cs.tu-berlin.de>
> As I'm working on the API documentation, I'm finding that I'd like
> to document the nice, Pythonic interface and not the accessors. Is
> there anyone who would have problems if I deprecate the accessors in
> the documentation, and encourage direct access to the attributes?
I'm in favour of advocating the "native attributes" API, but I don't
see to deprecate the accessor functions. If you document minidom, it
may be reasonable not to mention them at all. However, "deprecate" to
me means "may not be available in future versions". I don't see any
reason to remove them from 4DOM, or discourage users from using them
there, when they feel more comfortable with calling functions (as they
may have learned from Java).
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Thu Nov 23 22:03:27 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Thu, 23 Nov 2000 23:03:27 +0100
Subject: [XML-SIG] minidom/pulldom connection
In-Reply-To: <14876.11936.725389.726400@cj42289-a.reston1.va.home.com>
(fdrake@acm.org)
References: <14876.11936.725389.726400@cj42289-a.reston1.va.home.com>
Message-ID: <200011232203.XAA01220@loewis.home.cs.tu-berlin.de>
> There is some concern that the minidom implementation does not
> perform as many safety checks as it could; there is a competing
> concern that adding the checks would cause it to be slow. This seems
> a perfect opportunity to support multiple DOM implementations; one
> that's fast & light and another that's heavier but includes all the
> safety checks.
Indeed, multiple DOM implementations are a good thing. This is in fact
what we have - in minidom and 4DOM.
=46rom the conformance point of view, minidom is *wrong* by not raising
exceptions in appropriate places. However, I doubt anybody fixing this
would start with pulldom.
> I'm proposing the attached patch to pulldom. This modifies
> PullDOM.__init__() to accept a Document object as a parameter, and
> changes PullDOM.startDocument() to use that object or create a one
> using minidom if necessary. This allows all existing client code to
> continue to work unchanged.
> Objections? Comments? Am I just being to weird about this?
I don't see the need to provide this kind of extensibility until
somebody actually wants to implement an alternative minidom on top of
pulldom. However, if this is added now, I'd agree with Mike that it
would be better to support DOMImplementation objects in minidom.
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Thu Nov 23 22:07:59 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Thu, 23 Nov 2000 23:07:59 +0100
Subject: [XML-SIG] minidom/pulldom connection
In-Reply-To: <20001123014545.W21426@lyra.org> (message from Greg Stein on Thu,
23 Nov 2000 01:45:45 -0800)
References: <14876.11936.725389.726400@cj42289-a.reston1.va.home.com> <14876.12071.287744.635219@cj42289-a.reston1.va.home.com> <20001122145514.F21426@lyra.org> <3A1CF139.6986C87F@FourThought.com> <20001123014545.W21426@lyra.org>
Message-ID: <200011232207.XAA01264@loewis.home.cs.tu-berlin.de>
> A callable object is alays more flexible than a single instance. The
> startDocument() also needs to be able to *construct* multiple
> documents (one per invocation). If you pass a single instance, then
> you lose that behavior.
Unless the object you pass is a DOMImplementation...
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Thu Nov 23 22:12:54 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Thu, 23 Nov 2000 23:12:54 +0100
Subject: [XML-SIG] XML to Object translation
In-Reply-To: <3A1D1E91.924AC9BE@caveosystems.com> (message from Rich Salz on
Thu, 23 Nov 2000 08:41:37 -0500)
References: <3A1890F8.ADCEEE17@hotmail.com> <3A1D1E91.924AC9BE@caveosystems.com>
Message-ID: <200011232212.XAA01312@loewis.home.cs.tu-berlin.de>
> I wonder if the syntax of that mapping file could be XSLT?
XSLT, as it is, only allows XML as output.
Regards,
Martin
From noreply@sourceforge.net Fri Nov 24 08:00:06 2000
From: noreply@sourceforge.net (noreply@sourceforge.net)
Date: Fri, 24 Nov 2000 00:00:06 -0800
Subject: [XML-SIG] [Bug #123306] "FromXmlFile" typo in xml-howto.tex
Message-ID: <200011240800.AAA19032@sf-web3.vaspecialprojects.com>
Bug #123306, was updated on 2000-Nov-24 00:00
Here is a current snapshot of the bug.
Project: Python/XML
Category: Documentation
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Summary: "FromXmlFile" typo in xml-howto.tex
Details: In xml/doc/xml-howto.tex,
in \subsection{Getting A DOM Tree},
in the second paragraph,
there are two references to \function{FromXmlFile}.
The second one should be \function{FromXmlUrl}.
For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=123306&group_id=6473
From Alexandre.Fayolle@logilab.fr Fri Nov 24 14:53:56 2000
From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle)
Date: Fri, 24 Nov 2000 15:53:56 +0100 (CET)
Subject: [XML-SIG] pyXML 0.5.5.1
Message-ID:
I've just noticed that PyXML 0.5.5.1 is no longer available from
python.org. On the other hand the back port of the features that where
dropped in 0.6.x is not available in a public release. In the meantime,
would it be possible to make 0.5.5.1 available from an official site ?
Thanks
Alexandre Fayolle
--
http://www.logilab.com
Narval is the first software agent available as free software (GPL).
LOGILAB, Paris (France).
From akuchlin@mems-exchange.org Fri Nov 24 15:04:18 2000
From: akuchlin@mems-exchange.org (Andrew Kuchling)
Date: Fri, 24 Nov 2000 10:04:18 -0500
Subject: [XML-SIG] pyXML 0.5.5.1
In-Reply-To: ; from Alexandre.Fayolle@logilab.fr on Fri, Nov 24, 2000 at 03:53:56PM +0100
References:
Message-ID: <20001124100418.A3281@kronos.cnri.reston.va.us>
On Fri, Nov 24, 2000 at 03:53:56PM +0100, Alexandre Fayolle wrote:
>I've just noticed that PyXML 0.5.5.1 is no longer available from
>python.org. On the other hand the back port of the features that where
Actually, all I did was point the download links at SourceForge; 0.5.5.1
is still available from http://www.python.org/sigs/xml-sig/files/ .
--amk
From Alexandre.Fayolle@logilab.fr Fri Nov 24 15:09:34 2000
From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle)
Date: Fri, 24 Nov 2000 16:09:34 +0100 (CET)
Subject: [XML-SIG] pyXML 0.5.5.1
In-Reply-To: <20001124100418.A3281@kronos.cnri.reston.va.us>
Message-ID:
On Fri, 24 Nov 2000, Andrew Kuchling wrote:
> On Fri, Nov 24, 2000 at 03:53:56PM +0100, Alexandre Fayolle wrote:
> >I've just noticed that PyXML 0.5.5.1 is no longer available from
> >python.org. On the other hand the back port of the features that where
>
> Actually, all I did was point the download links at SourceForge; 0.5.5.1
> is still available from http://www.python.org/sigs/xml-sig/files/ .
Thanks for the tip, I'll update Narval's download section.
Alexandre Fayolle
--
http://www.logilab.com
Narval is the first software agent available as free software (GPL).
LOGILAB, Paris (France).
From uche.ogbuji@fourthought.com Fri Nov 24 17:07:31 2000
From: uche.ogbuji@fourthought.com (uche.ogbuji@fourthought.com)
Date: Fri, 24 Nov 2000 10:07:31 -0700
Subject: [XML-SIG] XML to Object translation
In-Reply-To: Message from "Martin v. Loewis"
of "Thu, 23 Nov 2000 23:12:54 +0100." <200011232212.XAA01312@loewis.home.cs.tu-berlin.de>
Message-ID: <200011241707.KAA04655@localhost.localdomain>
> > I wonder if the syntax of that mapping file could be XSLT?
>
> XSLT, as it is, only allows XML as output.
Not true. You can output xml, html or text by setting the xsl:output
instruction.
We've used XSLT to efficiently put out RFC811/MIME e-mail messages for a
client.
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From Mike.Olson@fourthought.com Fri Nov 24 20:02:11 2000
From: Mike.Olson@fourthought.com (Mike Olson)
Date: Fri, 24 Nov 2000 13:02:11 -0700
Subject: [XML-SIG] XML to Object translation
References: <3A1890F8.ADCEEE17@hotmail.com> <3A1D1E91.924AC9BE@caveosystems.com> <200011232212.XAA01312@loewis.home.cs.tu-berlin.de>
Message-ID: <3A1EC943.8761F0A7@FourThought.com>
"Martin v. Loewis" wrote:
>
> > I wonder if the syntax of that mapping file could be XSLT?
>
> XSLT, as it is, only allows XML as output.
It only allows mark-up as input, you can output any format you'd like,
with 4XSLT, I've outputted XML, HTML, text files, even specially
formated text files such as SMTP messages.
Mike
>
> Regards,
> Martin
>
> _______________________________________________
> XML-SIG maillist - XML-SIG@python.org
> http://www.python.org/mailman/listinfo/xml-sig
--
Mike Olson Principal Consultant
mike.olson@fourthought.com (303)583-9900 x 102
Fourthought, Inc. http://Fourthought.com
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From martin@loewis.home.cs.tu-berlin.de Fri Nov 24 19:57:58 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Fri, 24 Nov 2000 20:57:58 +0100
Subject: [XML-SIG] XML to Object translation
In-Reply-To: <200011241707.KAA04655@localhost.localdomain>
(uche.ogbuji@fourthought.com)
References: <200011241707.KAA04655@localhost.localdomain>
Message-ID: <200011241957.UAA00928@loewis.home.cs.tu-berlin.de>
> Not true. You can output xml, html or text by setting the xsl:output
> instruction.
Ah, thanks.
> We've used XSLT to efficiently put out RFC811/MIME e-mail messages
> for a client.
That still doesn't explain how to create Python objects, though -
unless the text you generate is Python source code.
I can see how an extension namespace would be useful, though; so it
wouldn't really create any output.
Regards,
Martin
From Mike.Olson@fourthought.com Fri Nov 24 21:13:58 2000
From: Mike.Olson@fourthought.com (Mike Olson)
Date: Fri, 24 Nov 2000 14:13:58 -0700
Subject: [XML-SIG] XML to Object translation
References: <200011241707.KAA04655@localhost.localdomain> <200011241957.UAA00928@loewis.home.cs.tu-berlin.de>
Message-ID: <3A1EDA16.973C869F@FourThought.com>
"Martin v. Loewis" wrote:
>
>
> That still doesn't explain how to create Python objects, though -
> unless the text you generate is Python source code.
>
> I can see how an extension namespace would be useful, though; so it
> wouldn't really create any output.
I think that is the idea that Uche is talking about, using an format
similar to Lars's, but instead of a XML application creating these, an
Extension Element that generates objects into a stack or list. I think
I have code that does this somewhere, I'll see if I can find it and
generalize it this weekend.
Mike
>
> Regards,
> Martin
>
> _______________________________________________
> XML-SIG maillist - XML-SIG@python.org
> http://www.python.org/mailman/listinfo/xml-sig
--
Mike Olson Principal Consultant
mike.olson@fourthought.com (303)583-9900 x 102
Fourthought, Inc. http://Fourthought.com
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From martin@loewis.home.cs.tu-berlin.de Fri Nov 24 21:22:39 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Fri, 24 Nov 2000 22:22:39 +0100
Subject: [XML-SIG] Specializing DOM exceptions
Message-ID: <200011242122.WAA01293@loewis.home.cs.tu-berlin.de>
I'd like to propose an enhancement to the DOM exception classes,
namely that different codes are mapped to different subclasses:
class IndexSizeErr(DOMException):
code = INDEX_SIZE_ERR
class DomstringSizeErr(DOMException):
code = DOMSTRING_SIZE_ERR
class HierarchyRequestErr(DOMException):
code = HIERARCHY_REQUEST_ERR
class WrongDocument(DOMException):
code = WRONG_DOCUMENT_ERR
...
That will simplify raising the exceptions, and catching a specific one
if desired. It will still provide the backwards-compatibility of
accessing .code of the exception (which should *not* be removed, even
after a while, IMO).
Also, I'd like to make DOMException, the code constants, and the
derived classes part of the official Python API, so all DOM
implementations use the same set of exceptions.
I'd like to re-arrange the internationalization in this code:
It shouldn't take a %i parameter, since the traceback will read
IndexSizeErr: DOM Error Code 1: Index error accessing NodeList or NamedNodeMap
Instead, it should read
IndexSizeErr: Indexfehler beim Zugriff auf NodeList oder NamedNodeMap
I'd like to use gettext if available, so that somebody may actually
consider translating the messages - or drop the idea of translating
the __str__ representation of a DOM exception.
What do you think?
Regards,
Martin
From frank63@ms5.hinet.net Sat Nov 25 15:46:24 2000
From: frank63@ms5.hinet.net (Frank J.S. Chen)
Date: Sat, 25 Nov 2000 15:46:24 -0000
Subject: [XML-SIG] Re: XML to Object translation
Message-ID: <200011250757.PAA24215@ms5.hinet.net>
> >
> > Hmm, that would be a possibility... looking at the www.odmg.org
> > site there's also an article about "Using XML as an Object Interchange
> > Format" which might be interesting (haven't read it yet).
>
Interesting, but I cannot find this article on www.odmg.org?
----------------------------------------------------------------------------
-------
Chen Chien-Hsun
Taipei,Taiwan,R.O.C.
From frank63@ms5.hinet.net Sat Nov 25 15:51:44 2000
From: frank63@ms5.hinet.net (Frank J.S. Chen)
Date: Sat, 25 Nov 2000 15:51:44 -0000
Subject: [XML-SIG] Re:DOM API conundrum
Message-ID: <200011250757.PAA24256@ms5.hinet.net>
>
> I'm in favour of advocating the "native attributes" API, but I don't
> see to deprecate the accessor functions. If you document minidom, it
> may be reasonable not to mention them at all. However, "deprecate" to
> me means "may not be available in future versions". I don't see any
> reason to remove them from 4DOM, or discourage users from using them
> there, when they feel more comfortable with calling functions (as they
> may have learned from Java).
>
> Regards,
> Martin
>
Agreed. Different choices is a good thing.
----------------------------------------------------------------------------
-------
Chen Chien-Hsun
Taipei,Taiwan,R.O.C.
From frank63@ms5.hinet.net Sat Nov 25 16:35:15 2000
From: frank63@ms5.hinet.net (Frank J.S. Chen)
Date: Sat, 25 Nov 2000 16:35:15 -0000
Subject: [XML-SIG] Wzip Version
Message-ID: <200011250834.QAA04340@ms5.hinet.net>
Hi:
Finally, I figure out why I cannot install PyXML win32zip version
correctly: I use old winzip 6.2.
After upgrading to winzip 8.0, everything goes fine.
Maybe the download location should take a note around package files.
----------------------------------------------------------------------------
-------
Chen Chien-Hsun
Taipei,Taiwan,R.O.C.
From mal@lemburg.com Sat Nov 25 10:29:33 2000
From: mal@lemburg.com (M.-A. Lemburg)
Date: Sat, 25 Nov 2000 11:29:33 +0100
Subject: [XML-SIG] Re: XML to Object translation
References: <200011250757.PAA24215@ms5.hinet.net>
Message-ID: <3A1F948D.C07E75C6@lemburg.com>
"Frank J.S. Chen" wrote:
>
> > >
> > > Hmm, that would be a possibility... looking at the www.odmg.org
> > > site there's also an article about "Using XML as an Object Interchange
> > > Format" which might be interesting (haven't read it yet).
> >
>
> Interesting, but I cannot find this article on www.odmg.org?
http://www.odmg.org/library/readingroom/oifml.pdf
--
Marc-Andre Lemburg
______________________________________________________________________
Company: http://www.egenix.com/
Consulting: http://www.lemburg.com/
Python Pages: http://www.lemburg.com/python/
From fdrake@acm.org Sat Nov 25 19:23:03 2000
From: fdrake@acm.org (Fred L. Drake, Jr.)
Date: Sat, 25 Nov 2000 14:23:03 -0500 (EST)
Subject: [XML-SIG] Specializing DOM exceptions
In-Reply-To: <200011242122.WAA01293@loewis.home.cs.tu-berlin.de>
References: <200011242122.WAA01293@loewis.home.cs.tu-berlin.de>
Message-ID: <14880.4503.540928.777303@cj42289-a.reston1.va.home.com>
Martin v. Loewis writes:
> I'd like to propose an enhancement to the DOM exception classes,
> namely that different codes are mapped to different subclasses:
...
> That will simplify raising the exceptions, and catching a specific one
> if desired. It will still provide the backwards-compatibility of
> accessing .code of the exception (which should *not* be removed, even
> after a while, IMO).
I like this idea; very Pythonic! The exceptions and .code values
could live in xml/dom/__init__.py (or at least be imported there so
the values are used from xml.dom, instead of from individual DOM
implementations.
I'd also like to see the .nodeType values defined this way, and
shared by the implementations.
> I'd like to re-arrange the internationalization in this code:
> It shouldn't take a %i parameter, since the traceback will read
...
I don't know about the i18n issues; I'll bow to your superior
expertise in this area.
-Fred
--
Fred L. Drake, Jr.
PythonLabs at Digital Creations
From fdrake@acm.org Sat Nov 25 19:25:55 2000
From: fdrake@acm.org (Fred L. Drake, Jr.)
Date: Sat, 25 Nov 2000 14:25:55 -0500 (EST)
Subject: [XML-SIG] DOM API conundrum
In-Reply-To: <200011232154.WAA01130@loewis.home.cs.tu-berlin.de>
References: <14876.7474.577812.703813@cj42289-a.reston1.va.home.com>
<200011232154.WAA01130@loewis.home.cs.tu-berlin.de>
Message-ID: <14880.4675.663998.684465@cj42289-a.reston1.va.home.com>
Martin v. Loewis writes:
> I'm in favour of advocating the "native attributes" API, but I don't
> see to deprecate the accessor functions. If you document minidom, it
> may be reasonable not to mention them at all. However, "deprecate" to
> me means "may not be available in future versions". I don't see any
> reason to remove them from 4DOM, or discourage users from using them
> there, when they feel more comfortable with calling functions (as they
> may have learned from Java).
If the _get_/_set_ methods should be allowed as part of the API,
then I think they should be required, otherwise DOM client code still
can't work with all DOMs that otherwise offer the same functionality.
Should these methods and the direct attribute access both be required?
I thought that was part of the problem we had been trying to avoid.
-Fred
--
Fred L. Drake, Jr.
PythonLabs at Digital Creations
From kajiyama@grad.sccs.chukyo-u.ac.jp Sat Nov 25 21:05:21 2000
From: kajiyama@grad.sccs.chukyo-u.ac.jp (Tamito KAJIYAMA)
Date: Sun, 26 Nov 2000 06:05:21 +0900
Subject: [XML-SIG] 4XPath: parsing Unicode string
Message-ID: <200011252105.GAA01817@dhcp198.grad.sccs.chukyo-u.ac.jp>
Hi,
I've used 4Suite 0.9.2 together with Python 2.0 and PyXML 0.6.2.
I have a problem that I cannot pass a Unicode string containing
Japanese characters to the 4XPath parser. Following reproduces
the problem:
>>> from xml.xpath import XPathParser
>>> p = XPathParser.XPathParser()
>>> path = p.parseExpression(u'substring-after("2000/10/30", "/")')
The expression above does not have any problem, but the next,
very similar one does:
>>> path = p.parseExpression(u'substring-after("2000\u5E7410\u670830\u65E5", "\u6708")')
Traceback (most recent call last):
File "", line 1, in ?
File "/opt/lib/python2.0/site-packages/_xmlplus/xpath/XPathParser.py", line 36, in parseExpression
XPathParserBase.XPathParserBase.parse(self, st)
File "/opt/lib/python2.0/site-packages/_xmlplus/xpath/XPathParserBase.py", line 62, in parse
XPath.cvar.g_prodNum)
xml.xpath.XPathParserBase.SyntaxException:
********** Syntax Exception **********
While parsing substring-after("2000YY10MM30DD", "MM")
Exception at or near "10"
Line: 0, Production Number: 9
(YY, MM and DD represent Japanese characters \u5E74, \u6708 and
\u65E5, respectively. They are encoded in the native encoding
in the error message, so I replaced the actual characters for
quotation.)
Actually, the second XPath expression is used in an XSL
stylesheet, but the same error raises.
What's wrong? I wonder if I miss something trivial.
Thanks,
--
KAJIYAMA, Tamito
From uche.ogbuji@fourthought.com Sun Nov 26 01:31:58 2000
From: uche.ogbuji@fourthought.com (uche.ogbuji@fourthought.com)
Date: Sat, 25 Nov 2000 18:31:58 -0700
Subject: [XML-SIG] Specializing DOM exceptions
In-Reply-To: Message from "Martin v. Loewis"
of "Fri, 24 Nov 2000 22:22:39 +0100." <200011242122.WAA01293@loewis.home.cs.tu-berlin.de>
Message-ID: <200011260131.SAA09864@localhost.localdomain>
> I'd like to propose an enhancement to the DOM exception classes,
> namely that different codes are mapped to different subclasses:
>
> class IndexSizeErr(DOMException):
> code = INDEX_SIZE_ERR
>
> class DomstringSizeErr(DOMException):
> code = DOMSTRING_SIZE_ERR
>
> class HierarchyRequestErr(DOMException):
> code = HIERARCHY_REQUEST_ERR
>
> class WrongDocument(DOMException):
> code = WRONG_DOCUMENT_ERR
I like the idea. It won't be too hard to do for DOM. If, however, we were to
extend the concept to XSLT, that would be quite a bit of work.
> Also, I'd like to make DOMException, the code constants, and the
> derived classes part of the official Python API, so all DOM
> implementations use the same set of exceptions.
>
> I'd like to re-arrange the internationalization in this code:
> It shouldn't take a %i parameter, since the traceback will read
>
> IndexSizeErr: DOM Error Code 1: Index error accessing NodeList or NamedNodeMap
>
> Instead, it should read
>
> IndexSizeErr: Indexfehler beim Zugriff auf NodeList oder NamedNodeMap
Understood and sensible.
> I'd like to use gettext if available, so that somebody may actually
> consider translating the messages - or drop the idea of translating
> the __str__ representation of a DOM exception.
I'm unclear here. Is it really so difficult to add a de_DE.py (or whatever)
for translating the error strings?
When I put in the i18n hooks, I thought about gettext, but it's not available
in a straightforward manner for Windows and some UNIX systems. Also, does
distutils provide any support for gettext database pre-processing?
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From uche.ogbuji@fourthought.com Sun Nov 26 02:27:43 2000
From: uche.ogbuji@fourthought.com (uche.ogbuji@fourthought.com)
Date: Sat, 25 Nov 2000 19:27:43 -0700
Subject: [XML-SIG] 4XPath: parsing Unicode string
In-Reply-To: Message from Tamito KAJIYAMA
of "Sun, 26 Nov 2000 06:05:21 +0900." <200011252105.GAA01817@dhcp198.grad.sccs.chukyo-u.ac.jp>
Message-ID: <200011260227.TAA09957@localhost.localdomain>
[crossposted to string SIG & i18n SIG since wwe need help from anywhere we can
get it]
> I've used 4Suite 0.9.2 together with Python 2.0 and PyXML 0.6.2.
>
> I have a problem that I cannot pass a Unicode string containing
> Japanese characters to the 4XPath parser. Following reproduces
> the problem:
[snip]
Uh oh. Tick tick tick BOOM!
This is one of those problems I knew would come up, but was hoping to put off
dealing with.
The problem is that we use FLEX and BISON for XPath parsing. This is old
school code that doesn't know for wchar_t, let alone unicode.
The solution is for us to uniformly translate things to UTF-8 for the scanner,
ans then update the scanner so that it handles UTF-8 encoded sequences. But
this is a very ugly mound of work.
Or does anyone out there know of an i18n-friendly scanner?
Or does anyone out there have _any_ other ideas? We're pretty much at the end
of the tether with FLEX and Bison for other problems (concurrency), but we're
not coming up with other good parsing solutions. We've looked at most of the
Python tools available at the Vaults of Parnassus, and they don't really cut
it. We could probably do it with re and some glue code to handle the
non-regular portions of XPath, but this would also be a huge task.
Any help or ideas are appreciated.
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From fdrake@acm.org Sun Nov 26 03:44:27 2000
From: fdrake@acm.org (Fred L. Drake, Jr.)
Date: Sat, 25 Nov 2000 22:44:27 -0500 (EST)
Subject: [XML-SIG] Specializing DOM exceptions
In-Reply-To: <200011260131.SAA09864@localhost.localdomain>
References:
<200011242122.WAA01293@loewis.home.cs.tu-berlin.de>
<200011260131.SAA09864@localhost.localdomain>
Message-ID: <14880.34587.340914.608294@cj42289-a.reston1.va.home.com>
uche.ogbuji@fourthought.com writes:
> I'm unclear here. Is it really so difficult to add a de_DE.py (or
> whatever) for translating the error strings?
>
> When I put in the i18n hooks, I thought about gettext, but it's not
> available in a straightforward manner for Windows and some UNIX
> systems. Also, does distutils provide any support for gettext
> database pre-processing?
Are the tools in Tools/i18n/ not sufficient? If not, I'm sure
Martin & Barry would like to know! Perhaps the documentation needs to
be improved?
-Fred
--
Fred L. Drake, Jr.
PythonLabs at Digital Creations
From uche.ogbuji@fourthought.com Sun Nov 26 03:59:33 2000
From: uche.ogbuji@fourthought.com (uche.ogbuji@fourthought.com)
Date: Sat, 25 Nov 2000 20:59:33 -0700
Subject: [XML-SIG] Specializing DOM exceptions
In-Reply-To: Message from "Fred L. Drake, Jr."
of "Sat, 25 Nov 2000 22:44:27 EST." <14880.34587.340914.608294@cj42289-a.reston1.va.home.com>
Message-ID: <200011260359.UAA10155@localhost.localdomain>
> uche.ogbuji@fourthought.com writes:
>
> > I'm unclear here. Is it really so difficult to add a de_DE.py (or
> > whatever) for translating the error strings?
> >
> > When I put in the i18n hooks, I thought about gettext, but it's not
> > available in a straightforward manner for Windows and some UNIX
> > systems. Also, does distutils provide any support for gettext
> > database pre-processing?
>
> Are the tools in Tools/i18n/ not sufficient? If not, I'm sure
> Martin & Barry would like to know! Perhaps the documentation needs to
> be improved?
Cool! Thanks for the pointer. I had no idea Python provided a gettext
work-alike. Hopefully it uses GNU gettext if available for maximum
performance and interop, but even if it doesn't, it's at least as good as my
framework.
It goes on the list...
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From tpassin@home.com Sun Nov 26 04:08:11 2000
From: tpassin@home.com (Thomas B. Passin)
Date: Sat, 25 Nov 2000 23:08:11 -0500
Subject: [XML-SIG] 4XPath: parsing Unicode string
References: <200011260227.TAA09957@localhost.localdomain>
Message-ID: <00e101c0575e$7e7ae720$7cac1218@reston1.va.home.com>
What about John Aycock's SPARK approach? Maybe it could form the basis
for a new set of scanner/parsers? It's at
http://www.csr.uvic.ca/~aycock/python/content.html
Cheers,
Tom Passin
wrote
> ...
> Or does anyone out there have _any_ other ideas? We're pretty much at
the end
> of the tether with FLEX and Bison for other problems (concurrency),
but we're
> not coming up with other good parsing solutions. We've looked at most
of the
> Python tools available at the Vaults of Parnassus, and they don't
really cut
> it. We could probably do it with re and some glue code to handle the
> non-regular portions of XPath, but this would also be a huge task.
>
> Any help or ideas are appreciated.
>
From kajiyama@grad.sccs.chukyo-u.ac.jp Sun Nov 26 05:32:48 2000
From: kajiyama@grad.sccs.chukyo-u.ac.jp (Tamito KAJIYAMA)
Date: Sun, 26 Nov 2000 14:32:48 +0900
Subject: [XML-SIG] xsl:comment in 4XSLT
Message-ID: <200011260532.OAA02803@dhcp198.grad.sccs.chukyo-u.ac.jp>
Hi,
I've used 4Suite 0.9.2 with Python 2.0 and PyXML 0.6.2.
I have a problem with 4XSLT. In the content of the xsl:comment
element, a text node yields a string encoded in UTF-8 instead
the encoding specified by .
Following reproduces the problem:
----------------------------------------------------------------------
from xml.xslt.Processor import Processor
STYLESHEET = """\
"""
XMLDOCUMENT = u"""\
H\344agen-DazsH\344agen-Dazs
"""
processor = Processor()
processor.appendStylesheetString(STYLESHEET)
result = processor.runString(XMLDOCUMENT.encode("utf-8"))
print repr(result)
----------------------------------------------------------------------
This script gives the following output:
"\012\012H\344agen-Dazs\012\012"
where the para element has the correct content, but the comment
does not. Why?
Thanks,
--
KAJIYAMA, Tamito
From uche.ogbuji@fourthought.com Sun Nov 26 09:03:08 2000
From: uche.ogbuji@fourthought.com (uche.ogbuji@fourthought.com)
Date: Sun, 26 Nov 2000 02:03:08 -0700
Subject: [XML-SIG] xsl:comment in 4XSLT
In-Reply-To: Message from Tamito KAJIYAMA
of "Sun, 26 Nov 2000 14:32:48 +0900." <200011260532.OAA02803@dhcp198.grad.sccs.chukyo-u.ac.jp>
Message-ID: <200011260903.CAA11145@localhost.localdomain>
> I've used 4Suite 0.9.2 with Python 2.0 and PyXML 0.6.2.
>
> I have a problem with 4XSLT. In the content of the xsl:comment
> element, a text node yields a string encoded in UTF-8 instead
> the encoding specified by .
> Following reproduces the problem:
[snip]
This was an oversight in the writers which I've fixed in CVS. Hopefully you
can use the snapshots. Thanks for the great bug-report. Made it easy to
pinpoint the problem, and now it is added to the test suite.
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
From martin@loewis.home.cs.tu-berlin.de Sun Nov 26 18:56:37 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Sun, 26 Nov 2000 19:56:37 +0100
Subject: [XML-SIG] Specializing DOM exceptions
In-Reply-To: <14880.4503.540928.777303@cj42289-a.reston1.va.home.com>
(fdrake@acm.org)
References: <200011242122.WAA01293@loewis.home.cs.tu-berlin.de> <14880.4503.540928.777303@cj42289-a.reston1.va.home.com>
Message-ID: <200011261856.TAA00929@loewis.home.cs.tu-berlin.de>
> I like this idea; very Pythonic! The exceptions and .code values
> could live in xml/dom/__init__.py (or at least be imported there so
> the values are used from xml.dom, instead of from individual DOM
> implementations.
Good, I'll add this to PyXML first, and then move it over to Python
later. Please note that DOMException is already defined in
xml.dom(.__init__) of PyXML, so it is merely a matter of adding the
derived classes, and adding them in 4DOM.
> I'd also like to see the .nodeType values defined this way, and
> shared by the implementations.
It's more difficult with those, since the spec says they are defined
inside of the Node interface. We could deviate from the DOM spec in
this respect; clearly, they are located in the DOM interface to
facilitate the Java mapping (which also puts the ExceptionCodes inside
org.w3c.dom.DOMException).
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Sun Nov 26 19:13:55 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Sun, 26 Nov 2000 20:13:55 +0100
Subject: [XML-SIG] Specializing DOM exceptions
In-Reply-To: <200011260131.SAA09864@localhost.localdomain>
(uche.ogbuji@fourthought.com)
References: <200011260131.SAA09864@localhost.localdomain>
Message-ID: <200011261913.UAA00987@loewis.home.cs.tu-berlin.de>
> > I'd like to use gettext if available, so that somebody may actually
> > consider translating the messages - or drop the idea of translating
> > the __str__ representation of a DOM exception.
>
> I'm unclear here. Is it really so difficult to add a de_DE.py (or whatever)
> for translating the error strings?
That's not really difficult - although the tool support for
translating messages from .po files is better than that for .py files.
What *is* difficult is the selection code. For example, I have a LANG
setting of de_DE.UTF-8; I'd still like to get the de_DE
messages. Also, people that use de_AT.ISO-8859-1 still want the de_DE
catalog, since likely nobody will offer one specialized for Austria.
> When I put in the i18n hooks, I thought about gettext, but it's not
> available in a straightforward manner for Windows and some UNIX
> systems.
With Python 2.0, it is available uniformly on every system. On Python
1.5, it would fall back to the English catalog, ie.
try:
import gettext
bindtextdomain("pyxml",path-to-catalog)
def _(msg):
gettext.dgettext("pyxml",msg)
except ImportError:
def _(msg):
return msg
> Also, does distutils provide any support for gettext database
> pre-processing?
Not yet; this is part of the open issue of installing the Tools code
on every system (in this case, of msgfmt.py).
I think it would be possible to introduce another command build_mo or
so. I'll try to have it generate mo files with available tools, and
install the catalog into
_xmlplus/messages//LC_MESSAGES/pyxml.po, or /share/locale.
Regards,
Martin
From martin@loewis.home.cs.tu-berlin.de Sun Nov 26 19:18:47 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Sun, 26 Nov 2000 20:18:47 +0100
Subject: [XML-SIG] Specializing DOM exceptions
In-Reply-To: <200011260359.UAA10155@localhost.localdomain>
(uche.ogbuji@fourthought.com)
References: <200011260359.UAA10155@localhost.localdomain>
Message-ID: <200011261918.UAA01031@loewis.home.cs.tu-berlin.de>
> Cool! Thanks for the pointer. I had no idea Python provided a
> gettext work-alike. Hopefully it uses GNU gettext if available for
> maximum performance and interop, but even if it doesn't, it's at
> least as good as my framework.
It is compatible with GNU gettext on the API and binary file format
level. The idea of linking to the C library's gettext was rejected - I
forgot what the exact reason was.
Regards,
Martin
From gstein@lyra.org Sun Nov 26 20:50:02 2000
From: gstein@lyra.org (Greg Stein)
Date: Sun, 26 Nov 2000 12:50:02 -0800
Subject: [XML-SIG] Specializing DOM exceptions
In-Reply-To: <200011261918.UAA01031@loewis.home.cs.tu-berlin.de>; from martin@loewis.home.cs.tu-berlin.de on Sun, Nov 26, 2000 at 08:18:47PM +0100
References: <200011260359.UAA10155@localhost.localdomain> <200011261918.UAA01031@loewis.home.cs.tu-berlin.de>
Message-ID: <20001126125002.M21426@lyra.org>
On Sun, Nov 26, 2000 at 08:18:47PM +0100, Martin v. Loewis wrote:
> > Cool! Thanks for the pointer. I had no idea Python provided a
> > gettext work-alike. Hopefully it uses GNU gettext if available for
> > maximum performance and interop, but even if it doesn't, it's at
> > least as good as my framework.
>
> It is compatible with GNU gettext on the API and binary file format
> level. The idea of linking to the C library's gettext was rejected - I
> forgot what the exact reason was.
Licensing. The gettext library is GPL'd. (not LGPL!). If Python were to link
with it, then it would force Python into the GPL.
This is the same reason that readline is not enabled by default. It requires
specific, user action.
There is an open question of whether source code that is designed to link
with a specific GPL'd library falls under the GPL or not. In other words,
since we have specific calls to the readline library (although disabled by
default), we could potentially fall under the GPL. Personally, I think that
is hooey, but the "real" answer is to design your hooks such that any of
several libraries could be linked in; at that point, you aren't building
your app to work with a specific GPL'd library and you're safe.
The GPL is such a bother...
Cheers,
-g
--
Greg Stein, http://www.lyra.org/
From martin@loewis.home.cs.tu-berlin.de Sun Nov 26 21:19:41 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Sun, 26 Nov 2000 22:19:41 +0100
Subject: [XML-SIG] 4XPath: parsing Unicode string
In-Reply-To: <200011260227.TAA09957@localhost.localdomain>
(uche.ogbuji@fourthought.com)
References: <200011260227.TAA09957@localhost.localdomain>
Message-ID: <200011262119.WAA01389@loewis.home.cs.tu-berlin.de>
> Any help or ideas are appreciated.
I just had a look at YAPPS, and it seems suitable. It is only LL(1),
but I think that should be sufficient for XPath. It does tokenization
with re (if asked); in Python 2.0, that will be sre, which should be
capable of tokenizing Unicode strings as well. In any case, it is 100%
pure Python, which should simplify porting.
I don't know enough of 4XPath to rewrite it; I'm certainly willing to
help with reformulating the grammar and fixing bugs in YAPPS if
somebody else starts porting to it.
Regards,
Martin
From iron@mso.oz.net Mon Nov 27 01:25:34 2000
From: iron@mso.oz.net (Mike Orr)
Date: Sun, 26 Nov 2000 17:25:34 -0800
Subject: [XML-SIG] Error using xml.sax.{xmlreader,expatreader}
Message-ID: <20001126172534.A13544@mso.oz.net>
--SUOF0GtieIMvvwua
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
I'm getting an error trying to do a simple XML parse into a dictionary, using
Python 2.0 and PyXML 0.6.2. xml.make_parser() is choosing expatreader, and
expatreader says:
File "/opt/python-2.0/lib/python2.0/site-packages/_xmlplus/sax/expatreader.py", line 81, in feed
self._parser.Parse(data, isFinal)
TypeError: not enough arguments; expected 4, got 2
Attached is a small program which demonstrates this. Am I doing something
wrong or is there a bug in the library?
When I run the program, it says:
$ python -i esquimel_bug_test.py
Python version is:
2.0 (#10, Nov 11 2000, 20:39:18)
[GCC 2.95.2 20000220 (Debian GNU/Linux)]
XML version is 0.6.2
*** BEGIN XML DATA ***
Mary
had a little lamb
*** END XML DATA ***
Traceback (most recent call last):
File "esquimel_bug_test.py", line 116, in ?
if __name__ == "__main__": main()
File "esquimel_bug_test.py", line 109, in main
result = fromxml(f)
File "esquimel_bug_test.py", line 44, in fromxml
parser.parse(fp)
File "/opt/python-2.0/lib/python2.0/site-packages/_xmlplus/sax/expatreader.py", line 42, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/opt/python-2.0/lib/python2.0/site-packages/_xmlplus/sax/xmlreader.py", line 120, in parse
self.feed(buffer)
File "/opt/python-2.0/lib/python2.0/site-packages/_xmlplus/sax/expatreader.py", line 81, in feed
self._parser.Parse(data, isFinal)
TypeError: not enough arguments; expected 4, got 2
>>> import pdb
>>> pdb.pm()
> /opt/python-2.0/lib/python2.0/site-packages/_xmlplus/sax/expatreader.py(82)feed()
-> except expat.error:
(Pdb) where
... lines deleted ...
> /opt/python-2.0/lib/python2.0/site-packages/_xmlplus/sax/expatreader.py(82)feed()
-> except expat.error:
(Pdb) list
... lines deleted ...
81 self._parser.Parse(data, isFinal)
82 -> except expat.error:
... lines deleted ...
(Pdb) self._parser
(Pdb) self._parser.Parse
(Pdb) p data
'\012 \012 Mary\012 \012had a little lamb\012\012' (Pdb) p isFinal
0
(Pdb) p self._parser.Parse.__doc__
"Parse(data[, isfinal])\012Parse XML data. `isfinal' should be true at end of input."
--
-Mike (Iron) Orr, iron@mso.oz.net (if mail problems: mso@jimpick.com)
http://mso.oz.net/ English * Esperanto * Russkiy * Deutsch * Espan~ol
--SUOF0GtieIMvvwua
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="esquimel_bug_test.py"
#!/usr/bin/python
"""esquimel_bug_test.py -- Why is this giving an error?
"""
import os, pprint, string, sys, tempfile
import xml
import xml.sax
import xml.sax.saxutils
xmlfile = "/tmp/xmlfile.xml"
XML_ROOT_NAME = "esquimel_data"
True = (1==1); False = (1==0)
XML_DATA = """\
Mary
had a little lamb
"""
################ EXCEPTIONS ##############
class DataError(Exception):
def __init__(self, *args):
if len(args) == 3:
what, expected, found = args
s = "expected %s '%s', found '%s'" % (what, expected, found)
args = (s,)
Exception.__init__(self, *args)
class NotFoundError(Exception): pass
################ XML FUNCTIONS #########
def fromxml(fp):
"""Read xml from the file object, return the tags inside the root tag as a
dictionary, tag name -> characters. Attributes are ignored.
"""
parser = xml.sax.make_parser()
content_handler = MyContentHandler()
error_handler = xml.sax.saxutils.ErrorRaiser()
parser.setContentHandler(content_handler)
parser.setErrorHandler(error_handler)
parser.parse(fp)
return content_handler.dic
class MyContentHandler(xml.sax.saxlib.ContentHandler):
"""Sets 'self.dic' to a dictionary containing the tags inside the root tag,
tag name -> characters. Attributes are ignored. Subtags (3rd-level tags) raise
DataError.
"""
def __init__(self):
self.dic = {}
self.in_root = False # Are we inside the root tag?
self.in_second = False # Are we inside a second-level tag?
def startElement(self, name, attrs):
"""attrs are ignored.
"""
if self.in_second: # Shouldn't happen.
raise DataError(
"a field should never have subtags (this tag = '%s')." % name)
elif self.in_root: # Begin a field.
self.field = name # The current field name.
self.chars = [] # Characters we've read for this field.
self.in_field = True
else: # Begin a record.
if name != XML_ROOT_NAME:
raise DataError("XML root tag", XML_ROOT_NAME, name)
self.in_table = True
def endElement(self, name):
if self.in_field: # Gather the field data.
chars = map(string.strip, self.chars)
chars = " ".join(chars)
chars = chars.strip()
self.fields[self.field] = chars
self.field = self.chars = None # Will raise TypeError if
# these are erroneously used before being reassigned.
self.in_field = False
elif self.in_root: # Leaving the root tag.
self.in_root = False
def characters(self, ch, start, length):
end = start + length
chars = ch[start:end]
if not self.in_field:
raise DataError("characters outside a field: %s" % `chars`)
self.chars.append(chars)
def main():
print "Python version is:\n", sys.version
print "XML version is ", xml.__version__
file = tempfile.mktemp()
f = open(file, 'w+')
f.write(XML_DATA)
f.seek(0)
print
print "*** BEGIN XML DATA ***"
print f.read()
print "*** END XML DATA ***"
f.seek(0)
try:
result = fromxml(f)
print "The result is:"
pprint.pprint(result)
finally:
f.close()
os.remove(file)
if __name__ == "__main__": main()
--SUOF0GtieIMvvwua--
From martin@loewis.home.cs.tu-berlin.de Mon Nov 27 09:46:20 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Mon, 27 Nov 2000 10:46:20 +0100
Subject: [XML-SIG] Re: RPM spec file available?
In-Reply-To: <20001122054602.C7A7EDD02C@tux.gnu.franken.de> (message from Karl
Eichwalder on Wed, 22 Nov 2000 06:46:02 +0100 (CET))
References: <3A1A4A62.4664B5AE@lemburg.com> <20001122054602.C7A7EDD02C@tux.gnu.franken.de>
Message-ID: <200011270946.KAA00713@loewis.home.cs.tu-berlin.de>
> I've a small proposal to make it even better; the automagic may consider
> to install some doc material, too:
>
> %doc ANNOUNCE CREDITS LICENCE MANIFEST MANIFEST.in README README.dom
> %doc README.pyexpat README.sgmlop TODO
>
> %doc demo
> %doc doc
> %doc test
>
> Other small changes I've done are vendor specific.
Can you please elaborate what the effect of these lines in a spec file
would be? Also, any ideas on how to have distutils generate such lines?
TIA,
Martin
From martin@loewis.home.cs.tu-berlin.de Mon Nov 27 09:44:16 2000
From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis)
Date: Mon, 27 Nov 2000 10:44:16 +0100
Subject: [XML-SIG] Error using xml.sax.{xmlreader,expatreader}
In-Reply-To: <20001126172534.A13544@mso.oz.net> (message from Mike Orr on Sun,
26 Nov 2000 17:25:34 -0800)
References: <20001126172534.A13544@mso.oz.net>
Message-ID: <200011270944.KAA00676@loewis.home.cs.tu-berlin.de>
> Attached is a small program which demonstrates this. Am I doing something
> wrong or is there a bug in the library?
This is a bug in your code:
> def characters(self, ch, start, length):
In SAX2, the characters method only has a single argument (besides self),
so it should be
def characters(self, chars):
if not self.in_field:
raise DataError("characters outside a field: %s" % `chars`)
self.chars.append(chars)
There is a problem with the traceback, though - since characters is
called from C code, and since that call happens to fail, the topmost
Python stack frame is the one where expatreader calls into the C code.
Any hints for improving the error reporting are
appreciated. Delegating the calls from pyexpat to a method in
expatreader first is not acceptable, though, due to the expected
overhead of an additional call in the normal case.
Regards,
Martin
From ke@suse.de Mon Nov 27 10:38:38 2000
From: ke@suse.de (Karl Eichwalder)
Date: 27 Nov 2000 11:38:38 +0100
Subject: [XML-SIG] Re: RPM spec file available?
In-Reply-To: "Martin v. Loewis"'s message of "Mon, 27 Nov 2000 10:46:20 +0100"
References: <3A1A4A62.4664B5AE@lemburg.com>
<20001122054602.C7A7EDD02C@tux.gnu.franken.de>
<200011270946.KAA00713@loewis.home.cs.tu-berlin.de>
Message-ID:
"Martin v. Loewis" writes:
> > %doc ANNOUNCE CREDITS LICENCE MANIFEST MANIFEST.in README README.dom
> > %doc README.pyexpat README.sgmlop TODO
> >
> > %doc demo
> > %doc doc
> > %doc test
> Can you please elaborate what the effect of these lines in a spec file
> would be?
%doc is a macro expanding to a 'cp' command and adding those copied
files to the %files list automatically. Pretty handy. The best way to
install documentation. The files will end up in %{_defaultdocdir} (or
something) which expand to
/usr/doc/$PACKAGE
/usr/doc/$PACKAGE-$VERSION
/usr/share/doc/$PACKAGE
or
/usr/share/doc/packages/$PACKAGE
Thus it's independent from the distribution using RPM and documentation
will always end up at the right place.
> Also, any ideas on how to have distutils generate such lines?
Sorry, I'm not familiar with the distutils ;-(
--
Linux Frechet 2.2.16 #1 Wed Sep 20 19:11:23 GMT 2000 i686 unknown
11:33am up 26 days, 16:08, 4 users, load average: 1.10, 1.04, 1.01
work : ke@suse.de
Karl Eichwalder home : keichwa@gmx.net
From Wolfgang.Schoeberl@web.de Mon Nov 27 10:29:34 2000
From: Wolfgang.Schoeberl@web.de (Wolfgang Schoeberl)
Date: Mon, 27 Nov 2000 11:29:34 +0100
Subject: [XML-SIG] tools
Message-ID: <200011271029.LAA32067@mailgate2.cinetic.de>
Hi,
I am looking for some (stable) tools in Python to transform XML to RTF,PDF=
or MIF Files. Which tools would you suggest and what are your experiences=
=3F So far, I haven't been very lucky in finding any...However, http://www.g=
arshol.priv.no/download/xmltools/
gives a good overview over a lot of tools.
Also, I would be happy if you told me your experiences with the parsers yo=
u use (e.g. documentation, reliability, speed,...)
thanks,
Wolfgang
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F
Die Fachpresse ist sich einig: WEB.DE 12mal Testsieger! Kostenlos E-Mail,=20
Fax, SMS, Verschl=FCsselung, POP3, WAP....testen Sie uns! http://freemail.we=
b.de
From Alexandre.Fayolle@logilab.fr Mon Nov 27 12:30:26 2000
From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle)
Date: Mon, 27 Nov 2000 13:30:26 +0100 (CET)
Subject: [XML-SIG] tools
In-Reply-To: <200011271029.LAA32067@mailgate2.cinetic.de>
Message-ID:
On Mon, 27 Nov 2000, Wolfgang Schoeberl wrote:
> Hi,
>
> I am looking for some (stable) tools in Python to transform XML to
> RTF,PDF or MIF Files. Which tools would you suggest and what are your
> experiences? So far, I haven't been very lucky in finding
> any...However, http://www.garshol.priv.no/download/xmltools/ gives a
> good overview over a lot of tools.
I personnaly know of no such tools in python. However, if python is not
mandatory for what you're looking for, you way want to consider Jade or
Openjade (http://sourceforge.net/projects/openjade/). This is what we use
at Logilab to convert xml docbook files to rtf or dvi ( and then to
postscript or pdf). Framemaker is also supported. It uses DSSSL to process
the xml files.
Alexandre Fayolle
--
http://www.logilab.com
Narval is the first software agent available as free software (GPL).
LOGILAB, Paris (France).
From tpassin@home.com Mon Nov 27 14:12:05 2000
From: tpassin@home.com (Thomas B. Passin)
Date: Mon, 27 Nov 2000 09:12:05 -0500
Subject: [XML-SIG] tools
References: <200011271029.LAA32067@mailgate2.cinetic.de>
Message-ID: <001b01c0587c$06cf1ec0$7cac1218@reston1.va.home.com>
Reportlab is a python toolset that can produce PDF output from xml. Go
to
http://www.reportlab.com/
Most of the package is concerned with graphics, layout, and pdf
creation, not xml. But part of it - at least the Pythonpoint package,
perhaps more - uses xml files to describe the output.
Tom Passin
Wolfgang Schoeberl asked -
I am looking for some (stable) tools in Python to transform XML to
RTF,PDF or MIF Files. Which tools would you suggest and what are your
experiences? So far, I haven't been very lucky in finding any
From matt@clondiag.com Mon Nov 27 17:01:10 2000
From: matt@clondiag.com (Matthias Kirst)
Date: Mon, 27 Nov 2000 18:01:10 +0100
Subject: [XML-SIG] DOM-Module
Message-ID: <3A229356.4ACE0587@clondiag.com>
Dear XML-Pythonists,
Is there an up-to-date doc for the XML.DOM- Module available?
I really want to use it ...
Matthias
Clondiag, Jena
From Alexandre.Fayolle@logilab.fr Mon Nov 27 17:21:15 2000
From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle)
Date: Mon, 27 Nov 2000 18:21:15 +0100 (CET)
Subject: [XML-SIG] DOM-Module
In-Reply-To: <3A229356.4ACE0587@clondiag.com>
Message-ID:
On Mon, 27 Nov 2000, Matthias Kirst wrote:
> Dear XML-Pythonists,
>
> Is there an up-to-date doc for the XML.DOM- Module available?
> I really want to use it ...
http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/
Alexandre Fayolle
--
http://www.logilab.com
Narval is the first software agent available as free software (GPL).
LOGILAB, Paris (France).
From fdrake@acm.org Mon Nov 27 17:37:36 2000
From: fdrake@acm.org (Fred L. Drake, Jr.)
Date: Mon, 27 Nov 2000 12:37:36 -0500 (EST)
Subject: [XML-SIG] DOM-Module
In-Reply-To: <3A229356.4ACE0587@clondiag.com>
References: <3A229356.4ACE0587@clondiag.com>
Message-ID: <14882.39904.614585.129220@cj42289-a.reston1.va.home.com>
Matthias Kirst writes:
> Is there an up-to-date doc for the XML.DOM- Module available?
> I really want to use it ...
The documentation in the Library Reference is fairly poor (I think),
but I am working on it. We'll see if I can actually improve it.
-Fred
--
Fred L. Drake, Jr.
PythonLabs at Digital Creations
From fdrake@acm.org Mon Nov 27 22:55:55 2000
From: fdrake@acm.org (Fred L. Drake, Jr.)
Date: Mon, 27 Nov 2000 17:55:55 -0500 (EST)
Subject: [XML-SIG] Updated patch for DOM improvements
Message-ID: <14882.59003.654300.235618@cj42289-a.reston1.va.home.com>
I've updated the patch on SF that aims to improve the DOM bundled
with Python, and assigned it to Martin for review; I welcome comments
from others here as well:
http://sourceforge.net/patch/?func=detailpatch&patch_id=102477&group_id=5470
The DOM Level 2 recommendation is short on description of the
DOMImplementation object; can anyone point me to more information on
properly interpreting the parameters? Thanks!
-Fred
--
Fred L. Drake, Jr.