Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2018-05

Libxml2 - How to get messages on Linux?

6 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Gabor Boros

Hi All,

I need to accomplish validate XML files with an XSD. Found libxml in packages and works as expected with Win32. But I have problem with messages on Linux 64bit. Got %s instead the real message text. I use the below code to get the messages. Any idea why not works with Linux64 bit?

var
   SL_Warning,SL_Error:TStringList;
procedure SchemaValidityWarningFunc(ctx: Pointer; const msg: PChar);
begin
   SL_Warning.Add(msg);
end;
procedure SchemaValidityErrorFunc(ctx: Pointer; const msg: PChar);
begin
   SL_Error.Add(msg);
end;

Gabor

Reply by email

Gabor Boros
to Gabor Boros

Same problem with Win64. So not Linux specific.

Gabor

2018. 05. 22. 10:06 keltezéssel, Gabor Boros írta:

Show quoted text 24 lines
Hi All, I need to accomplish validate XML files with an XSD. Found libxml in packages and works as expected with Win32. But I have problem with messages on Linux 64bit. Got %s instead the real message text. I use the below code to get the messages. Any idea why not works with Linux64 bit? var   SL_Warning,SL_Error:TStringList; procedure SchemaValidityWarningFunc(ctx: Pointer; const msg: PChar); begin   SL_Warning.Add(msg); end; procedure SchemaValidityErrorFunc(ctx: Pointer; const msg: PChar); begin   SL_Error.Add(msg); end; Gabor _______________________________________________ fpc-pascal maillist  -  http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

Michael Van Canneyt
to Gabor Boros
Gabor Boros wrote
Same problem with Win64. So not Linux specific.

Are these functions callbacks ? If so, is the calling convention correct ?

Michael.

Show quoted text 31 lines
Gabor 2018. 05. 22. 10:06 keltezéssel, Gabor Boros írta: > Hi All, > > I need to accomplish validate XML files with an XSD. Found libxml in > packages and works as expected with Win32. But I have problem with > messages on Linux 64bit. Got %s instead the real message text. I use the > below code to get the messages. Any idea why not works with Linux64 bit? > > var >   SL_Warning,SL_Error:TStringList; > > procedure SchemaValidityWarningFunc(ctx: Pointer; const msg: PChar); > begin >   SL_Warning.Add(msg); > end; > > procedure SchemaValidityErrorFunc(ctx: Pointer; const msg: PChar); > begin >   SL_Error.Add(msg); > end; > > Gabor > _______________________________________________ > fpc-pascal maillist  -  > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

Gabor Boros
to Michael Van Canneyt

2018. 05. 24. 9:37 keltezéssel, Michael Van Canneyt írta:

Are these functions callbacks ? If so, is the calling convention correct ?

I used xmlSchemaSetValidErrors and the documentation say "Set the error and warning callback informations". Tried with and without cdecl.

Meanwhile tried xmlSchemaSetValidStructuredErrors and that works with Win32, Win64 and Linux 64bit.

Is libxml package have a maintainer or is it a legacy/deprecated thing? I experienced some differences between the documentation of libxml2 and the "Interfaces for validating" section in xmlschemas.inc.

Gabor

Reply by email

Henry Vermaak
to Gabor Boros
Gabor Boros wrote 5 lines
2018. 05. 24. 9:37 keltezéssel, Michael Van Canneyt írta: >Are these functions callbacks ? If so, is the calling convention correct ? I used xmlSchemaSetValidErrors and the documentation say "Set the error and warning callback informations". Tried with and without cdecl.

These functions use varargs, so the calling convention is different:

https://www.freepascal.org/docs-html/ref/refsu87.html

I thought it only works with external code, though. Would be useful if the documentation mentioned anything.

Henry

Reply by email

Henry Vermaak
to Henry Vermaak
Henry Vermaak wrote
I thought it only works with external code, though. Would be useful if the documentation mentioned anything.

Sorry I can't read today, the documentation says external only so you are indeed out of luck it seems.

Henry

Reply by email