Necesito leer unas variables que me entregan en un fichero en formato XLM.
Existe alguna funci贸n para realizarlo.
Necesito leer unas variables que me entregan en un fichero en formato XLM.
Existe alguna funci贸n para realizarlo.
Un fichero XML lo puedes tratar como un fichero plano y abrirlo con Fopen.
Ej.:
cTexto=memoread( "FICHERO.XML" )
//
nHandle:=FOpen("FICHERO.XML", FO_READWRITE + FO_SHARED)
//
IF FERROR() !=0
TONE(500,2)
MsgInfo("Error de apertura del fichero "+cFichero)
ELSE
FSeek( nHandle, 0, FS_SET )
nPos=AT("<IDENTIFICADORPFISICA>",cTexto)
FSeek(nHandle,nPos+22)
FRead(nHandle,@cNif,9)
............................................
.......................................
#include "hbxml.ch"
聽 cXML := memoread( "tufichero.xml")
聽 聽oDoc := TXmlDocument():New( cXML )
聽 if oDoc:nStatus != HBXML_STATUS_OK
聽 聽 聽cResponse := "Error While Processing File: " + AllTrim( Str( oDoc:nLine ) ) + " # "+;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "Error: " + HB_XmlErrorDesc( oDoc:nError ) + " # " +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "Tag Error on tag: " + oDoc:oErrorNode:cName + " # " +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "Tag Begin on line: " + AllTrim( Str( oDoc:oErrorNode:nBeginLine ) )
聽 聽 RETURN cResponse
聽 endif
聽 oNode := oDoc:FindFirst( "NODE" )
聽 if oNode != NIL
聽 聽 ? 聽oNode:GetAttribute( "ra" ) 聽 // Devuelve jose
聽 endif
聽oDoc := NIL