Re: XMLToolkit 0,7,BETA.2

Petko Petkov <[email protected]>
Newsgroups gmane.comp.python.xml
Message-ID <[email protected]>
Thanks for the advice. It is a good one.
I am currently finishing up the library.

For all of you who really cant get why I am wasting my time codding 
another XML library.... Well, I am security  guy and I need small 
library that does the main things. I hope you can use XT in a similar 
way. The official 0.7 version will be out soon.

Thanks for the advice again.

Uche Ogbuji wrote:
> 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
> do:
>
> 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.
>
>
>   


_______________________________________________
XML-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/xml-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.