From b698d4bb75ccb397c553ae3be545801b92180c78 Mon Sep 17 00:00:00 2001 From: tetektoza Date: Sat, 27 Dec 2025 18:54:00 +0100 Subject: [PATCH] Gui: DOCTYPE and structure improvements Fix X3D standalone export (.x3d): - Use proper X3D 3.3 DOCTYPE instead of XHTML DOCTYPE - Remove problematic default namespace declaration - Use xsd:noNamespaceSchemaLocation for better parser compatibility - Remove invalid width/height attributes Fix XHTML/X3DOM export (.xhtml): - Wrap navigation buttons in
(required by XHTML Strict) - Keep X3D elements unprefixed for X3DOM compatibility - Add proper XHTML structure with XML declaration --- src/Gui/SoFCDB.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Gui/SoFCDB.cpp b/src/Gui/SoFCDB.cpp index 4144658330..afc3df6f55 100644 --- a/src/Gui/SoFCDB.cpp +++ b/src/Gui/SoFCDB.cpp @@ -655,12 +655,11 @@ void Gui::SoFCDB::writeX3DChild( void Gui::SoFCDB::writeX3D(SoVRMLGroup* node, bool exportViewpoints, std::ostream& out) { out << "\n"; - out << "\n"; - out << "\n"; + out << "\n"; + "xsd:noNamespaceSchemaLocation=\"http://www.web3d.org/specifications/x3d-3.3.xsd\">\n"; out << " \n" " \n" " \n" @@ -727,22 +726,23 @@ bool Gui::SoFCDB::writeToX3DOM(SoNode* node, std::string& buffer) x3d = x3d.erase(0, pos + 1); std::stringstream out; - out << "\n" - << "\n"; + out << "\n"; - out << "\n" + out << "\n" << " \n" - << " FreeCAD X3DOM Export\n" << " \n" - << " \n" - << " \n" + << " \n" << " \n" - << " \n"; + << " \n" + << "
\n"; auto onclick = [&out](const char* text) { - out << " \n"; }; @@ -754,7 +754,7 @@ bool Gui::SoFCDB::writeToX3DOM(SoNode* node, std::string& buffer) onclick("Top"); onclick("Bottom"); - out << x3d; + out << "
\n" << x3d; out << " \n" << "\n";