[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [5847] Show all schema diagnostics, not just the first (VS
From: |
Greg Chicares |
Subject: |
[lmi-commits] [5847] Show all schema diagnostics, not just the first (VS) |
Date: |
Fri, 22 Nov 2013 20:03:27 +0000 |
Revision: 5847
http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5847
Author: chicares
Date: 2013-11-22 20:03:26 +0000 (Fri, 22 Nov 2013)
Log Message:
-----------
Show all schema diagnostics, not just the first (VS)
Modified Paths:
--------------
lmi/trunk/ChangeLog
lmi/trunk/multiple_cell_document.cpp
lmi/trunk/single_cell_document.cpp
Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2013-11-21 14:17:28 UTC (rev 5846)
+++ lmi/trunk/ChangeLog 2013-11-22 20:03:26 UTC (rev 5847)
@@ -32980,13 +32980,13 @@
20131121T0002Z <address@hidden> [542]
xml_lmi.cpp
-Replace deprecated get_error_message(). See:
+Replace deprecated get_error_message() (VS). See:
http://lists.nongnu.org/archive/html/lmi/2013-05/msg00002.html
20131121T0004Z <address@hidden> [542]
xml_lmi.cpp
-Replace deprecated document(char const*). See:
+Replace deprecated document(char const*) (VS). See:
http://lists.nongnu.org/archive/html/lmi/2013-05/msg00002.html
20131121T1319Z <address@hidden> [542]
@@ -33001,3 +33001,11 @@
xmlwrapp-0.7.1.md5sums [new file]
Upgrade to xmlwrapp-0.7.1 .
+20131122T2003Z <address@hidden> [542]
+
+ multiple_cell_document.cpp
+ single_cell_document.cpp
+Show all schema diagnostics, not just the first (VS). See:
+ http://lists.nongnu.org/archive/html/lmi/2013-05/msg00002.html
+Identify problems this uncovers in old code.
+
Modified: lmi/trunk/multiple_cell_document.cpp
===================================================================
--- lmi/trunk/multiple_cell_document.cpp 2013-11-21 14:17:28 UTC (rev
5846)
+++ lmi/trunk/multiple_cell_document.cpp 2013-11-22 20:03:26 UTC (rev
5847)
@@ -418,7 +418,11 @@
{
try
{
- xsd_schema().validate(cell_sorter().apply(d));
+ xml::error_messages e;
+ if(!xsd_schema().validate(cell_sorter().apply(d), e))
+ {
+ throw xml::exception(e);
+ }
}
catch(...)
{
Modified: lmi/trunk/single_cell_document.cpp
===================================================================
--- lmi/trunk/single_cell_document.cpp 2013-11-21 14:17:28 UTC (rev 5846)
+++ lmi/trunk/single_cell_document.cpp 2013-11-22 20:03:26 UTC (rev 5847)
@@ -158,10 +158,22 @@
{
try
{
- xsd_schema().validate(cell_sorter().apply(d));
+ xml::error_messages e;
+ if(!xsd_schema().validate(cell_sorter().apply(d), e))
+ {
+ throw xml::exception(e);
+ }
}
catch(...)
{
+// Known shortcomings:
+// - Two separate messageboxes are displayed; one would be better.
+// - If the diagnostics are too lengthy, then they're truncated
+// when displayed. The messagebox is not scrollable--see:
+// http://lists.nongnu.org/archive/html/lmi/2009-05/msg00032.html
+// Rethrowing the exception has the same effect, because it's caught
+// by OnExceptionInMainLoop(), which (like report_exception()) calls
+// safely_show_message().
warning() << "Schema validation failed--diagnostics follow." <<
std::flush;
report_exception();
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [5847] Show all schema diagnostics, not just the first (VS),
Greg Chicares <=