how XML extract tags, keys

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

edk
Posts: 999
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: how XML extract tags, keys

Post by edk »

andyglezl wrote: Tue Dec 28, 2021 9:35 pm Hola EDK
Muchas gracias por tu aporte, le veo mucha utilidad.
He estado haciendo pruebas pero ya me perdí, y "necesito una una pequeña ayuda de mis amigos". :)
Los datos que están en Amarillo si los puedo obtener pero los que están en Azul no logro hacerlo.
Trate de hacerlo con el DO_CASE que genera tu ejemplo pero tampoco resultó.
Alguna idea ?
*-------------------------------------------------------------------------------------------------------------------------
Hi EDK
Thank you very much for your contribution, I see it very useful.
I've been doing tests but I'm lost, and "I need a little help from my friends." :)
I can get the data that are in Yellow but the ones that are in Blue I can't.
I tried to do it with the DO_CASE that your example generates but it didn't work either.
Any ideas ?


Pueden agrandar la imagen abriéndola en otra pestaña.
*---------------------------------------------------------------------
The image can be enlarged by opening it in another tab.

imagen_2021-12-28_150252.png


XMLDemo.zip
Improved version with a new feature: in order not to fill the RAM with the XML data table, I added a new function

Code: Select all

hb_XMLParser ( <cXmlString>, [<lOmitHeader>], <bCodeBlock> )
in which we can directly parsing data from cXmlString.

I have included an example of use below:
andyglezl.zip
(5.78 KiB) Downloaded 185 times
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: how XML extract tags, keys

Post by andyglezl »

Gracias EDK, lo probaré.
*---------------------------------
Thanks EDK, I'll give it a try.




Grandioso !
Gracias !
*-------------------------
Great !
Thanks !
Andrés González López
Desde Guadalajara, Jalisco. México.
edk
Posts: 999
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: how XML extract tags, keys

Post by edk »

Below is a prg code generator based on the loaded xml file structure.

I have completely replaced hb_XmlToArray in favor of hb_XMLParser. If someone would like to get an array with xml data, in the generator below I showed how to do it using hb_XMLParser.

You can use the generator to create just a Do Case sequence or an almost ready-to-use .prg code.
In a rather original way, I used resources to self-generate new .prg from source code. :mrgreen:
XmlToPrg.zip
(3.19 KiB) Downloaded 241 times
User avatar
serge_girard
Posts: 3420
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: how XML extract tags, keys

Post by serge_girard »

Great !

Thanks a lot !!!
There's nothing you can do that can't be done...
Post Reply