New Class TXMLtoHash

New Class TXMLtoHash

Postby cnavarro » Wed Aug 07, 2019 2:23 am

With all source and sample
Sample for fivewin, but class is pure harbour

Resumen:
/----------------------------------------------------------------------------//
// Author: Cristobal Navarro
// Date: November - 2018
// Use to Xml files / strings and convert to JSON-HASH
//----------------------------------------------------------------------------//

CLASS TXmlToHash

DATA oRoot
DATA hHash INIT { => }
DATA cXml INIT ""
DATA cXmlString INIT ""
DATA cValString INIT ""
DATA aPairsVals INIT {}
DATA lRepeat INIT .F.
DATA lDataNode INIT .F.

METHOD New( cFile, cXml, cElement, lRepeat ) CONSTRUCTOR
METHOD End()
METHOD AllValues( oXml )
METHOD HashToXml( hHash, cFileXml, cElement, lWrite )
METHOD JsonToXml( cFileJson, cJson, cFileXml )
METHOD NodeToHash( oNode, hHash )
METHOD XmlToHash( pRoot, cElement )
METHOD XmlToJson( cFileJson, lWrite )
METHOD GetAllAttributes( hElem )

ENDCLASS

//----------------------------------------------------------------------------//


https://bitbucket.org/fivetech/fivewin- ... tohash.zip
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: New Class TXMLtoHash

Postby hmpaquito » Wed Aug 07, 2019 3:46 pm

Cristobal, gracias por tu dedicación.
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: New Class TXMLtoHash

Postby cnavarro » Tue Aug 13, 2019 1:49 pm

hmpaquito wrote:Cristobal, gracias por tu dedicación.

Gracias

Other sample
viewtopic.php?f=3&t=37628#p224938
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: New Class TXMLtoHash

Postby cnavarro » Tue Aug 13, 2019 1:51 pm

Modify METHOD End() of Class

Code: Select all  Expand view


METHOD End() CLASS TXmlToHash
   if !Empty( ::oRoot )
      MxmlDelete( ::oRoot )
   endif
Return nil
 
 
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: New Class TXMLtoHash

Postby ryugarai27 » Sat Oct 05, 2019 6:52 am

Hi Cristobal,

I get the following errors when building the test file( xmltohash.prg ):

Error: Unresolved external '_HB_FUN_FW_SETJSONHUMAN' referenced from ....XMLTOHASH.OBJ
Error: Unresolved external '_HB_FUN_FE_XMLTOHASH' referenced from ....XMLTOHASH.OBJ

I am using bcc7 + fw1706 + xHB 1.2.3 Intl (Simplex) Build 20151110

are there any libraries I missed to include during linking?

Best regards,
ryu
User avatar
ryugarai27
 
Posts: 65
Joined: Fri Feb 13, 2009 12:03 pm
Location: Manila, Philippines

Re: New Class TXMLtoHash

Postby cnavarro » Sat Oct 05, 2019 12:35 pm

ryugarai27 wrote:Hi Cristobal,

I get the following errors when building the test file( xmltohash.prg ):

Error: Unresolved external '_HB_FUN_FW_SETJSONHUMAN' referenced from ....XMLTOHASH.OBJ
Error: Unresolved external '_HB_FUN_FE_XMLTOHASH' referenced from ....XMLTOHASH.OBJ

I am using bcc7 + fw1706 + xHB 1.2.3 Intl (Simplex) Build 20151110

are there any libraries I missed to include during linking?

Best regards,
ryu


Function FE_XMLTOHASH it is included in the class that accompanies the example in the .zip file that you have downloaded. The function FW_SETJSONHUMAN is from a more recent version of Fivewin: replace that function in the example and / or class code with .T.
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España


Return to Utilities / Utilidades

Who is online

Users browsing this forum: No registered users and 26 guests