about contrib xhb in hmg.3.0.36

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
jparada
Posts: 433
Joined: Fri Jan 23, 2009 5:18 pm

about contrib xhb in hmg.3.0.36

Post by jparada »

Hi,

With version hmg.3.0.36, I'm trying to use the TXMLDocument of contrib xhb, and does not work.

The question is whether this contrib was included in the version of hmg, and if that is not included, if possible inclusion?.

I appreciate any help.

Thank you very much.

Best Regards,
Javier
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: about contrib xhb in hmg.3.0.36

Post by l3whmg »

Hi Javier,
xhb it's a Harbour contrib library, not a Hmg contrib.
Rathinagiri download Harbour package and include it in Hmg distribution for our convenience ;)
I think if xhb don't work you/we must send a message to Harbour mailing list :idea:

Cheers
Luigi from Italy
www.L3W.it
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: about contrib xhb in hmg.3.0.36

Post by Rathinagiri »

Hi Javier,

Can you run the test programs in contrib directory?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
jparada
Posts: 433
Joined: Fri Jan 23, 2009 5:18 pm

Re: about contrib xhb in hmg.3.0.36

Post by jparada »

Hi Rathinagiri,

Thanks for answering,

I'm sorry, I have problems with my PC, and I can not perform any test at this time.

Thank you very much.

Best Regards,
Javier
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

about contrib xhb in hmg.3.0.36

Post by Pablo César »

Today I needed it, TXMLDocument of contrib xhb. And I have included xHB lib and it worked ok.

See my code example:

Code: Select all

// Compile with xHB

Function Main(cArquivo)
SetMode(25,80)
If cArquivo=NIL
   RetornaConteudoXml("Arqxml.xml")
Else
   RetornaConteudoXml(cArquivo)
Endif
Return

Function RetornaConteudoXml(cFileName)
LOCAL hFile, cXml
LOCAL xmlDoc, xmlIter , xmlNode, cNode, cAttrib, cValue, oCampo, oConteudo

if !file(cFileName)
   Alert("Arquivo "+cFileName+" nao encontrado !")
   Return nil
end
cNode := NIL
cAttrib := NIL
cValue := NIL
hFile := FOpen( cFileName )
xmlDoc := TXmlDocument():New( hFile )
IF xmlDoc:nStatus != 1
   Alert("erro ao ler XML ")
   Return Nil
ENDIF
xmlIter := TXmlIterator():New( xmlDoc:oRoot )
xmlNode := xmlIter:Find()
DO WHILE xmlNode != NIL
   if !empty(xmlNode:cData)
      if subs(xmlNode:cData,1,1) # "<"
         oCampo :=xmlNode:cName
         oConteudo:=xmlNode:cData
      endif
   else
      oCampo :=xmlNode:cName
	  oConteudo:=""
   endif
   
   alert( Padr("Campo...: "+oCampo,70)+";"+;
          Padr("Conteudo: "+oConteudo,70))
	  
   xmlNode := xmlIter:Next()                        // joga pro proximo campo
ENDDO
Return nil 
And this is XML file example (Arqxml.xml):

Code: Select all

<webservicecep>
<resultado>1</resultado>
<resultado_txt>sucesso - cep completo</resultado_txt>
<uf>RS</uf>
<cidade>Porto Alegre</cidade>
<bairro>Passo D'Areia</bairro>
<tipo_logradouro>Avenida</tipo_logradouro>
<logradouro>Assis Brasil</logradouro>
</webservicecep>
I hope to be usefull for someone alse.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Post Reply