lmi
[Top][All Lists]
Advanced

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

Re: [lmi] [PATCH] Fix XRC validation errors


From: Vadim Zeitlin
Subject: Re: [lmi] [PATCH] Fix XRC validation errors
Date: Fri, 17 Apr 2015 18:33:07 +0200

On Fri, 17 Apr 2015 15:33:27 +0000 Greg Chicares <address@hidden> wrote:

GC> On 2015-04-07 20:16, Vadim Zeitlin wrote:
GC> [...]
GC> >  Combining the instructions from the blog with the schema above, you 
should
GC> > be able to run
GC> > 
GC> >   java -jar jing.jar -C catalog.xml -c lmi_xrc_schema.rnc *.xrc
GC> > 
GC> > without any errors after applying the patch.
GC> 
GC> I still have many validation errors after applying this patch.

 Sorry, the above was true when I wrote it but ceased to be true later
because as part of my updates I've also added the invalid flags detection
to the XRC schema which simply hadn't been present in it before.

GC> Am I right in guessing that schema validation is intended to succeed only
GC> after applying the entire series of patches (one in the present email 
thread,
GC> and eight more in a later thread)?

 The validation would succeed with this patch only using the xrc_schema.rnc
from before the commit e44df8e12f367c7c0885488abe9eae9e358614ff which
happened on 2015-04-08 13:30:58Z. With the current version of the schema
from http://www.wxwidgets.org/wxxrc all the patches need to be applied.

GC> I tried running the schema in a separate directory where I've applied all
GC> the patches (and we've confirmed that the copy of that directory that I
GC> sent in private email matches your local tree). Everything validates except
GC> for these two errors:
GC> 
GC> C:\downloads\src\lmi\rounding_view.xrc:42:82: error: character content of 
element "flag" invalid; must be a string matching the regular expression 
"(wxGROW|wxEXPAND|wxALL|wxLEFT|wxRIGHT|wxTOP|wxBOTTOM|wxNORTH|wxSOUTH|wxEAST|wxWEST|wxSHAPED|wxSTRETCH_NOT|wxRESERVE_SPACE_EVEN_IF_HIDDEN)(
 *\| 
*(wxGROW|wxEXPAND|wxALL|wxLEFT|wxRIGHT|wxTOP|wxBOTTOM|wxNORTH|wxSOUTH|wxEAST|wxWEST|wxSHAPED|wxSTRETCH_NOT|wxRESERVE_SPACE_EVEN_IF_HIDDEN))*",
 must be a string matching the regular expression
GC> 
"(wxALIGN_CENTER|wxALIGN_CENTRE|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTRE_VERTICAL|wxALIGN_TOP|wxALIGN_BOTTOM|wxALL|wxLEFT|wxRIGHT|wxTOP|wxBOTTOM|wxNORTH|wxSOUTH|wxEAST|wxWEST|wxSHAPED|wxSTRETCH_NOT|wxRESERVE_SPACE_EVEN_IF_HIDDEN)(
 *\| 
*(wxALIGN_CENTER|wxALIGN_CENTRE|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTRE_VERTICAL|wxALIGN_TOP|wxALIGN_BOTTOM|wxALL|wxLEFT|wxRIGHT|wxTOP|wxBOTTOM|wxNORTH|wxSOUTH|wxEAST|wxWEST|wxSHAPED|wxSTRETCH_NOT|wxRESERVE_SPACE_EVEN_IF_HIDDEN))*"
 or must be equal to "*** Sizer flags
GC> excluding vertical alignment ones ***"
GC> C:\downloads\src\lmi\rounding_view.xrc:190:82: error: character content of 
element "flag" invalid; must be a string matching the regular expression 
"(wxGROW|wxEXPAND|wxALL|wxLEFT|wxRIGHT|wxTOP|wxBOTTOM|wxNORTH|wxSOUTH|wxEAST|wxWEST|wxSHAPED|wxSTRETCH_NOT|wxRESERVE_SPACE_EVEN_IF_HIDDEN)(
 *\| 
*(wxGROW|wxEXPAND|wxALL|wxLEFT|wxRIGHT|wxTOP|wxBOTTOM|wxNORTH|wxSOUTH|wxEAST|wxWEST|wxSHAPED|wxSTRETCH_NOT|wxRESERVE_SPACE_EVEN_IF_HIDDEN))*",
 must be a string matching the regular expression
GC> 
"(wxALIGN_CENTER|wxALIGN_CENTRE|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTRE_VERTICAL|wxALIGN_TOP|wxALIGN_BOTTOM|wxALL|wxLEFT|wxRIGHT|wxTOP|wxBOTTOM|wxNORTH|wxSOUTH|wxEAST|wxWEST|wxSHAPED|wxSTRETCH_NOT|wxRESERVE_SPACE_EVEN_IF_HIDDEN)(
 *\| 
*(wxALIGN_CENTER|wxALIGN_CENTRE|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTRE_VERTICAL|wxALIGN_TOP|wxALIGN_BOTTOM|wxALL|wxLEFT|wxRIGHT|wxTOP|wxBOTTOM|wxNORTH|wxSOUTH|wxEAST|wxWEST|wxSHAPED|wxSTRETCH_NOT|wxRESERVE_SPACE_EVEN_IF_HIDDEN))*"
 or must be equal to "*** Sizer flags
GC> excluding vertical alignment ones ***"
GC> 
GC> Do you see the same outcome?

 Yes, I do, and I have no idea how could I have missed this, sorry. The
flags are indeed wrong, and there is _another_ problem which I missed: the
last part of the error message, included in an attempt to make it more
clear what is going on, inverts "horizontal" and "vertical". The latter is
fixed in 
https://github.com/wxWidgets/wxWidgets/commit/86f94d431ed511283aebc3e7ef0bc65d47aa06cb
while the lmi problem is fixed by the following trivial change:

---------------------------------- >8 --------------------------------------
>From 92c7874f6e1e5a697644699ac60b48473aeb918a Mon Sep 17 00:00:00 2001
From: Vadim Zeitlin <address@hidden>
Date: Fri, 17 Apr 2015 18:30:04 +0200
Subject: [PATCH] Remove redundant wxALIGN_LEFT flags from horizontal
 wxBoxSizer.

Horizontal alignment flags don't make sense inside horizontal sizers and are
ignored at run-time, just remove them to fix XRC validation errors.
---
 rounding_view.xrc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rounding_view.xrc b/rounding_view.xrc
index 39bba29..08781d7 100644
--- a/rounding_view.xrc
+++ b/rounding_view.xrc
@@ -39,7 +39,7 @@
             <object class="wxBoxSizer">
                 <orient>wxHORIZONTAL</orient>
                 <object class="sizeritem">
-                    
<flag>wxALIGN_LEFT|wxALIGN_TOP|wxBOTTOM|wxLEFT|wxRIGHT</flag>
+                    <flag>wxALIGN_TOP|wxBOTTOM|wxLEFT|wxRIGHT</flag>
                     <border>6</border>
                     <object class="wxStaticBoxSizer">
                         <orient>wxVERTICAL</orient>
@@ -187,7 +187,7 @@
                     </object>
                 </object>
                 <object class="sizeritem">
-                    
<flag>wxALIGN_LEFT|wxALIGN_TOP|wxBOTTOM|wxLEFT|wxRIGHT</flag>
+                    <flag>wxALIGN_TOP|wxBOTTOM|wxLEFT|wxRIGHT</flag>
                     <border>6</border>
                     <object class="wxStaticBoxSizer">
                         <object class="sizeritem">
-- 
2.1.0

---------------------------------- >8 --------------------------------------

 Sorry once again for somehow missing it before,
VZ

reply via email to

[Prev in Thread] Current Thread [Next in Thread]