[fpc-pascal] XMLWrite looses data
Hi, I'm loading up a XSL file into a TXMLDocument using XMLRead. Up to this point everything seems to be ok, and I can query the DOMNodes without problem. If I then save that file out again, using XMLWrite, I noticed that some data is lost. :-/ I don't know if this is because the file is a XSL file? Though I thought XSL is exactly the same structure as XML - so didn't expect any problems. Anyway, here is a sample area in the XSL file that looses data. Before: 8-8-8-8-8 !-- Short Month Name -- xsl:template name=format-date-shortxsl:param name=date/ xsl:choose xsl:when test=string-length($date)=0/xsl:when xsl:otherwise xsl:variable name=month xsl:choose xsl:when test=substring($date,1,3)='Jan'01/xsl:when xsl:when test=substring($date,1,3)='Feb'02/xsl:when xsl:when test=substring($date,1,3)='Mar'03/xsl:when xsl:when test=substring($date,1,3)='Apr'04/xsl:when xsl:when test=substring($date,1,3)='May'05/xsl:when xsl:when test=substring($date,1,3)='Jun'06/xsl:when xsl:when test=substring($date,1,3)='Jul'07/xsl:when xsl:when test=substring($date,1,3)='Aug'08/xsl:when xsl:when test=substring($date,1,3)='Sep'09/xsl:when xsl:when test=substring($date,1,3)='Oct'10/xsl:when xsl:when test=substring($date,1,3)='Nov'11/xsl:when xsl:when test=substring($date,1,3)='Dec'12/xsl:when /xsl:choose /xsl:variable xsl:value-of select=substring($date,5,2)/#xa0;xsl:value-of select=$month/#xa0;xsl:value-of select=substring($date,8,4)/ /xsl:otherwise /xsl:choose /xsl:template 8-8-8-8-8 After the save: 8-8-8-8-8 !-- Short Month Name -- xsl:template name=format-date-short xsl:param name=date/ xsl:choose xsl:when test=string-length($date)=0/ xsl:otherwise xsl:variable name=month xsl:choose xsl:when test=substring($date,1,3)='Jan'01/xsl:when xsl:when test=substring($date,1,3)='Feb'02/xsl:when xsl:when test=substring($date,1,3)='Mar'03/xsl:when xsl:when test=substring($date,1,3)='Apr'04/xsl:when xsl:when test=substring($date,1,3)='May'05/xsl:when xsl:when test=substring($date,1,3)='Jun'06/xsl:when xsl:when test=substring($date,1,3)='Jul'07/xsl:when xsl:when test=substring($date,1,3)='Aug'08/xsl:when xsl:when test=substring($date,1,3)='Sep'09/xsl:when xsl:when test=substring($date,1,3)='Oct'10/xsl:when xsl:when test=substring($date,1,3)='Nov'11/xsl:when xsl:when test=substring($date,1,3)='Dec'12/xsl:when /xsl:choose /xsl:variable xsl:value-of select=substring($date,5,2)/ xsl:value-of select=$month/ xsl:value-of select=substring($date,8,4)/ /xsl:otherwise /xsl:choose /xsl:template 8-8-8-8-8 Note the two '#xa0;' escaped characters are lost near the end in the newly written file. I'm using FPC 2.6.2 under 64-bit FreeBSD, but will be compiling this application for Windows 32-bit and 64-bit tomorrow at work. Any idea what is causing this? A bug, because I'm using XSL or anything else maybe? The XSL file passed all validation tools I could throw at it. We currently use the full XSL file to populate and generate PDF documents, so I don't believe there is any validation/syntax issues. In case this is useful, the XSL file starts like this. 8-8-8-8-8 ?xml version=1.0 encoding=utf-8 ? xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; version=1.0 xsl:output method=html indent=yes / xsl:decimal-format name=noNaN decimal-separator=. grouping-separator=, NaN= / xsl:template match=/QUESTIONS ...snip... 8-8-8-8-8 Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Bug in enumerators 2.6.4
On 2014-03-22 22:34, hinsta...@yandex.ru wrote: What you do this for? Using override directive makes no sense in this case, so I suggest you just don't use it. If you don't use it, the descendant enumerator will still work like intended I Think override makes perfect sense in this case. I get to only implement the GetCurrent procedure once, the example is simplified but in my real-world application it does some additional structure checking, and in all derived classes i get to call the ancestor method but return an object of the type i need. If I could not override the code for GetCurrent the following forBar inBarList do Bar.Val2:=1; would not be able to know the Bar is a TBar, but would rather see Bar as a pointer (since in this case it inherits from TList). And all subsequent code would have to do some sort of typecasting. I hope that makes a little bit of sense... Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC 2.6.4 for GO32
Sorry for the late reply. This is indeed a packaging error. I managed to build a IDE containing GDB 7.4 library. Nevertheless, before changing the idedos.zip in dist/2.6.4/i386-go32v2/separate/ and the content of the files at dist/2.6.4/i386-go32v2/ level. I would like you, if possible to test this executable out and report if debugging is really functional (ideally on a true dos machine ) I was only able to test the resulting executable under windows XP. I uploaded the new binary as a compressed zip file named fpgdb.zip in dist/2.6.4/i386-go32v2/separate/. Note that this is a huge file (9Mb zipped, and 28Mb unzipped, which contains full debugging information of fp.exe itself, including for the libgdb.a library). It would be most helpful if you (or someone else) could test this IDE on bare Dos and report if debugging is functional. If this is the case, I will modify idedos.zip and the big zip files in dist/2.6.4/i386-go32v2/ directory. Thanks in advance and sorry for the error. Pierre Muller De : fpc-pascal-boun...@lists.freepascal.org [mailto:fpc-pascal-boun...@lists.freepascal.org] De la part de Lubomír Cabla Envoyé : lundi 17 mars 2014 20:54 À : FPC-Pascal users discussions Objet : [fpc-pascal] FPC 2.6.4 for GO32 Maybe I'm doing something wrong but in the IDE from FPC 2.6.4 for GO32 is GDB missing. Always I get No debugger support available. Thank you for your help. Lubomir Cabla ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] struct definition in C
On 03/23/2014 08:06 PM, Bernd Oppolzer wrote: I would like to add that bitfields in C are not at all portable; it is completely implementation dependant if they are allocated from right to left in the structure or the other way round etc.; I _found_ that in bitfield records, with high endian archs gcc starts with filling the high bits, while with low endian archs it starts with filling the lower bits in the basic type that is given. IMHO this in fact does make sense. I did not find a documentation about this and have no idea whether it is likely that other compilers work similar. -Michael ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Bug in enumerators 2.6.4
On 2014-03-22 17:33, Marco van de Voort wrote: In our previous episode, Torsten Bonde Christiansen said: The problem seem to be that the a descendant enumerator class overriding a virtual method cannot return a class which i only forward declared. If the TFoo and TBar classes are moved above the TBarListEnumerator the code compiles without any problem. Should I add this to the bugtracker? Yes. The code with Tfoo and TBar above also shouldn't not compile, at least not in Delphi mode. Should I report this as a bug where this construct is not allow at all (not just Delphi mode, bot all mode) or as a bug in regards to Delphi mode. Actually i would like to see this work, at least for objfpc, also with the construct where forward declared classes is possible. Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] struct definition in C
On 03/23/2014 08:44 PM, Jonas Maebe wrote: In part it's because no one has been able yet to come up with a natural way to specify them in Pascal. There was an interesting discussion on that in the mse forum (for the to-be-defined mselang). It might be worth looking there, as several viable arguments were exchanged and a decent syntax was suggested. -Michael ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] struct definition in C
On 03/23/2014 08:12 PM, Luca Olivetti wrote: but, as Jonas said, it't not guaranteed to work (in practice it works with win32/linux 32 and linux 64, though it could break with a different version of the compiler). Bye AFAIK: mostly dependent on endianess of the arch. -Michael ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Bug in enumerators 2.6.4
In our previous episode, Torsten Bonde Christiansen said: Should I add this to the bugtracker? Yes. The code with Tfoo and TBar above also shouldn't not compile, at least not in Delphi mode. Should I report this as a bug where this construct is not allow at all (not just Delphi mode, bot all mode) or as a bug in regards to Delphi mode. Report it as a bug that it is not allowed at all in the current situation, with the added note that Delphi doesn't allow it either. Actually i would like to see this work, at least for objfpc, also with the construct where forward declared classes is possible. That's a separate language enhancement request, read http://www.freepascal.org/faq.var#extensionselect ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Bug in enumerators 2.6.4
On 2014-03-24 10:38, Marco van de Voort wrote: In our previous episode, Torsten Bonde Christiansen said: Should I add this to the bugtracker? Yes. The code with Tfoo and TBar above also shouldn't not compile, at least not in Delphi mode. Should I report this as a bug where this construct is not allow at all (not just Delphi mode, bot all mode) or as a bug in regards to Delphi mode. Report it as a bug that it is not allowed at all in the current situation, with the added note that Delphi doesn't allow it either. Actually i would like to see this work, at least for objfpc, also with the construct where forward declared classes is possible. That's a separate language enhancement request, read http://www.freepascal.org/faq.var#extensionselect Since this is already possible in objfpc mode (at least partially) is it nessesary to mark it as a bug? I think of this as an undocumentet feature, which perhaps just needs testcases to ensure reliability. If you still consider it a bug I will spend some time trying to write a proposal as stated in the link you send previously. Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Bug in enumerators 2.6.4
In our previous episode, Torsten Bonde Christiansen said: the construct where forward declared classes is possible. That's a separate language enhancement request, read http://www.freepascal.org/faq.var#extensionselect Since this is already possible in objfpc mode (at least partially) is it nessesary to mark it as a bug? Yes. A case where a check is missing doesn't automatically mean a feature has been implemented where that check is not needed. Overriding methods with declarations that don't match the original is a big thing. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Bug in enumerators 2.6.4
On 2014-03-24 10:57, Marco van de Voort wrote: In our previous episode, Torsten Bonde Christiansen said: Yes. A case where a check is missing doesn't automatically mean a feature has been implemented where that check is not needed. Overriding methods with declarations that don't match the original is a big thing. Crap... this means I have to redo some of my code. ;) -Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TSQLQuery.ApplyUpdates problem with UTF-8
LacaK wrote: Dennis Poon wrote / napísal(a): I tried, the results are: @@character_set_client : utf8 @@character_set_connection : latin1 @@character_set_database : latin1 Dennis, do you received my reply?: IMO @@character_set_connection is wrong and must be utf8. I will try fix it, but first can you try as workaround this: - after connection is established can you use MySQLConnection1.ExecuteDirect('SET NAMES ''utf8'''); - and then check again @@character_set_client, @@character_set_connection (IMO both must be utf8 ... if they will be, then your program should work as expected ... can you test it again?) -Laco. I tried MYSQLConnection1.ExecuteDirect('SET NAMES ''utf8'';'); and recheck @@character_set_client: utf8 @@character_set_connection : utf8 @@character_set_database : latin1 So, it corrected one variable. This is okay now I re-ran my test but still ?? after applyUpdates. When I use your test program I receve same result as you describe. But when I add into procedure TForm1.FormCreate(Sender: TObject); begin MySQL55Connection1.ExecuteDirect('SET NAMES ''utf8'''); // -- ADDED SQLQuery1.Open; end; It works for me as expected ... so now I am confused with your results ... can you try again please your test application with added line ... (it will require patch for mysqlconnection in all cases, but before want have confirmed, that it helps) -Laco. Laco, My apology. My last attempt did not recreate a fresh database table for testing so it started with the ruined table values and thus did not give the correct result. Your Set Names command did the trick. Thanks a lot. By the way, why isn't a semicolon required at the end of SET NAMES 'utf8' command? I tried both with and without semicolon and neither raise an error. Dennis ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] XMLWrite looses data
On Sun, Mar 23, 2014 at 2:58 PM, Graeme Geldenhuys mailingli...@geldenhuys.co.uk wrote: I'm using FPC 2.6.2 under 64-bit FreeBSD, but will be compiling this application for Windows 32-bit and 64-bit tomorrow at work. If you can, try also the Laz2_ XML units: Laz2_Dom, Laz2_xmlwrite and read. They seem to work better with unicode or utf8 at least. Any idea what is causing this? A bug, because I'm using XSL or anything else maybe? No idea, but maybe changing some parser option can help. The Validating example shows how to change options: http://wiki.freepascal.org/XML_Tutorial#Validating_a_document ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] XMLWrite looses data
On Sun, 23 Mar 2014 17:58:16 + Graeme Geldenhuys mailingli...@geldenhuys.co.uk wrote: Hi, I'm loading up a XSL file into a TXMLDocument using XMLRead. Up to this point everything seems to be ok, and I can query the DOMNodes without problem. If I then save that file out again, using XMLWrite, I noticed that some data is lost. :-/ I don't know if this is because the file is a XSL file? Though I thought XSL is exactly the same structure as XML - so didn't expect any problems. Yes, XSL is XML. [...] Note the two '#xa0;' escaped characters are lost near the end in the newly written file. The parser converts #*; to Unicode characters when reading. AFAIR some xsl parsers like xsltproc do the same. If you want xslt to output '#xa0;' you can use 'amp;#xa0;' Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC 2.6.4 for GO32
No need to apologize, thank you and Tomas Hajny for your help. I made a fresh installation of FPC GO32V2 2.6.4 in pure DOS from Win98 SE/FAT32 with DOSLFN. (BTW, in package dos264full.zip is missing cwsdpmi.exe) For testing FP.EXE with GDB is used small test program: var x : word; begin x:=1; writeln('x=',x); end. 1. Compilation of test program Options - Compiler - Browser No browser - O.K. Only Global browser - error Local and global browser - error Only for selected option No browser is compilation O.K., otherwise I always get this error: z-test.pas(5,1) Fatal: Compilation aborted Error: Compiler exited Error: Range check error and then No debugger support available With selected option No browser is GDB available and it seems to be O.K. 2. Run new FP.EXE After first compilation at every start of new FP.EXE I get an error in Compiler messages: hugevall.c(0) Fatal: $009E53FB of hugevall.c Fatal: $20B5 I made some screenshots if you want to see. Thank you for your support. Lubomir Cabla On Mon, Mar 24, 2014 at 10:00 AM, Pierre Free Pascal pie...@freepascal.orgwrote: Sorry for the late reply. This is indeed a packaging error. I managed to build a IDE containing GDB 7.4 library. Nevertheless, before changing the idedos.zip in dist/2.6.4/i386-go32v2/separate/ and the content of the files at dist/2.6.4/i386-go32v2/ level. I would like you, if possible to test this executable out and report if debugging is really functional (ideally on a true dos machine...) I was only able to test the resulting executable under windows XP. I uploaded the new binary as a compressed zip file named fpgdb.zip in dist/2.6.4/i386-go32v2/separate/. Note that this is a huge file (9Mb zipped, and 28Mb unzipped, which contains full debugging information of fp.exe itself, including for the libgdb.a library). It would be most helpful if you (or someone else) could test this IDE on bare Dos and report if debugging is functional. If this is the case, I will modify idedos.zip and the big zip files in dist/2.6.4/i386-go32v2/ directory. Thanks in advance and sorry for the error. Pierre Muller *De :* fpc-pascal-boun...@lists.freepascal.org [mailto: fpc-pascal-boun...@lists.freepascal.org] *De la part de* Lubomír Cabla *Envoyé :* lundi 17 mars 2014 20:54 *À :* FPC-Pascal users discussions *Objet :* [fpc-pascal] FPC 2.6.4 for GO32 Maybe I'm doing something wrong but in the IDE from FPC 2.6.4 for GO32 is GDB missing. Always I get No debugger support available. Thank you for your help. Lubomir Cabla ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Free Pascal console programs on Android are easy
On 03/15/2014 07:33 PM, Paul Breneman wrote: ... My main specialty is communication software ( www.turbocontrol.com/APro.htm ), so right now that is what I'm working on. I have a USB hub working with a keyboard on my Nexus 7 (via OTG), but a FTDI USB-serial adapter doesn't show up in /dev so I hope to get that (and some other Bluetooth and TCP/IP stuff) working next. But a GUI Hello World would be nice! I did install the libc-dev package to compile a Synapse Synaser program so if anyone wants to try www.CtrlTerm.com that would be appreciated. My main (first) goal in this is to be able to run a single program (for machine control) on an inexpensive tablet. Maybe even with embedded Firebird (I have an Android tablet with an Intel CPU if that is needed). Well, maybe I can wait on doing more with Free Vision and use fpGUI instead! :) GNURoot has been updated! See this text: WheezyX rootfs type added - it has Xterms working. After launching it, use a vncviewer on your Android device or you PC to connect to it. Now I hope to get Control Terminal working (first for WiFi and Bluetooth, then with USB OTG for Ethernet and Serial)! http://turbocontrol.com/gnuroot.htm ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] [ANN] Travel Lazarus Brook | REST | JSON
[ANN] Travel Lazarus Brook | REST | JSON. Good afternoon, It is with great pleasure that I bring this news to you. Received from a friend: http://t2ti.com/erp2/modulos/lazarus/brook_rest_json.php For those who wanted a course in Brazilian Portuguese Brook, I believe this is an excellent opportunity. Soon I will contact the author of the course, because I was very much interested! Enjoy! -- Silvio Clécio My public projects - github.com/silvioprog ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC 2.6.4 for GO32
I was able to reproduce your problem, but not to fix it yet I hope I will find a fast fix. Sorry for the trouble, Pierre Muller De : fpc-pascal-boun...@lists.freepascal.org [mailto:fpc-pascal-boun...@lists.freepascal.org] De la part de Lubomír Cabla Envoyé : lundi 24 mars 2014 15:54 À : FPC-Pascal users discussions Objet : Re: [fpc-pascal] FPC 2.6.4 for GO32 No need to apologize, thank you and Tomas Hajny for your help. I made a fresh installation of FPC GO32V2 2.6.4 in pure DOS from Win98 SE/FAT32 with DOSLFN. (BTW, in package dos264full.zip is missing cwsdpmi.exe) For testing FP.EXE with GDB is used small test program: var x : word; begin x:=1; writeln('x=',x); end. 1. Compilation of test program Options - Compiler - Browser No browser - O.K. Only Global browser - error Local and global browser - error Only for selected option No browser is compilation O.K., otherwise I always get this error: z-test.pas(5,1) Fatal: Compilation aborted Error: Compiler exited Error: Range check error and then No debugger support available With selected option No browser is GDB available and it seems to be O.K. 2. Run new FP.EXE After first compilation at every start of new FP.EXE I get an error in Compiler messages: hugevall.c(0) Fatal: $009E53FB of hugevall.c Fatal: $20B5 I made some screenshots if you want to see. Thank you for your support. Lubomir Cabla On Mon, Mar 24, 2014 at 10:00 AM, Pierre Free Pascal pie...@freepascal.org wrote: Sorry for the late reply. This is indeed a packaging error. I managed to build a IDE containing GDB 7.4 library. Nevertheless, before changing the idedos.zip in dist/2.6.4/i386-go32v2/separate/ and the content of the files at dist/2.6.4/i386-go32v2/ level. I would like you, if possible to test this executable out and report if debugging is really functional (ideally on a true dos machine ) I was only able to test the resulting executable under windows XP. I uploaded the new binary as a compressed zip file named fpgdb.zip in dist/2.6.4/i386-go32v2/separate/. Note that this is a huge file (9Mb zipped, and 28Mb unzipped, which contains full debugging information of fp.exe itself, including for the libgdb.a library). It would be most helpful if you (or someone else) could test this IDE on bare Dos and report if debugging is functional. If this is the case, I will modify idedos.zip and the big zip files in dist/2.6.4/i386-go32v2/ directory. Thanks in advance and sorry for the error. Pierre Muller De : fpc-pascal-boun...@lists.freepascal.org [mailto:fpc-pascal-boun...@lists.freepascal.org] De la part de Lubomír Cabla Envoyé : lundi 17 mars 2014 20:54 À : FPC-Pascal users discussions Objet : [fpc-pascal] FPC 2.6.4 for GO32 Maybe I'm doing something wrong but in the IDE from FPC 2.6.4 for GO32 is GDB missing. Always I get No debugger support available. Thank you for your help. Lubomir Cabla ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Error compile library on Linux.
You recompiled the FPC? Or simple change of fpc.cfg options solves your problem? 2014-03-22 21:55 GMT-03:00 Fred van Stappen fi...@hotmail.com: Works fine for me if I compile everything with those parameters (and -trunk) I assume you compiled with the build.sh and then didn't clean up properly when you started adding parameters, thus leaving units compiled without the pic params. Hello. I have re-created a new fpc.cfg and now... it compiles and works perfectly in Linux 64 with fpc 2.6.2 and 2.7.1 ! Fantastique... Here, demo of fpGUI library with Python (Windows 32 and Linux 64) = All is working, (even Style Manager, onClick, form-state, etc,...). You only need to have Python installed. Run the Python script and see... = https://sites.google.com/site/biotray/fpGUIlib_py.zip PS : Many thanks to help and, once again, viva fpc ;-) PS2 : What a marvelous prove, with fpGUI library, that fpc is the Master. PS3 : Im very, very, very happy. Tetra thanks. Fred ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal -- The best regards, Fabio Luis Girardi PascalSCADA Project http://sourceforge.net/projects/pascalscada http://www.pascalscada.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] XMLWrite looses data
On 2014-03-24 13:58, Mattias Gaertner wrote: Yes, XSL is XML. Thought so - thanks for confirming. The parser converts #*; to Unicode characters when reading. AFAIR some xsl parsers like xsltproc do the same. If you want xslt to output '#xa0;' you can use 'amp;#xa0;' Thanks for that info, it helped find the problem (though no solution yet). Tha character isn't actully a unicode character, it is simply a no-break space character at position $A0 in the ASCII chart. Using hex value notation, instead of the more popular decimal notation when escaped. ===[ charmap details ] U+00A0 NO-BREAK SPACE UTF-8: 0xC2 0xA0 UTF-16: 0x00A0 C octal escaped UTF-8: \302\240 XML decimal entity: #160; = But I now see what happened. When I enabled show hidden characters like spaces and tabs in my editor, I noticed that the no-break space character is still there, but in the resaved output file it is simply not escaped any more. How is the fcl-xml package supposed to handle escaped characters which will form part of the data the XSL will generate? Is fcl-xml supposed to write them back as escaped characters, or as an normal un-escaped character? I tried using the decimal notation too: #160; And that produced the same result as the original. Note: When we process a XML file with our XSL file, we want he resulting output to have a no-break character - we don't what to display the text '#a0;' - which I think is what your suggestion with the amp; will produce. To put this in context, in case my original XSL snippet wasn't clear. That snippet generates a date string in the format 'dd MMM ' and the spaces between those elements are not normal spaces, but no-break spaces, so that whole text stays together (and wouldn't wordwrap in the middle). The current resaved XSL file still works, but not being able to physically see the no-break space characters could cause us problems months down the line when we re-edit those files. Hence the reason they were escaped (to make them clearly visible to the developer). Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] XMLWrite looses data
On Mon, 24 Mar 2014 20:12:50 + Graeme Geldenhuys mailingli...@geldenhuys.co.uk wrote: [...] The parser converts #*; to Unicode characters when reading. AFAIR some xsl parsers like xsltproc do the same. If you want xslt to output '#xa0;' you can use 'amp;#xa0;' Thanks for that info, it helped find the problem (though no solution yet). Tha character isn't actully a unicode character, it is simply a no-break space character at position $A0 in the ASCII chart. Well, I see, that the term character is confusing here. It is a Unicode codepoint. The #xa0; is just a xml alias. For xml it does not matter if you write it as code or encoded in UTF-8/UTF-16. Using hex value notation, instead of the more popular decimal notation when escaped. ===[ charmap details ] U+00A0 NO-BREAK SPACE UTF-8: 0xC2 0xA0 UTF-16: 0x00A0 C octal escaped UTF-8: \302\240 XML decimal entity: #160; = But I now see what happened. When I enabled show hidden characters like spaces and tabs in my editor, I noticed that the no-break space character is still there, but in the resaved output file it is simply not escaped any more. Yes. That's what I meant. How is the fcl-xml package supposed to handle escaped characters which will form part of the data the XSL will generate? Is fcl-xml supposed to write them back as escaped characters, or as an normal un-escaped character? XML writers can choose. Both forms are valid xml of the given text. I tried using the decimal notation too: #160; And that produced the same result as the original. Note: When we process a XML file with our XSL file, we want he resulting output to have a no-break character - we don't what to display the text '#a0;' - which I think is what your suggestion with the amp; will produce. To put this in context, in case my original XSL snippet wasn't clear. That snippet generates a date string in the format 'dd MMM ' and the spaces between those elements are not normal spaces, but no-break spaces, so that whole text stays together (and wouldn't wordwrap in the middle). The current resaved XSL file still works, but not being able to physically see the no-break space characters could cause us problems months down the line when we re-edit those files. Hence the reason they were escaped (to make them clearly visible to the developer). You can use comments. The current XML writer only escapes '', '', '', #0..#31. Maybe you want to extend it with an option or hook to escape more characters. For example all control characters. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal