FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index Utilities / Utilidades New Class TXMLtoHash
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
New Class TXMLtoHash
Posted: Wed Aug 07, 2019 02: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
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: New Class TXMLtoHash
Posted: Wed Aug 07, 2019 03:46 PM

Cristobal, gracias por tu dedicaci贸n.

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: New Class TXMLtoHash
Posted: Tue Aug 13, 2019 01: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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: New Class TXMLtoHash
Posted: Tue Aug 13, 2019 01:51 PM
Modify METHOD End() of Class

Code (fw): Select all Collapse
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
Posts: 65
Joined: Fri Feb 13, 2009 12:03 PM
Re: New Class TXMLtoHash
Posted: Sat Oct 05, 2019 06: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

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: New Class TXMLtoHash
Posted: 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

Continue the discussion