Discussion:
Parsing XML data
(too old to reply)
David J Taylor
2007-01-27 08:01:30 UTC
Permalink
Any recommendation for a simple XML parser? I've been playing with Open
XML:

http://www.philo.de/xml/

and while it works, it seems rather "over the top" for what I need: just
to extract a few value strings for specific keywords.

I'm using Delphi 5, so that may limit the choice a little!

Thanks,
David
Dean Hill
2007-01-27 09:44:56 UTC
Permalink
Post by David J Taylor
Any recommendation for a simple XML parser? I've been playing with
http://www.philo.de/xml/
just to extract a few value strings for specific keywords.
I'm using Delphi 5, so that may limit the choice a little!
NativeXml is really easy to use and very good

http://www.simdesign.nl/xml.html
David J Taylor
2007-01-27 11:09:59 UTC
Permalink
Post by Dean Hill
Post by David J Taylor
Any recommendation for a simple XML parser? I've been playing with
http://www.philo.de/xml/
just to extract a few value strings for specific keywords.
I'm using Delphi 5, so that may limit the choice a little!
NativeXml is really easy to use and very good
http://www.simdesign.nl/xml.html
Thanks, Dean. I'll take a look, although I had been thinking of a free
component. I recognise the author as a regular contributor here, so
perhaps he does deserve the business!

David
Nils Haeck
2007-01-27 20:55:02 UTC
Permalink
Post by David J Taylor
Thanks, Dean. I'll take a look, although I had been thinking of a free
component. I recognise the author as a regular contributor here, so
perhaps he does deserve the business!
David
Hi David,

I can't compete with free :)

However, if you email me, I'll give you the source file for comparison
reasons and if you like it and plan to use it commercially you can then
later on buy a license. My email can be found on the website.

Nils
www.simdesign.nl
OBones
2007-01-27 10:31:48 UTC
Permalink
Look in the JCL, there is the TJclSimpleXML class that allows reading
and writing XML files.
--
Olivier Sannier
JVCL Coordinator
http://jvcl.sf.net/

Find more about me on LinkedIn:
https://www.linkedin.com/in/obones
David J Taylor
2007-01-27 11:04:43 UTC
Permalink
Post by OBones
Look in the JCL, there is the TJclSimpleXML class that allows reading
and writing XML files.
Olivier,

Thanks for that.

Is there a single file I can download with those functions. In the past
(and it was some time ago), for another function I found that I has to
download masses of files, and then try and extract just the bit I wanted.
What I needed was so tied up in a spaghetti fashion with all the other
units I had to give up. This annoyed me, as I've supported JEDI since
almost day one!

Thanks,
David
Uffe Kousgaard
2007-01-27 11:39:41 UTC
Permalink
Post by David J Taylor
Is there a single file I can download with those functions. In the past
(and it was some time ago), for another function I found that I has to
download masses of files, and then try and extract just the bit I wanted.
You don't have to extract. Just add the relevant file to your project and
refer to the function.
Post by David J Taylor
What I needed was so tied up in a spaghetti fashion with all the other
units I had to give up.
If you had not given up, the relevant file would already have been on your
harddisk, ready to use.

Regards
Uffe Kousgaard
David J Taylor
2007-01-27 12:06:57 UTC
Permalink
"David J Taylor"
Post by David J Taylor
Is there a single file I can download with those functions. In the
past (and it was some time ago), for another function I found that I
has to download masses of files, and then try and extract just the
bit I wanted.
You don't have to extract. Just add the relevant file to your project
and refer to the function.
Post by David J Taylor
What I needed was so tied up in a spaghetti fashion with all the
other units I had to give up.
If you had not given up, the relevant file would already have been on
your harddisk, ready to use.
Regards
Uffe Kousgaard
Believe me - I tried! I ended up just cutting and pasting the few lines
of code I needed.

This was a few years back, and let's hope things are better now.

Thanks,
David
OBones
2007-01-27 11:46:34 UTC
Permalink
Take JclSimpleXML.pas from the latest JCL, you might need two or three
more files, but that should be all there is.
--
Olivier Sannier
JVCL Coordinator
http://jvcl.sf.net/

Find more about me on LinkedIn:
https://www.linkedin.com/in/obones
David J Taylor
2007-01-27 18:06:43 UTC
Permalink
Post by OBones
Take JclSimpleXML.pas from the latest JCL, you might need two or three
more files, but that should be all there is.
OK, I thought I would try that, and got a 20MB download with 9945 files,
but a compile of JclSimpleXml.pas failed at the second include file:

jcld5.inc (referred to in jedi.inc).

There is a file jvcld5.inc, but I presume that is something different?

Ideas?

Thanks,
David
OBones
2007-01-27 18:11:48 UTC
Permalink
Post by David J Taylor
There is a file jvcld5.inc, but I presume that is something different?
It is.
Post by David J Taylor
Ideas?
This file is generated by the installer, but I've pasted the default
contents below. The next build of the JCL should contain those files by
default.
Hope this helps
==============================================================

{**************************************************************************************************}
{
}
{ Project JEDI Code Library (JCL)
}
{
}
{ The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); }
{ you may not use this file except in compliance with the License. You
may obtain a copy of the }
{ License at http://www.mozilla.org/MPL/
}
{
}
{ Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF }
{ ANY KIND, either express or implied. See the License for the specific
language governing rights }
{ and limitations under the License.
}
{
}
{ The Original Code is jcl.inc
}
{
}
{ The Initial Developer of the Original Code is Marcel van Brakel.
}
{ Portions created by Marcel van Brakel are Copyright (C) Marcel van
Brakel. }
{
}
{ Contributors:
}
{ Marcel van Brakel
}
{ Matthias Thoma (mthoma)
}
{ Petr Vones
}
{ Robert Marquardt (marquardt)
}
{ Robert Rossmair (rrossmair)
}
{ Florent Ouchet (outchy)
}
{
}
{**************************************************************************************************}
{
}
{ This include file defines various JCL specific defines.
}
{ The more generic JCL defines are defined in jcl.inc and the generic
defines in the jedi.inc file }
{ which is shared with the JEDI VCL.
}
{
}
{**************************************************************************************************}
{
}
{ This file is filled by the JCL installer, all the changes made in its
content will be lost the }
{ next time the JCL is installed.
}
{
}
{**************************************************************************************************}

// $Id: jcl.template.inc 1772 2006-09-14 20:17:52Z outchy $

// Math precision selection, mutually exclusive
{$DEFINE MATH_EXTENDED_PRECISION}
{.$DEFINE MATH_DOUBLE_PRECISION}
{.$DEFINE MATH_SINGLE_PRECISION}


// Math functions takes care of infinites and NaN
{$DEFINE MATH_EXT_EXTREMEVALUES}


// JclHookExcept support for hooking exceptions from DLLs
{.$DEFINE HOOK_DLL_EXCEPTIONS}


//Threadsafe directive (added for DCL support)
{$DEFINE THREADSAFE}


// To exclude obsolete code from compilation, remove the point from the
line below
{$DEFINE DROP_OBSOLETE_CODE}


//Support for JclUnitVersioning.pas)
{$DEFINE UNITVERSIONING}

// debug sources
// defining these symbols will the debug source to be automatically
registered
{.$DEFINE DEBUG_NO_BINARY}
{.$DEFINE DEBUG_NO_TD32}
{.$DEFINE DEBUG_NO_MAP}
{.$DEFINE DEBUG_NO_EXPORTS}
{.$DEFINE DEBUG_NO_SYMBOLS}

// mark EDI units as weak package units (to avoid conflicts with the EDI
package)
{.$DEFINE EDI_WEAK_PACKAGE_UNITS}
--
Olivier Sannier
JVCL Coordinator
http://jvcl.sf.net/

Find more about me on LinkedIn:
https://www.linkedin.com/in/obones
David J Taylor
2007-01-28 06:57:02 UTC
Permalink
Post by OBones
Post by David J Taylor
There is a file jvcld5.inc, but I presume that is something
different?
It is.
Post by David J Taylor
Ideas?
This file is generated by the installer, but I've pasted the default
contents below. The next build of the JCL should contain those files
by default.
Hope this helps
[]
Thanks, Olivier. Yes, that did help, but simply to compile the file:

JclSimpleXml.pas

required 24 more files in addition:

crossplatform.inc
jcl.inc
Jcl8087.pas
JclBase.pas
JclConsole.pas
jcld5.inc
JclDateTime.pas
JclFileUtils.pas
JclIniFiles.pas
JclLogic.pas
JclMath.pas
JclRegistry.pas
JclResources.pas
JclSecurity.pas
JclShell.pas
JclStrings.pas
JclSysInfo.pas
JclSysUtils.pas
JclUnitVersioning.pas
JclWideStrings.pas
JclWin32.pas
jedi.inc
Snmp.pas
windowsonly.inc

which is just what found to be so unworkable about the JEDI Library all
those years ago. Whist I can see the need for string support, why would I
want SNMP support in an XML parser?

I accpet that if I blindly installed the whole library, I would not see
these issues, but in this case I would prefer to have all the support in a
much smaller number of files. The NativeXML solution, by comparison,
requires:

NativeXml.dcu
NativeXmlAppend.dcu
NativeXmlObjectStorage.dcu

Cheers,
David
OBones
2007-01-28 09:55:54 UTC
Permalink
Yes, but the JCL is an all in one library, it is not meant to be
installed in parts. NativeXML does only one thing, so of course it
requires less files.
--
Olivier Sannier
JVCL Coordinator
http://jvcl.sf.net/

Find more about me on LinkedIn:
https://www.linkedin.com/in/obones
David J Taylor
2007-01-28 10:25:45 UTC
Permalink
Post by OBones
Yes, but the JCL is an all in one library, it is not meant to be
installed in parts. NativeXML does only one thing, so of course it
requires less files.
Olivier,

OK, but it shows that your comment of "you might need two or three more
files, but that should be all there is" is not borne out in practice.

As one of the near founder members of the JEDI community, I strongly
support your aims, but it's a pity that the "take the lot" approach
doesn't suit my present way of working.

Thanks for taking the time to comment.

Cheers,
David
Angus Johnson
2007-01-28 12:34:29 UTC
Permalink
Post by David J Taylor
As one of the near founder members of the JEDI community, I strongly
support your aims, but it's a pity that the "take the lot" approach
doesn't suit my present way of working.
While I applaud the effort that's gone into Jedi, I suspect this "take the
lot" approach discourages many (including me) from using the Jedi libraries.
OBones
2007-01-28 13:55:53 UTC
Permalink
Post by Angus Johnson
Post by David J Taylor
As one of the near founder members of the JEDI community, I strongly
support your aims, but it's a pity that the "take the lot" approach
doesn't suit my present way of working.
While I applaud the effort that's gone into Jedi, I suspect this "take the
lot" approach discourages many (including me) from using the Jedi libraries.
Might well be yes.
But I know for a fact that once people have noticed they only need to
install (and maintain up to date) only one set of file from only one
source, it makes their life easier.
In the end, everyone is free to do as they will, but I sure prefer to
not have to look on 20 different websites for updates to the components
I use on a daily basis.
--
Olivier Sannier
JVCL Coordinator
http://jvcl.sf.net/

Find more about me on LinkedIn:
https://www.linkedin.com/in/obones
David J Taylor
2007-01-28 15:15:37 UTC
Permalink
OBones wrote:
[]
Post by OBones
In the end, everyone is free to do as they will, but I sure prefer to
not have to look on 20 different websites for updates to the
components I use on a daily basis.
Whilst I agree, I would be very concerned if, in my production software, I
was using components which /needed/ to updated on a daily basis! I have
Pascal source dating back to 1998 which is still working just fine in my
current software.

Cheers,
David
Uffe Kousgaard
2007-01-28 21:01:03 UTC
Permalink
Post by David J Taylor
[]
Post by OBones
components I use on a daily basis.
Whilst I agree, I would be very concerned if, in my production software, I
was using components which /needed/ to updated on a daily basis!
Using on a daily basis is not the same as updating on a daily basis.

Regards
Uffe Kousgaard
David J Taylor
2007-01-29 08:31:32 UTC
Permalink
"David J Taylor"
[]
Post by David J Taylor
Whilst I agree, I would be very concerned if, in my production
software, I was using components which /needed/ to updated on a
daily basis!
Using on a daily basis is not the same as updating on a daily basis.
Regards
Uffe Kousgaard
OK, I should have said "needed to check for updates on a daily basis", but
I hope you got my meaning.

In fact, putting everything into one big library only increases the
frequency of potential updates, again making me prefer the small units or
components dedicated to a single purpose.

Cheers,
David
Q Correll
2007-01-29 20:26:11 UTC
Permalink
OBones,

| But I know for a fact that once people have noticed they only need to
| install (and maintain up to date) only one set of file from only one
| source, it makes their life easier.

Without wanting to be argumentative, and please do not take personal
offense,... but I know for a fact that the above statement is NOT true
in my case. <sigh> I finally gave up on JCVL and JCL a couple of years
ago and removed it all from my Delphi environments. The flaky
performance, AV's, and stability issues that had plagued me for a long
while completely disappeared when I stopped using JCVL/JCL. I've not
looked back and have been refreshingly using other component packages
without seeing those types of problems. I don't have a clue what the
root problems were. And I didn't, and don't, have time to spend
debugging OPC's (Other People's Components). So I just moved on. I'm
hopeful that things have changed a bit over these past couple of years.
However, I, for one, won't be "(re)testing the waters" again.

I'm reminded of an old Burger King commercial with Rodney Allen Rippey:

"It's too bigga eat!"
--
Q <I'm much happier now ;->

01/29/2007 12:14:38

XanaNews Version 1.17.5.7 [Q's salutation mod]
OBones
2007-01-29 20:48:11 UTC
Permalink
I cannot argue that the very first versions of the JVCL were too big and
too clumsy.
The latest ones are much more solid and I encourage people to try them out.
And please let me clarify one thing:

The JCL is a code library, it does not need to be installed at all. It
provides numerous classes and functions that are of great help in a day
to day usage.

The JVCL is a component library, that uses the JCL. This is the one that
installs the components, and you can choose which of the 20 or so
packages to install.
--
Olivier Sannier
JVCL Coordinator
http://jvcl.sf.net/

Find more about me on LinkedIn:
https://www.linkedin.com/in/obones
Q Correll
2007-01-30 01:09:05 UTC
Permalink
OBones,

| The latest ones are much more solid and I encourage people to try
| them out.

It's good that improvements and progress are continuing. Perhaps
someday, when I've nothing much else to do, I'll D/L and play with them
again. <g>

| And please let me clarify one thing:

I did understand that.
--
Q

01/29/2007 17:06:43

XanaNews Version 1.17.5.7 [Q's salutation mod]
dk_sz
2007-01-29 15:30:57 UTC
Permalink
Post by Angus Johnson
While I applaud the effort that's gone into Jedi, I suspect this "take the
lot" approach discourages many (including me) from using the Jedi libraries.
I have my own reservations about JVCL, but JCL
quality is quite good and the JVCL/JCL installer works
very well. (And you can select which JVCL elements
you want, so really, you get the best from two worlds)
--
best regards
Thomas Schulz
http://www.micro-sys.dk/products/sitemap-generator/
http://www.micro-sys.dk/products/website-analyzer/
Nils Haeck
2007-01-28 10:54:44 UTC
Permalink
Hi David
Post by David J Taylor
much smaller number of files. The NativeXML solution, by comparison,
NativeXml.dcu
NativeXmlAppend.dcu
NativeXmlObjectStorage.dcu
If you just want to parse/write XML you just need NativeXml.pas. No need for
the other two, it is really a one-unit include :) #2 is only if you want to
add XML snippets to the end of a huge XML file, #3 is only used if you want
to automatically store TPersistent descendant's properties.

I wrote it that way on purpose, I also *hate* having to include a zillion
files for one simple task.

Nils Haeck (author of NativeXml)
www.simdesign.nl
David J Taylor
2007-01-28 11:22:42 UTC
Permalink
Post by Nils Haeck
Hi David
Post by David J Taylor
much smaller number of files. The NativeXML solution, by comparison,
NativeXml.dcu
NativeXmlAppend.dcu
NativeXmlObjectStorage.dcu
If you just want to parse/write XML you just need NativeXml.pas. No
need for the other two, it is really a one-unit include :) #2 is only
if you want to add XML snippets to the end of a huge XML file, #3 is
only used if you want to automatically store TPersistent descendant's
properties.
I wrote it that way on purpose, I also *hate* having to include a
zillion files for one simple task.
Nils Haeck (author of NativeXml)
www.simdesign.nl
It works as advertised, so this is the one I will be buying.
Customer support counts for a lot!

Thanks,
David
Nils Haeck
2007-01-28 20:34:10 UTC
Permalink
Thanks for your order, I saw it come in :)

Nils

"David J Taylor" <david-***@blueyonder.co.not-this-bit.nor-this-part.uk>
schreef in bericht
Post by David J Taylor
It works as advertised, so this is the one I will be buying.
Customer support counts for a lot!
Thanks,
David
Dean Hill
2007-01-28 17:28:28 UTC
Permalink
Post by David J Taylor
which is just what found to be so unworkable about the JEDI Library
all those years ago. Whist I can see the need for string support,
why would I want SNMP support in an XML parser?
For Xml I would definitely use NativeXml as I suggested earlier. That
said, the JCL is something that I cannot work without either. Not to
be confused with the JVCL which is a bit big for me at the moment. I
would suggest that you take a serious look at the JCL, between the
JclDebug, variety of experts and the massive amounts of Maths, Strings
and other routines, it's an invaluable resource.

Cheers

Dean
Nils Boedeker
2007-01-27 11:42:52 UTC
Permalink
Hi,

we use

http://www.destructor.de

to read an XML Document (Comming von Indesign) and store it in our webcms.

For us the best solution...

Nils
Post by David J Taylor
Any recommendation for a simple XML parser? I've been playing with Open
http://www.philo.de/xml/
and while it works, it seems rather "over the top" for what I need: just
to extract a few value strings for specific keywords.
I'm using Delphi 5, so that may limit the choice a little!
Thanks,
David
David J Taylor
2007-01-27 12:13:32 UTC
Permalink
Post by Nils Boedeker
Hi,
we use
http://www.destructor.de
to read an XML Document (Comming von Indesign) and store it in our webcms.
For us the best solution...
Nils
Thanks - lloks like there is a lot of stuff out there! This one I like
not only because its' free, but it is not cluttered with "write" code
(which I don't need).

David
Brian Moelk
2007-01-28 15:44:27 UTC
Permalink
Post by David J Taylor
Thanks - lloks like there is a lot of stuff out there! This one I like
not only because its' free, but it is not cluttered with "write" code
(which I don't need).
The problem with this one for me is its lack of unicode support.
--
Brian Moelk
Brain Endeavor LLC
***@NObrainSPAMendeavorFOR.MEcom
Brian Moelk
2007-01-28 00:49:46 UTC
Permalink
Post by David J Taylor
Any recommendation for a simple XML parser?
http://www.omnixml.com
--
Brian Moelk
Brain Endeavor LLC
***@NObrainSPAMendeavorFOR.MEcom
David J Taylor
2007-01-28 07:11:31 UTC
Permalink
Post by Brian Moelk
Post by David J Taylor
Any recommendation for a simple XML parser?
http://www.omnixml.com
Thanks for that, Brian.

The readme file suggests this needs the JEDI library, though. Does it?

Thanks,
David
Brian Moelk
2007-01-28 15:43:32 UTC
Permalink
Post by David J Taylor
The readme file suggests this needs the JEDI library, though. Does it?
I have the JCL installed, so I wouldn't know (IMO, the code library is
definitely worth having even if you don't install the JVCL components).

From what I can see, the readme file says that it requires the JEDI
Win32 API Library. These are simply the translated headers for the
Win32 API and IMO a good thing to have regardless.
--
Brian Moelk
Brain Endeavor LLC
***@NObrainSPAMendeavorFOR.MEcom
Kristofer Skaug
2007-01-30 14:40:12 UTC
Permalink
Post by David J Taylor
The readme file suggests this needs the JEDI library, though. Does it?
No, definitely not! Only for the "add-on" functions. I'm still using an
older version of OmniXML, but having taken a quick look at the latest
release, the only required files for basic XML parsing (and generation)
should be:

OmniXML.pas, which depends on the following units (in OmniXML library):
OmniXML_LookupTables, OmniXMLXPath;
GpTextStream, GpStreamWrapper

There is also a OmniXML_JEDI.inc file, but this is just to acknowledge that
he
nicked it from JCL (has convenient Delphi-version defines).

I selected this library exactly (out of many candidates) because of its
relative "light weight", simplicity of use, and lack of external
dependencies.
--
Kristofer
David J Taylor
2007-01-30 15:23:25 UTC
Permalink
Post by Kristofer Skaug
Post by David J Taylor
The readme file suggests this needs the JEDI library, though. Does it?
No, definitely not! Only for the "add-on" functions. I'm still using
an older version of OmniXML, but having taken a quick look at the
latest release, the only required files for basic XML parsing (and
[]
Post by Kristofer Skaug
I selected this library exactly (out of many candidates) because of
its relative "light weight", simplicity of use, and lack of external
dependencies.
Thanks, Kristofer. I went with NativeXML in the end.

Cheers,
David

Continue reading on narkive:
Loading...