--- a/src/xslt.cpp
+++ b/src/xslt.cpp
@@ -21,6 +21,7 @@
 #include <libxslt/xsltutils.h>
 
 #include <QByteArray>
+#include <QCoreApplication>
 #include <QDir>
 #include <QFile>
 #include <QList>
@@ -143,7 +144,9 @@
         defaultEntityLoader = xmlGetExternalEntityLoader();
         xmlSetExternalEntityLoader(xsltprocExternalEntityLoader);
 
-        replaceURLList[QLatin1String("http://www.oasis-open.org/docbook/xml/4.5")] = QString("file:///%1").arg(DOCBOOK_XML_CURRDTD);
+        QDir dir(qApp->applicationDirPath());
+        dir.cd("../share/xml/docbook/xml-dtd-4.5");
+        replaceURLList[QLatin1String("http://www.oasis-open.org/docbook/xml/4.5")] = QString("file:///%1").arg(dir.absolutePath());
     }
 #endif
 
@@ -380,7 +383,9 @@
     QStringList result = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, fileName, option);
 
     // fallback to stuff installed with KDocTools
-    const QFileInfo fileInInstallDataDir(QStringLiteral(KDOCTOOLS_INSTALL_DATADIR_KF) + QStringLiteral("/kdoctools/") + file);
+    QDir dir(qApp->applicationDirPath());
+    dir.cd("../share/kf6");
+    const QFileInfo fileInInstallDataDir(dir.absolutePath() + QStringLiteral("/kdoctools/") + file);
     if (fileInInstallDataDir.exists()) {
         if ((option == QStandardPaths::LocateFile) && fileInInstallDataDir.isFile()) {
             result.append(fileInInstallDataDir.absoluteFilePath());
