David Bertoni wrote:
If you're using the XalanTransformer class, you can call XalanTransformer::setOmitMETATag(eOmitMETATagYes) to accomplish this. If you're using the command line executable, you can use the -m command line option.
I am using the XalanTransformer class, and when I call this function:
ptheXalanTransformer = new XalanTransformer(); ptheXalanTransformer->setOmitMETATag(XalanTransformer::eOmitMETATagYes); .... // Do the transform. if (NULL == ptheCompiledStylesheet || reloadXSL) { if (NULL != ptheCompiledStylesheet) ptheXalanTransformer->destroyStylesheet(ptheCompiledStylesheet); ptheXalanTransformer->setOmitMETATag(XalanTransformer::eOmitMETATagYes); theResult = ptheXalanTransformer->compileStylesheet(xsltsource, ptheCompiledStylesheet); if (0 != theResult) { cerr << "Error in file " << xsltsource << ": " << ptheXalanTransformer->getLastError() << endl; return theResult; } ptheXalanTransformer->setOmitMETATag(XalanTransformer::eOmitMETATagYes); } if (NULL != params) { for (map<string, string>::const_iterator it = params->begin(); it != params->end(); ++it) { ptheXalanTransformer->setStylesheetParam(it->first.c_str(), it->second.c_str()); } } if (NULL != mode && '\0' != *mode) { ptheXalanTransformer->setStylesheetParam("mode", mode); } ptheXalanTransformer->setOmitMETATag(XalanTransformer::eOmitMETATagYes); theResult = ptheXalanTransformer->transform(xmlsource, ptheCompiledStylesheet, target); if(theResult != 0) { cerr << "Error: " << ptheXalanTransformer->getLastError() << endl; } it also insert meta tag <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> in created html-document