[glom] tests: dtd: Now passes.



commit 3e00a4fe5ddb5d03a6f9664d63c09069a7cbe266
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Nov 17 17:36:45 2009 +0100

    tests: dtd: Now passes.
    
    * glom/libglom/document/bakery/document_xml.cc: get_node_document():
    Added commented-out code to write the DOCTYPE declaration, if we ever
    want to specify the PUBLIC DTD idenitifier and URI in each document.
    Let's avoid that for now because we'd have to make sure that it's
    hosted properly.
    * tests/dtd/test_example_sqlite: Do not use --valid because that
    seems to always require a DTD in the document's DOCTYPE declaration.
    --dtdvalid seems to do the same thing already, but with the specified
    DTD.

 ChangeLog                                    |   14 ++++++++++++++
 glom/libglom/document/bakery/document_xml.cc |    7 +++++++
 tests/dtd/test_example_sqlite                |    2 +-
 3 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index dc2ccf8..44fa10d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 2009-11-17  Murray Cumming  <murrayc murrayc com>
 
+	tests: dtd: Now passes.
+
+	* glom/libglom/document/bakery/document_xml.cc: get_node_document():
+	Added commented-out code to write the DOCTYPE declaration, if we ever 
+	want to specify the PUBLIC DTD idenitifier and URI in each document.
+	Let's avoid that for now because we'd have to make sure that it's 	
+	hosted properly. 
+	* tests/dtd/test_example_sqlite: Do not use --valid because that 
+	seems to always require a DTD in the document's DOCTYPE declaration.
+	--dtdvalid seems to do the same thing already, but with the specified 
+	DTD.
+
+2009-11-17  Murray Cumming  <murrayc murrayc com>
+
 	* glom/glom_document.dtd: Mention the xmlns attribute because DTD 
 	validation doesn't know about XML namespaces.
 
diff --git a/glom/libglom/document/bakery/document_xml.cc b/glom/libglom/document/bakery/document_xml.cc
index 18bda02..cfd4579 100644
--- a/glom/libglom/document/bakery/document_xml.cc
+++ b/glom/libglom/document/bakery/document_xml.cc
@@ -237,6 +237,13 @@ xmlpp::Element* Document_XML::get_node_document()
   if(!m_pDOM_Document)
     m_pDOM_Document = m_DOM_Parser.get_document();
   
+  //Make sure that it has the DTD declaration:
+  //TODO: Put this in a better place, where it's more guaranteed to always be set?
+  //TODO: Add API to specify the PUBLIC URI, if the document should write this:
+  //SYSTEM (local) DTDs do not seem very useful.
+  //- means non-registered, which is commonly used.
+  //m_pDOM_Document->set_internal_subset(m_strRootNodeName, "-//glom/" + m_strDTD_Name, m_strDTD_Name);
+
   xmlpp::Element* nodeRoot = m_pDOM_Document->get_root_node();
   if(!nodeRoot)
   {
diff --git a/tests/dtd/test_example_sqlite b/tests/dtd/test_example_sqlite
index 8f7fa47..1a997b9 100755
--- a/tests/dtd/test_example_sqlite
+++ b/tests/dtd/test_example_sqlite
@@ -1,4 +1,4 @@
 #/bin/sh -e
 
-xmllint --valid --noout --dtdvalid ${srcdir}/glom/glom_document.dtd \
+xmllint --noout --dtdvalid ${srcdir}/glom/glom_document.dtd \
 ${srcdir}/examples/sqlite/test_sqlite_music/test_sqlite_music.glom



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]