fix missing namespaces in SVG files
see https://forum.freecadweb.org/viewtopic.php?f=35&t=42955&start=10#p365470
This commit is contained in:
@@ -109,6 +109,11 @@
|
||||
#include "QGVPage.h"
|
||||
#include "MDIViewPage.h"
|
||||
|
||||
// used SVG namespaces
|
||||
#define CC_NS_URI "http://creativecommons.org/ns#"
|
||||
#define DC_NS_URI "http://purl.org/dc/elements/1.1/"
|
||||
#define RDF_NS_URI "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
|
||||
using namespace Gui;
|
||||
using namespace TechDraw;
|
||||
using namespace TechDrawGui;
|
||||
@@ -862,6 +867,15 @@ void QGVPage::postProcessXml(QTemporaryFile& temporaryFile, QString fileName, QS
|
||||
// Insert Freecad SVG namespace into namespace declarations
|
||||
exportDocElem.setAttribute(QString::fromUtf8("xmlns:freecad"),
|
||||
QString::fromUtf8(FREECAD_SVG_NS_URI));
|
||||
// Insert all namespaces used by TechDraw's page template SVGs
|
||||
exportDocElem.setAttribute(QString::fromUtf8("xmlns:svg"),
|
||||
QString::fromUtf8(SVG_NS_URI));
|
||||
exportDocElem.setAttribute(QString::fromUtf8("xmlns:cc"),
|
||||
QString::fromUtf8(CC_NS_URI));
|
||||
exportDocElem.setAttribute(QString::fromUtf8("xmlns:dc"),
|
||||
QString::fromUtf8(DC_NS_URI));
|
||||
exportDocElem.setAttribute(QString::fromUtf8("xmlns:rdf"),
|
||||
QString::fromUtf8(RDF_NS_URI));
|
||||
|
||||
// Create the root group which will host the drawing group and the template group
|
||||
QDomElement rootGroup = exportDoc.createElement(QString::fromUtf8("g"));
|
||||
|
||||
Reference in New Issue
Block a user