[Lazarus] FCL DOM [vs] laz2_DOM, and more

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Lazarus] FCL DOM [vs] laz2_DOM, and more

Free Pascal - Lazarus mailing list
Hi,

Nowadays, we have full Unicode support in FPC.
So, my question is: The units bellow is still necessary to use XML
with Lazarus or we can use just the original provided by FCL?

laz2_DOM
laz2_XMLRead
laz2_XMLWrite
laz2_XMLCfg
laz2_XMLUtils
laz_XMLStreaming

See here http://wiki.lazarus.freepascal.org/XML_Tutorial

Best regards,
Marcos Douglas
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] FCL DOM [vs] laz2_DOM, and more

Free Pascal - Lazarus mailing list
On Sat, Jul 29, 2017 at 8:39 PM, Marcos Douglas B. Santos
<[hidden email]> wrote:
> Hi,
>
> Nowadays, we have full Unicode support in FPC.
> So, my question is: The units bellow...

below*


Marcos Douglas
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] FCL DOM [vs] laz2_DOM, and more

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list


On Sat, 29 Jul 2017, Marcos Douglas B. Santos via Lazarus wrote:

> Hi,
>
> Nowadays, we have full Unicode support in FPC.
> So, my question is: The units bellow is still necessary to use XML
> with Lazarus or we can use just the original provided by FCL?
>
> laz2_DOM
> laz2_XMLRead
> laz2_XMLWrite
> laz2_XMLCfg
> laz2_XMLUtils
> laz_XMLStreaming

The FPC units use UnicodeString (UTF16), the lazarus units use UTF8.
If the end result is used excluively in UTF8 strings, the lazarus version may be
faster as there will be less conversions.

Michael.
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] FCL DOM [vs] laz2_DOM, and more

Free Pascal - Lazarus mailing list
2017-07-30 10:00 GMT+02:00 Michael Van Canneyt via Lazarus
<[hidden email]>:

>
>
> On Sat, 29 Jul 2017, Marcos Douglas B. Santos via Lazarus wrote:
>
>> Hi,
>>
>> Nowadays, we have full Unicode support in FPC.
>> So, my question is: The units bellow is still necessary to use XML
>> with Lazarus or we can use just the original provided by FCL?
>>
>> laz2_DOM
>> laz2_XMLRead
>> laz2_XMLWrite
>> laz2_XMLCfg
>> laz2_XMLUtils
>> laz_XMLStreaming
>
>
> The FPC units use UnicodeString (UTF16), the lazarus units use UTF8.
> If the end result is used excluively in UTF8 strings, the lazarus version
> may be
> faster as there will be less conversions.
>

I wonder if we can move the UTF8-based XML units to FPC, to be
available in the main FPC distribution too? (Possibly renamed like
Utf8_XMLXxx or such, instead of LazX_XMLXxx.)

The reason I ask:

This requirement (wanting to have XML units based on AnsiStrings, not
WideStrings, because your data is almost always in UTF8 and you're
fine storing it in AnsiString ) is not really specific to Lazarus, or
applications build on top of Lazarus. E.g. in Castle Game Engine I
would prefer using UTF8-based XML units too, I often read UTF8 XML
files (like X3D, Collada 3D models). But I don't want the "core" CGE
to depend on LCL (this makes the process of building and testing
simpler -- you can use CGE components in Lazarus, but you can also use
CGE with our own minimalistic window management without Lazarus).

Regards,
Michalis
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] FCL DOM [vs] laz2_DOM, and more

Free Pascal - Lazarus mailing list


On Sun, 30 Jul 2017, Michalis Kamburelis via Lazarus wrote:

> 2017-07-30 10:00 GMT+02:00 Michael Van Canneyt via Lazarus
> <[hidden email]>:
>>
>>
>> On Sat, 29 Jul 2017, Marcos Douglas B. Santos via Lazarus wrote:
>>
>>> Hi,
>>>
>>> Nowadays, we have full Unicode support in FPC.
>>> So, my question is: The units bellow is still necessary to use XML
>>> with Lazarus or we can use just the original provided by FCL?
>>>
>>> laz2_DOM
>>> laz2_XMLRead
>>> laz2_XMLWrite
>>> laz2_XMLCfg
>>> laz2_XMLUtils
>>> laz_XMLStreaming
>>
>>
>> The FPC units use UnicodeString (UTF16), the lazarus units use UTF8.
>> If the end result is used excluively in UTF8 strings, the lazarus version
>> may be
>> faster as there will be less conversions.
>>
>
> I wonder if we can move the UTF8-based XML units to FPC, to be
> available in the main FPC distribution too? (Possibly renamed like
> Utf8_XMLXxx or such, instead of LazX_XMLXxx.)
>
> The reason I ask:
>
> This requirement (wanting to have XML units based on AnsiStrings, not
> WideStrings, because your data is almost always in UTF8 and you're
> fine storing it in AnsiString ) is not really specific to Lazarus, or
> applications build on top of Lazarus. E.g. in Castle Game Engine I
> would prefer using UTF8-based XML units too, I often read UTF8 XML
> files (like X3D, Collada 3D models). But I don't want the "core" CGE
> to depend on LCL (this makes the process of building and testing
> simpler -- you can use CGE components in Lazarus, but you can also use
> CGE with our own minimalistic window management without Lazarus).

That is up to the Lazarus people. If they are fine with that: no problem for
FPC.

I do think that it probably uses some utility functions/units which
then also need to be included in FPC. It also means there are 2 codebases.

An alternative approach would be to do what we do in other units as well,
use 1 codebase for 2 kinds of strings:

unit dom;

Type
   DOMString = UnicodeString;

{$DEFINE USEUNICODESTRING}
{$i DOMh.inc}

and

unit domutf8;

Type
   DOMString = UTF8String;

{$DEFINE USEUTF8STRING}
{$i DOMh.inc}


etc.

Combined with some macro magic, I think this should be doable too.

Michael.
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] FCL DOM [vs] laz2_DOM, and more

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Sun, Jul 30, 2017 at 5:00 AM, Michael Van Canneyt via Lazarus
<[hidden email]> wrote:
>
> The FPC units use UnicodeString (UTF16), the lazarus units use UTF8.
> If the end result is used excluively in UTF8 strings, the lazarus version
> may be
> faster as there will be less conversions.

Thank you.

Marcos Douglas
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] FCL DOM [vs] laz2_DOM, and more

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Sun, Jul 30, 2017 at 5:29 AM, Michalis Kamburelis via Lazarus
<[hidden email]> wrote:
>
> I wonder if we can move the UTF8-based XML units to FPC, to be
> available in the main FPC distribution too? (Possibly renamed like
> Utf8_XMLXxx or such, instead of LazX_XMLXxx.)

+1
However, a better name for the unit could be domutf8, using FPC naming pattern.

Regards,
Marcos Douglas
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] FCL DOM [vs] laz2_DOM, and more

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
Am 30.07.2017 um 10:29 schrieb Michalis Kamburelis via Lazarus:
> I often read UTF8 XML files (like X3D, Collada 3D models). But I don't
> want the "core" CGE to depend on LCL

The Lazarus xml procedures are in package LazUtils which is a
prerequisite for, but not part of, LCL. So, you can use these procedures
without adding a requirement for LCL, LazUtils is sufficient.
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] FCL DOM [vs] laz2_DOM, and more

Free Pascal - Lazarus mailing list
On Sun, Jul 30, 2017 at 6:06 PM, Werner Pamler via Lazarus
<[hidden email]> wrote:
> The Lazarus xml procedures are in package LazUtils which is a prerequisite
> for, but not part of, LCL. So, you can use these procedures without adding a
> requirement for LCL, LazUtils is sufficient.

Exactly. The earlier Lazarus Unicode support was specific to LCL which
apparently still creates confusion.
Now you can use LazUtils for a Lazarus project, or just copy 1 or 2
needed unit files from it to a non-Lazarus project.

Juha
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Loading...