* BUG: XSLT.Transform() does not crash anymore if the resulting document is empty.

git-svn-id: svn://localhost/gambas/trunk@4659 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Adrien Prokopowicz 2012-04-22 22:29:42 +00:00
parent 5839e98745
commit f897d771a6

View File

@ -86,7 +86,13 @@ BEGIN_METHOD(CXSLT_Transform,GB_OBJECT inputDoc;GB_OBJECT inputStyleSheet)
xmlDocDumpFormatMemoryEnc(xmlOutDoc ,&buffer, &size, "UTF-8", 1);
Document *outDoc = GBI::New<Document>("XmlDocument");
try{
outDoc->setContent(StringToWString(string((char*)(buffer),size)));
}
catch(HTMLParseException &e)
{
outDoc->setContent(L"<?xml version=\"1.0\"?><xml></xml>");
}
GB.ReturnObject(outDoc);