On Tue, 29 Nov 2011 08:55:39 +0200
Graeme Geldenhuys <graemeg.li...@gmail.com> wrote:

> On 29/11/2011, Graeme Geldenhuys <graemeg.li...@gmail.com> wrote:
> > And to be clear, as a programmer, this is the API interface I would
> > expect to use... which I don't think is unreasonable. Obviously this
> > doesn't work, but hey, that's XML for you.
> >
> >     ReadXMLFile(VXML, ExtractFilePath(ParamStr(0)) + 'LazSolutionsDT.lpk');
> >     n := vxml.FindNode('/Config/Package/Version');
> >     n.Attributes.GetNamedItem('Major');
> >     n.Attributes.GetNamedItem('Minor');
> 
> 
> 
> PS:
> I'm very curious to know what the actual solution is though.

uses laz2_xmlcfg

  cfg:=TXMLConfig.Create('/path/to/package.lpk');
  writeln(cfg.GetValue('Package/Version/Major',''));
  writeln(cfg.GetValue('Package/Version/Minor',''));
  writeln(cfg.GetValue('Package/Version/Release',''));
  writeln(cfg.GetValue('Package/Version/Build',''));
  cfg.Free;


Mattias

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to