[XML-SIG] xmlpickle.py ?!
Tue, 08 Aug 2000 07:41:17 -0600
"M.-A. Lemburg" wrote:
> Mike Olson wrote:
> > "M.-A. Lemburg" wrote:
> > >
> > You may want to look at Zope in Zope/lib/python/ZODB/ImportExport.py.
> > they do some XML pickling here. However, I think they call back to each
> > object for help in the pickle processes (each object writes thier own
> > chunk of XML). Though I'm not 100% sure.
> BTW, I only have a vague idea about what Xpath et al. do
> except that they are intended to address certain parts in
> an XML file. Is there anything to watch out for when designing
> a DTD in order to make addressability simple with Xpath ?
> Ideally the xmlpickle data should be addressable using
> standard Python notations, e.g. a.b, a['b'] and a.
> Which of the two possibilities I posted would fit this model
> w/r to Xpath ?
No matter how you do it, XPath won't look like python. The "." is not
valid in XPath. Attributes are accessed as with the attribute:: axis
(or @). Ex.
<Adress>1234 S West Way</Address>
To get Mike
To get Mikes Address with employee mike as the context:
> Marc-Andre Lemburg
> Business: http://www.lemburg.com/
> Python Pages: http://www.lemburg.com/python/
> XML-SIG maillist - XML-SIG@python.org
Mike Olson Principal Consultant
email@example.com (303)583-9900 x 102
Fourthought, Inc. http://Fourthought.com
Software-engineering, knowledge-management, XML, CORBA, Linux, Python