XML support

30 views
Skip to first unread message

xancorreu

unread,
May 9, 2012, 2:31:25 PM5/9/12
to alor...@googlegroups.com
Hi,

For my personal project (ditz clone) I want to store things in XML. I
see library reference and no xml library is present. Is there a
short-term planning for implementing that?

Thanks a lot for your support,
Xan.

Jukka Lehtosalo

unread,
May 10, 2012, 4:13:07 AM5/10/12
to alor...@googlegroups.com
On Wed, May 9, 2012 at 7:31 PM, xancorreu <xanc...@gmail.com> wrote:
> Hi,
>
> For my personal project (ditz clone) I want to store things in XML. I see
> library reference and no xml library is present. Is there a short-term
> planning for implementing that?

An XML parser is one of the top items on my personal library wish
list, but until now I haven't needed it in my own projects, so I have
focused on other things.

I have found that often it's actually very easy to write a parser for
a simple text-based file format using only things like regular
expressions and Str split, and the data files can be easier to read
and edit manually thank XML.

For example, instead of

<data>
<item>
<name>foo</name>
<size>3</size>
</item>
...
</data>

you could use something like this

name: foo
size: 3
--
...

Of course this is mostly valid for relatively simple data formats. XML
is a win if you have complex recursive data structures, for example.

Jukka

Xan xan

unread,
May 10, 2012, 5:22:32 AM5/10/12
to alor...@googlegroups.com


2012/5/10 Jukka Lehtosalo <jleht...@gmail.com>

On Wed, May 9, 2012 at 7:31 PM, xancorreu <xanc...@gmail.com> wrote:
> Hi,
>
> For my personal project (ditz clone) I want to store things in XML. I see
> library reference and no xml library is present. Is there a short-term
> planning for implementing that?

An XML parser is one of the top items on my personal library wish
list, but until now I haven't needed it in my own projects, so I have
focused on other things.

I have found that often it's actually very easy to write a parser for
a simple text-based file format using only things like regular
expressions and Str split, and the data files can be easier to read
and edit manually thank XML.


Can I use a C-API and import xml library in c or c++?
I want XML. There is good known about it and we have a bunch of tools for exporting or importing....

Xan.
 

For example, instead of

<data>
 <item>
   <name>foo</name>
   <size>3</size>
 </item>
 ...
</data>

you could use something like this

 name: foo
 size: 3
 --
 ...

Of course this is mostly valid for relatively simple data formats. XML
is a win if you have complex recursive data structures, for example.

Jukka

--
You received this message because you are subscribed to the Google Groups "Alore Language" group.
To post to this group, send email to alor...@googlegroups.com.
To unsubscribe from this group, send email to alorelang+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/alorelang?hl=en.


Jukka Lehtosalo

unread,
May 10, 2012, 6:14:00 AM5/10/12
to alor...@googlegroups.com
On Thu, May 10, 2012 at 10:22 AM, Xan xan <xanc...@gmail.com> wrote:
> Can I use a C-API and import xml library in c or c++?

Yes, writing a wrapper for expat (for example) using the C API would
be straightforward. The only potentially complex thing that I can see
is if you want to pass callbacks to a C/C++ lib that call Alore code.
Just ask about it if you have any questions; I'm happy to help.

> I want XML. There is good known about it and we have a bunch of tools for
> exporting or importing....

XML is useful but sometimes I feel it is a bit overused. ;-)

Jukka

xancorreu

unread,
May 10, 2012, 10:33:24 AM5/10/12
to alor...@googlegroups.com, Jukka Lehtosalo
Al 10/05/12 12:14, En/na Jukka Lehtosalo ha escrit:
> On Thu, May 10, 2012 at 10:22 AM, Xan xan<xanc...@gmail.com> wrote:
>> Can I use a C-API and import xml library in c or c++?
> Yes, writing a wrapper for expat (for example) using the C API would
> be straightforward. The only potentially complex thing that I can see
> is if you want to pass callbacks to a C/C++ lib that call Alore code.
> Just ask about it if you have any questions; I'm happy to help.


I'm thinking in TinyXML2. Do you know any good and tiny XML library in C
or C++?
Thanks for the offering. I will need much help.

I will try it. First I have to read this
http://www.alorelang.org/doc/capi.html



>
>> I want XML. There is good known about it and we have a bunch of tools for
>> exporting or importing....
> XML is useful but sometimes I feel it is a bit overused. ;-)

But it's standard de facto ;-)

Thanks,
Xan.
>
> Jukka
>

Reply all
Reply to author
Forward
0 new messages