New Class TXMLtoHash
Posted: Wed Aug 07, 2019 2:23 am
With all source and sample
Sample for fivewin, but class is pure harbour
Resumen:
Sample for fivewin, but class is pure harbour
Resumen:
https://bitbucket.org/fivetech/fivewin- ... tohash.zip/----------------------------------------------------------------------------//
// 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
//----------------------------------------------------------------------------//