Re: [xslt] Help with compiling libxslt on HP-UX



On Thu, Jul 17, 2003 at 08:33:29AM +0800, William M. Brack wrote:
> >   Hum, seems the best is to switch to function signature to:
> >
> > static int
> > xsltIsDigitZero(unsigned int ch)
> >
> >   Honnestly I'm a bit lost on why the function should work with an
> > xmlChar, seems it's testing against unicode values but it is used to
> > test subsequent bytes in an xmlChar UTF-8 string. Maybe from an XSLT
> > point of view only ASCII is allowed there but the IsDigitZero test
> > is defined in term of Unicode code point. If this is the case then
> > changing the signature should be fine. Since it's static it should
> > not affect compatibility.
> >
> > Daniel
> 
> I'm afraid I can't agree with this.  Although this change will
> certainly fix the compilation error, it isn't fixing the underlying
> problem - the function xsltIsDigitZero (#define'd to be
> IS_DIGIT_ZERO, and also used by the #define IS_DIGIT_ONE) is called
> from a couple of places in the subsequent code, and in each case the
> argument is an xmlChar (unsigned char).  If the underlying data is
> actually a multi-byte Unicode character (i.e. a codepoint '0' value
> other than 0x0030) only the first byte is evaluated, and the test
> will fail. In other words, the existing code (not just this
> function, but also the subsequent code which calls it) is not
> correct, and the HP compiler very kindly caught it for us.  I'll try
> to get it fixed properly, but first I need to compose some test data
> to show how it currently fails, and to prove that any enhancement I
> make fixes it.

  Hum, I agree with you if that part actually allows non-ascii characters,
I think there had been a couple of unicode support fixes already in that
portion of the code (i.e. the numbers module).

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard@redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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