[XML-SIG] XMLToolkit 0,7,BETA.2

Uche Ogbuji uche.ogbuji at gmail.com
Wed Dec 14 15:12:11 CET 2005

On Sun, 2005-12-11 at 07:49 -0700, Uche Ogbuji wrote:

I got a bounce saying this message had been blocked by XBL, even though the
server in question is not listed in XBL.  Busted config?

On Thu, 2005-12-08 at 10:37 +0000, Petko Petkov wrote:
> Hello to everybody,
> This is XMLToolkit 0,7,BETA.2. I simplified most of the code. There are
> a few new features added as well. Now you can use the Binding tool to
> Bind XML documents to python objects.
> doc = Binding.fromfile('GoogleService.wsdl')
> doc.definitions.message
> doc.definitions.message[0]
> doc.definitions.message[1]
> doc.definitions.message.name
> doc.definitions.message.name = 'bla bla'
> doc.definitions.message = '<h1>Hei I can assign XML to elements that
> will be parsed on the fly.</h1> Good!'

This is a neat feature, and similar to the append_xml_fragment() method
in Amara.  I do wonder whether it should be the default, though.  As an
example, in Amara the above would set text in that element and escape
the angle brackets.  If you wanted to add child elements you'd have to

doc.definitions.message.append_xml_fragment('<h1>Hei I can assign XML to
elements that will be parsed on the fly.</h1> Good!')

My worry with your approach is that if I want to use such characters in
my regular XML, I'd have to escape them.  Rather than doing:

doc.definitions.message = '100 < 1000'

I'd have to do:

doc.definitions.message = '100 &lt; 1000'

Which seems a bit odd at the content API level?

> doc.definitions.message[1] = OtherBinding
> doc.definitions.message[2] = OtherElement
> doc.definitions.message[0] = doc.definitions.message[2]
> for m in doc.definitions.message:
>     print m
>     print m.name
> doc.xml
> doc.xml(encoding = 'utf-8')
> doc.xml(encoding = 'utf-8', stream = mystream)
> doc.xml(encoding = 'utf-8', file = 'myGoogle.wsdl')
> str(doc.xml)
> doc.xml.composestream(stream)
> As you can see the syntax is similar  to Amara XMLToolkit.

Yes.  Nice.  What does doc.xml.composestream(stream) do, though?

I'm sorry that I don't have much time to peruse your code.

Uche Ogbuji                               Fourthought, Inc.
http://uche.ogbuji.net                    http://fourthought.com
http://copia.ogbuji.net                   http://4Suite.org <http://4suite.org/>
Articles: http://uche.ogbuji.net/tech/publications/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/xml-sig/attachments/20051214/393e2ec3/attachment.htm

More information about the XML-SIG mailing list