Page 2 of 2

Re: how XML extract tags, keys

Posted: Wed Dec 29, 2021 1:41 pm
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

Re: how XML extract tags, keys

Posted: Wed Dec 29, 2021 4:29 pm
by andyglezl
Gracias EDK, lo probaré.
*---------------------------------
Thanks EDK, I'll give it a try.




Grandioso !
Gracias !
*-------------------------
Great !
Thanks !

Re: how XML extract tags, keys

Posted: Thu Dec 30, 2021 12:05 pm
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

Re: how XML extract tags, keys

Posted: Sat Jan 01, 2022 4:11 pm
by serge_girard
Great !

Thanks a lot !!!