Re: [ANN] pyxser-0.2r --- Python XML Serialization



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Stefan Behnel <stefan_ml@xxxxxxxxx>
on Sunday 19 April 2009 15:08
wrote in comp.lang.python:


Daniel Molina Wegener wrote:
Stefan Behnel <stefan_ml@xxxxxxxxx>
on Sunday 19 April 2009 02:25
wrote in comp.lang.python:


Daniel Molina Wegener wrote:
* Every serilization is made into unicode objects.
Hmm, does that mean that when I serialise, I get a unicode object back?
What about the XML declaration? How can a user create well-formed XML
from your output? Or is that not the intention?

Yes, if you serialize an object you get an XML string as
unicode object, since unicode objects supports UTF-8 and
some other encodings.

That's not what I meant. I was wondering why you chose to use a unicode
string instead of a byte string (which XML is defined for). If your only
intention is to deserialise the unicode string into a tree, that may be
acceptable. However, as soon as you start writing the data to a file or
through a network pipe, or pass it to an XML parser, you'd better make it
well-formed XML. So you either need to encode it as UTF-8 (for which you
do not need a declaration), or you will need to encode it in a different
byte encoding, and then prepend a declaration yourself. In any case, this
is a lot more overhead (and cumbersome for users) than writing out a
correctly serialised byte string directly.

Sorry, it appears that I've misunderstand your question. By /unicode
objects/ I mean /python unicode objects/ aka /python unicode strings/.
Most of them can be reencoded into /latin*/ strings and then /ascii/
strings if is that what you want. But for most communications, suchs as
Java systems, utf-8 encoding goes as default. I've made pyxser to
generate interoperability between python and other systems.


You seemed to be very interested in good performance, so I don't quite
understand why you want to require an additional step with a relatively
high performance impact that only makes it harder for users to use the
tool correctly.

Stefan

Atte.
- --
.O. | Daniel Molina Wegener | FreeBSD & Linux
..O | dmw [at] coder [dot] cl | Open Standards
OOO | http://coder.cl/ | FOSS Developer

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iQIcBAEBCgAGBQJJ6+7fAAoJEHxqfq6Y4O5NC3cQAKbjssbbGbIIKSAD+OKj3KCm
dyJw4PePeXnYMlbEWvYY+QRkpQbJMSRISFjOIKS3IFtUcJIuAA94XjTMuvDt8L1X
k5oClZlEOPQU3tXuuMTA6AuhZVzW4RSkz0fNhVdi6RZve+rscmjZMIWz95uygnet
ct1J6y9JRN2BmBgoBa5A72tcIvNQBx/T7Q2iUk1oUB6iLZutQejEeUeHT7p89e4d
x38+mVZqpPYoZNn4Sxwcz61LgYEYQH7sIfzup8+6qv8CiDRD6PFrP1DBcV08mtYO
PBDGyK9RBHDVPqZ0SK40uNdX3TROprllaf41XDas8602xGsgJR64xwBM9s21yWcu
Z2ovweYvwEivqJeg+H6sWvKILJIqa1tkSM/JU2Gm5//cQstt2nfx5eoW07UrLmSb
qH0T7Gvg+pd060HbkQ3bgxumG5iIAtTOoix8V5R+ILYtdxWHsEXizm+XMKQITQTt
jngR0zoFwsdSesMwUdFD/RE4vpE4z9KErBcdO3Rhc5AbyR7HZwqemQ2KiloXg207
nn3hrZOz8GgHXeIg8nAugFOxJ6b2RxDJPb8zf6vjC9FFO8PESyb3kKz+XvaeMx2f
0eVaWhgiuNTxPyC/JJWO8yVizoQA1uXPGC6H0dhGxqMNNb4K7mtcQVNUpogzHq4X
lwz4KllmL7b4YWpd983D
=TEqt
-----END PGP SIGNATURE-----
.



Relevant Pages

  • Re: receiving ??? chars instead of "special" chars
    ... The issue that I'd call out if I were reviewing this design is inherently ... processing that string (converted to a string by the underlying .NET ... processing instruction at the start of the XML document. ... >>, the conflict in the encoding ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • RE: receiving ??? chars instead of "special" chars
    ... seeing is in coercing encoded XML into a string. ... to use a text reader that properly handles the encoding conversion. ... >returned data from the webservice (data that is contained in strXml after ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: Encoding XML troubles
    ... > I am using the WebRequest functionality to get the feeds. ... > default) already define the encoding type of the expected stream. ... as I do not now the encoding type while fetching the xml ... > xml string, get the encoding type and re-encode result string with the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: [ANN] pyxser-0.2r --- Python XML Serialization
    ... How can a user create well-formed XML ... string instead of a byte string. ... Since libxml2 default encoding is UTF-8, ...
    (comp.lang.python)
  • Re: unicode, bytes redux
    ... encoding of the string it was decoded from? ... the unicode object is not the proper ... it's not even the desired functionality: ... wanted is the ability to tell how long the string ...
    (comp.lang.python)