"Re: [xml] Retrieve encoding from xml input document (ctxt->encoding)"



Hi,

on 12/4/2003 2:43 PM Olivier Courtin wrote:

I've got a little problem with libxml2 as i want to retrieve encoding
type from xml input document.

        xmlParseDocument(ctxt);

The parsed document will be available in ctxt->myDoc.

        printf("[%s]\n", ctxt->encoding);

ctxt->myDoc holds the information you want.

printf("[%s]\n", ctxt->myDoc->encoding);

You may want to check first if the parsing went well, so look at
"http://www.xmlsoft.org/html/libxml-parser.html#xmlParseDocument";

Regards,

Kasimier




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]