Article View: fr.comp.text.xml
Article #8935Xerces C
From: tony
Date: Wed, 18 Jul 2001 14:10
Date: Wed, 18 Jul 2001 14:10
36 lines
1745 bytes
1745 bytes
Salut,
Je souhaite creer un DOM_Document a partir d'une std::string, j'utilise
MemBufInputSource pour convertir ma chaine en quelque chose de lisible,
seulement quand je ne recupere aucun DOM_Document apres le parsing. Voic
i mon code :
try{
XMLPlatformUtils::Initialize();
}catch(const XMLException& toCatch){
//blabla
}
DOMParser *dp= new DOMParser();
dp->setDoNamespaces(true);
std::string m_answer("<bok:Config status=\"100\"/>");
MemBufInputSource ip( (const XMLByte*) m_answer.c_str(),
strlen(m_answer.c_str()),"config",false);
dp->parse(ip);
//le document ne semble pas etre recupere corectement ?
DOM_Document document = dp->getDocument();
DOM_Element e = (DOM_Element &) document.getDocumentElement();
DOMString ds = e.getAttribute("status");
std::string oops(ds.transcode());
..
Ciao
Tony
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Article poste via Voila News - http://www.news.voila.fr
Le : Wed Jul 18 16:10:50 2001 depuis l'IP : 159.50.96.225 [VIP 1152925]
Technical Details
Message-ID:
<9j45da$90s$1@news.x-echo.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!195.25.12.36!oleane.net!oleane!x-echo.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: FRENCH,ASCII-7-bit X-Google-Thread: 114f60,ac24313d544b2963 X-Google-Attributes: gid114f60,public X-Google-ArrivalTime: 2001-07-18 07:10:54 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!195.25.12.36!oleane.net!oleane!x-echo.com!not-for-mail From: tony <nospam@dummy.com> Newsgroups: fr.comp.text.xml Subject: Xerces C Date: 18 Jul 2001 14:10:50 GMT Organization: 159.50.96.225 via Pages News Lines: 36 Message-ID: <9j45da$90s$1@news.x-echo.com> NNTP-Posting-Host: news-front1-0-0.voila.fr X-Trace: news.x-echo.com 995465450 9244 195.101.94.106 (18 Jul 2001 14:10:50 GMT) X-Complaints-To: abuse@x-echo.com NNTP-Posting-Date: 18 Jul 2001 14:10:50 GMT