Great.
To put the encoding in the generated document, the best way is to go through
the DOM stage explicitly:
dom = dp.toDOM()
dom.documentElement.setAttribute('encoding', 'UTF-8')
print dom.toxml()
If you would, please file a request on the PyXB trac server
https://sourceforge.net/apps/trac/pyxb/ for me to update BindingDOMSupport
to provide an facility for setting this and maybe other document-level
attributes.
Peter
2010/7/3 David Hrbáč <hrbac.c...@seznam.cz>
> > 1. How can I add information about encoding, I'd like to have it utf8.
> > <?xml version="1.0" encoding="UTF-8"?>
> >
> > 2. How can I work with utf8 characters within my script? It doesn't work
> for me.
> > My test is:
> > ivh.text = 'Unicode test ěščřžýáíé'
>
> This solves my problem with Unicode characters.
> ivh.text = u'Unicode test ěščřžýáíé'
>
> Regards,
> David
>
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
pyxb-users mailing list
pyxb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyxb-users