[XML-SIG] Re: Encoding again

Eustaquio Rangel de Oliveira Jr. eustaquiorangel at yahoo.com
Mon Apr 19 14:08:16 EDT 2004

Hash: SHA1

|what's the output encoding?  the XML default is UTF-8, which tends to
|look as weird characters if you view them as ISO-8859-1.
|check if you can specify the encoding when you're saving the file
|(according to the libxml2 docs, xmlSaveFileEnc and xmlSaveFileTo both
|take encoding arguments).


Thanks for your answer!
I'm running it on the console, not saving to a file.
I'm using this:

import libxml2
import libxslt

styledoc = libxml2.parseFile("impmod.xsl")
style	 = libxslt.parseStylesheetDoc(styledoc)
mods     = ("/home/taq/progs.xml","/home/taq/progs2.xml");
for mod in mods:
	doc	= libxml2.parseFile(mod)
	result = style.applyStylesheet(doc,None)
	print result.content

There on "print result.content" is where the weird chars are. I'd like
to make it works first viewing on the console and so maybe saving it to
a file.

That None value on applyStylesheet is kind of misterous to me. I'm a
little confused by some questions as where I can get the API guide of
all the functions I can use with libxml2/libslt with Python (dir works
but it will be a cool thing find the APIs somewhere ehehe).

For example, didn't know about xmlSaveFileEnc and xmlSaveFileTo, where
are they? Excuse my ignorance about this matter, I'm a newbie on Python
and a newbie using XML stuff on it. :-)

Thanks again,

- --
~    .--.     TaQ (Eustáquio Rangel)                  ((__-^^-,-^^-__))
~   |o_o |    Usuário registrado GNU/Linux no. 224050  `-_---' `---_-'
~   |:_/ |    email  : eustaquiorangel at yahoo.com        `--|o` 'o|--'
~  //   \ \   URL    : http://beam.to/taq                  \  `  /
~ (|     | )  ICQ    : 110103942                            ): :(
/'\_   _/`\  PGP key: 0x784988BB                           :o_o:
\___)=(___/  Eu gosto de GNU/Linux, e vc ? ;)               "-"
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org


More information about the XML-SIG mailing list