Having followed most of the discussions here for a while, I decided it
was time to try moving to Xerces from XML4C. Seemed pretty
straightforward, but I have the following queries:

ValidatingSAXParser and NonValidatingSAXParser don't exist any more, so
I've used SAXParser() to create a parser. Presumably this won't do any
validation, and I can experiment with passing the constructor a
validator when I get round to it. There's been lots of talk about
pluggable validators, and this seems like a good interface, so I hope
I'm on the right track.

At link time, I got "libxerces-c1_0.so: undefined reference to
`IconvTransService::IconvTransService(void)'" so hunted around for this
file. I switched into c/src/util/Transcoders/Iconv and did a make, but
gcc complained with

IconvTransService.cpp:126: ANSI C++ forbids comparison between pointer
and integer
IconvTransService.cpp:126: ANSI C++ forbids comparison between pointer
and integer

and again on line 150. I fixed this with (CVS output here)

--- diff begins ---
diff -u -r1.3 IconvTransService.cpp
--- IconvTransService.cpp       1999/11/20 00:28:19     1.3
+++ IconvTransService.cpp       1999/12/02 17:16:34
@@ -123,7 +123,7 @@
     const XMLCh* cptr1 = comp1;
     const XMLCh* cptr2 = comp2;
 
-    while ((*cptr1 != NULL) && (*cptr2 != NULL))
+    while ((*cptr1 != '\0') && (*cptr2 != '\0'))
     {
         wint_t  wch1 = towupper(*cptr1);
         wint_t  wch2 = towupper(*cptr2);
@@ -147,7 +147,7 @@
     const XMLCh* cptr2 = comp2;
 
     unsigned int  n = 0;
-    while ((*cptr1 != NULL) && (*cptr2 != NULL) && (n < maxChars))
+    while ((*cptr1 != '\0') && (*cptr2 != '\0') && (n < maxChars))
     {
         wint_t  wch1 = towupper(*cptr1);
         wint_t  wch2 = towupper(*cptr2);
--- diff ends ---

But it seems the sort of thing that would have been picked up by others
before now. There are some further warnings "warning: passing `const int
*' as argument 2 of `towctrans(unsigned int, const unsigned int *)'
changes signedness" too. I'm compiling on a Redhat 5.2(ish) box after
using the runConfigure script with "-p linux -c gcc -x g++ -t native".

This got me IconvTransService.o which I simply included in my final link
to get an executable. My utility seems to run fine like this, and passes
its test suite.

If anyone can give me feedback on whether any of the above is unusual,
or if I've missed a step in my compilation of Xerces, etc, I'd
appreciate it.

Cheers,
Mike.

-- 
Mike Mason, Software Engineer
XML Script Development Team                    Office: 44-1865-203192
http://www.xmlscript.org/                      Mobile: 44-7050-288923

Reply via email to