Re: [Lazarus] XML and memory loss

2008-10-09 Thread Bart
On 10/9/08, Sergei Gorelkin <[EMAIL PROTECTED]> wrote: > > Bart wrote: > > > > Then how can I free those TDOMNodeList objects? I.o.w. how can I get > > access to them? > > > > You just put them into a variable and later call Free: > > var >Nodes: TDOMNodeList; > ... > Nodes := MyNode.ChildNodes

Re: [Lazarus] XML and memory loss

2008-10-09 Thread Sergei Gorelkin
Bart wrote: > > Then how can I free those TDOMNodeList objects? I.o.w. how can I get > access to them? > You just put them into a variable and later call Free: var Nodes: TDOMNodeList; ... Nodes := MyNode.ChildNodes; writeln(Nodes[0].NodeName); ... Nodes.Free > I tried that, and it wordk li

Re: [Lazarus] XML and memory loss

2008-10-09 Thread Bart
> > The memory leak is caused by using the ChildNodes property. Each time > you use it, a new TDOMNodeList object is created, which must be > eventually destroyed by calling Free. The FCL DOM implementation does > not offer automatic memory management here, unlike other implementations. Then how

Re: [Lazarus] XML and memory loss

2008-10-08 Thread Sergei Gorelkin
Jesus Reyes wrote: > > By the way, and taking the fact that xml files are stored always in utf-8 > encoding it's surprising that for example XMLConfig doesn't have a way to set > a value which is already utf-8 encoded. so, any change to add a methods that > take utf-8 encoded strings as argumen

Re: [Lazarus] XML and memory loss

2008-10-08 Thread Jesus Reyes
--- El mié 8-oct-08, Sergei Gorelkin <[EMAIL PROTECTED]> escribió: > De:: Sergei Gorelkin <[EMAIL PROTECTED]> > Asunto: Re: [Lazarus] XML and memory loss > A: "General mailing list" > Fecha: miércoles, 8 octubre, 2008, 10:49 am > Bart wrote: > >

Re: [Lazarus] XML and memory loss

2008-10-08 Thread Sergei Gorelkin
Bart wrote: ... > > This file is more or less as I excpected it to be (i would think it > would include the encoding="utf-8"). Currently changing the encoding is not supported, and files are always written in utf-8 encoding. According to the XML specs, files without encoding label are read as

[Lazarus] XML and memory loss

2008-10-08 Thread Bart
Hi all, I am totaly nes to this (XML), so I suppose i do something wrong. I took the example from the Wiki XML Tutorial, and the simplified it. (I use Lazarus svn revision 16824, with fpc 2.2.0 on Window ME) Here's my code to write an XML file: procedure TForm1.Button1Click(Sender: TObject); va

Re: [Lazarus] Xml

2008-10-07 Thread farcodev
Ok BIG thanks to all :)) yup Gustavo is right, with 2 elements the formating is ok. I'm sorry i haven't tried with 2 items, my knowledge with the use of xml is limited :x a bit better now haha. Thanks again a lot to all of you it's very cool ! Graeme Geldenhuys wrote: > On Tue, Oct 7, 2008 at

Re: [Lazarus] Xml

2008-10-07 Thread Graeme Geldenhuys
On Tue, Oct 7, 2008 at 10:23 PM, Michael Van Canneyt <[EMAIL PROTECTED]> wrote: >> I know whitespace is irrelevant in XML, but I always thought there was >> a "pretty format" option somewhere. FPCUnit's xml output is formatted >> pretty. So is Lazarus's .xml config files. What do they use then? >

Re: [Lazarus] Xml

2008-10-07 Thread Sergei Gorelkin
3 Load and Save) define such an option, but it isn't implemented yet. Both FCL and Lazarus XML writers try to pretty-format their output, but it isn't perfect. FCL writer used to write 'leaf' nodes (i.e. nodes without children) without indenting - this is what you see in the o

Re: [Lazarus] Xml

2008-10-07 Thread Gustavo Enrique Jimenez
2008/10/7 Graeme Geldenhuys <[EMAIL PROTECTED]>: > On Tue, Oct 7, 2008 at 9:28 PM, Michael Van Canneyt > <[EMAIL PROTECTED]> wrote: >> >> You cannot control the formatting. This is part of the XML specs, and is >> normal. >> Whitespace is irrelevant in XML, except for some special cases. > > I kno

Re: [Lazarus] Xml

2008-10-07 Thread Michael Van Canneyt
On Tue, 7 Oct 2008, Graeme Geldenhuys wrote: > On Tue, Oct 7, 2008 at 9:28 PM, Michael Van Canneyt > <[EMAIL PROTECTED]> wrote: > > > > You cannot control the formatting. This is part of the XML specs, and is > > normal. > > Whitespace is irrelevant in XML, except for some special cases. > > I

Re: [Lazarus] Xml

2008-10-07 Thread Graeme Geldenhuys
On Tue, Oct 7, 2008 at 9:28 PM, Michael Van Canneyt <[EMAIL PROTECTED]> wrote: > > You cannot control the formatting. This is part of the XML specs, and is > normal. > Whitespace is irrelevant in XML, except for some special cases. I know whitespace is irrelevant in XML, but I always thought ther

Re: [Lazarus] Xml

2008-10-07 Thread Graeme Geldenhuys
On Tue, Oct 7, 2008 at 6:52 PM, <[EMAIL PROTECTED]> wrote: > > the only problem is that the formating is not good :/ > here the result: > > > > > what i missed to have an xml file like that ? > > > > > > Ah, that's the "compact" format... I thought there was a property to toggle that, bu

Re: [Lazarus] Xml

2008-10-07 Thread Michael Van Canneyt
On Tue, 7 Oct 2008, [EMAIL PROTECTED] wrote: > i have a light problem with xml. > here my code: > > {.create the document} > CFWxmlFile:=TXMLDocument.Create; > {.create the root node of the configuration file} > CFWxmlRoot:=CFWxmlFile.CreateElement('configfile'); > CFWxmlFil

Re: [Lazarus] Xml

2008-10-07 Thread farcodev
i have a light problem with xml, here my code: {.create the document} CFWxmlFile:=TXMLDocument.Create; {.create the root node of the configuration file} CFWxmlRoot:=CFWxmlFile.CreateElement('configfile'); CFWxmlFile.AppendChild(CFWxmlRoot); {.create the config item "locale"

Re: [Lazarus] Xml

2008-10-07 Thread farcodev
i have a light problem with xml. here my code: {.create the document} CFWxmlFile:=TXMLDocument.Create; {.create the root node of the configuration file} CFWxmlRoot:=CFWxmlFile.CreateElement('configfile'); CFWxmlFile.AppendChild(CFWxmlRoot); {.create the config item "locale

Re: [Lazarus] Xml

2008-10-07 Thread farcodev
I begin to implement xml read/write on my game for all the data and config file, and the complete doc i found is here : http://wiki.lazarus.freepascal.org/XML_Tutorial wiki is your friend :) Graeme Geldenhuys wrote: > On Sun, Oct 5, 2008 at 8:50 PM, eak <[EMAIL PROTECTED]> wrote: >> how to use

Re: [Lazarus] Xml

2008-10-05 Thread Graeme Geldenhuys
On Sun, Oct 5, 2008 at 8:50 PM, eak <[EMAIL PROTECTED]> wrote: > > how to use xml with lazarus , i don't find document or i found it > complex document and i don't understand. The question is rather: "What do you want to do with XML?" Save application settings, export/import data etc... Regard

[Lazarus] Xml

2008-10-05 Thread eak
Hi, how to use xml with lazarus , i don't find document or i found it complex document and i don't understand. Thanks. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Re: [Lazarus] xml reader AV

2008-08-30 Thread Mattias Gaertner
On Sat, 30 Aug 2008 11:04:11 +0200 zeljko <[EMAIL PROTECTED]> wrote: > why is this so ? new bug ? A broken xml file. > TCodeHelpManager.GetFPDocFilenameForSource TLazPackage > TApplication.HandleException In (line 1501 pos 7): Expected > ">", found "<" > Stack trace: > $0828B532 TXMLREA

Re: [Lazarus] xml reader AV

2008-08-30 Thread ik
A broken XML file ? Ido On Sat, Aug 30, 2008 at 12:04 PM, zeljko <[EMAIL PROTECTED]> wrote: > why is this so ? new bug ? > > TCodeHelpManager.GetFPDocFilenameForSource TLazPackage > TApplication.HandleException In (line 1501 pos 7): Expected ">", > found "<" > Stack trace: > $0828B532 TXMLRE

[Lazarus] xml reader AV

2008-08-30 Thread zeljko
why is this so ? new bug ? TCodeHelpManager.GetFPDocFilenameForSource TLazPackage TApplication.HandleException In (line 1501 pos 7): Expected ">", found "<" Stack trace: $0828B532 TXMLREADER__RAISEEXC, line 277 of laz_xmlread.pas $0828B755 RAISESTRINGNOTFOUND, line 307 of laz_xmlread.