This has nothing to do with your current problem, but will save you trouble later: note that transcode() allocates memory, which you must release when you're done with it.
> -----Original Message----- > From: David --- [mailto:[EMAIL PROTECTED] > Sent: Monday, March 15, 2004 7:00 AM > To: [EMAIL PROTECTED] > Subject: Dom parser problem with transcode > > > > Hi, > I'm having a problem building a Domparser. > The code below run properly qnd after debugging it > exits normally as well. > > It seems the problem comes from the transcode method. > If i remove the transcode it returns the corresponding > encoded value but like that it return nothing and it > dies after i call the transcode method. > > for( std::vector<std::string>::iterator tag = > tags.begin(); tag !=tags.end(); tag++) > { > char *query = strdup((*tag).c_str()); > XMLCh* tmpstr = XMLString::transcode(query); > > int len; > c_nodelist = c_doc->getElementsByTagName(tmpstr); > len = c_nodelist->getLength(); > std::cout << "LEN " << len << std::endl; > for (int i = 0 ; i < len ; i++) > { > c_node = c_nodelist->item(i); > const XMLCh* val = c_node->getNodeValue(); > char *test = XMLString::transcode(val); > std::cout <<"Val: " << > XMLString::transcode(val); > } > > > > } > > > > > > > > > > > > Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit > partout ! > Cr�ez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/ > > Dialoguez en direct avec vos amis gr�ce � Yahoo! Messenger > !T�l�chargez Yahoo! Messenger sur http://fr.messenger.yahoo.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
