I just commited the work needed to detect and handle sink states.
I changed error detection, the error is raised when doing the transition
to it immediately, and error information are now provided immediately
with the initial example xmllint --noout --schema errRep1.xsd errRep1_0.xml
we now get the following error informations:
Breakpoint 1, testerr (exec=0x98c8520) at xmlregexp.c:3302
3302 int nb = 5;
(gdb) n
3304 xmlRegExecErrInfo(exec, &string, &nb, &values[0], &terminal);
(gdb)
3305 }
(gdb) p string
$1 = (const xmlChar *) 0x98c9380 "x|http://FOO"
(gdb) p nb
$2 = 3
(gdb) p values[0]
$3 = (const xmlChar *) 0x98c6bd8 "b|http://FOO"
(gdb) p values[1]
$4 = (const xmlChar *) 0x98c6c48 "*|*"
(gdb) p values[2]
$5 = (const xmlChar *) 0x98c7038 "c|http://FOO"
(gdb) p terminal
$6 = 0
(gdb)
Note that since the transition though *|http://FOO goes to a sink
state it is not listed, but alternatively it could be still provided and
marked as such, for example by getting a nbneg int* parameter. All
negative transitions (i.e. going to a sink state) could then be added
after the nb ones in the values[] tab, and in that specific case it would
one would get:
nb = 3
nbneg = 1
values[0] = "b|http://FOO"
values[1] = "*|*"
values[2] = "c|http://FOO"
values[3] = "*|http://FOO"
I think such an API would allow complete analysis and report without
needing to provide extra implementation details or new strings in the
regexp format.