FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Visor de XML
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Visor de XML
Posted: Wed Feb 27, 2013 03:49 PM
Ahora que hemos publicado una forma simple de analizar un fichero XML, ahora podemos implementarle un visor GUI:

viewtopic.php?f=3&t=25741

xmltree.prg
Code (fw): Select all Collapse
#include "FiveWin.ch"
#include "Splitter.ch"

static oSplit1, oSplit2, oLbxDatas, oLbxMethods 

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

function Main()

聽 聽local oWnd

聽 聽DEFINE WINDOW oWnd TITLE "XML viewer" ;
聽 聽 聽 MENU BuildMenu()

聽 聽ACTIVATE WINDOW oWnd ;
聽 聽 聽 ON INIT BuildTree( oWnd ) ;
聽 聽 聽 ON RESIZE ( If( oSplit1 != nil, oSplit1:AdjLeft(),),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 If( oSplit2 != nil, oSplit2:AdjRight(),) )

return nil

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

function BuildMenu()

聽 聽local oMenu

聽 聽MENU oMenu
聽 聽 聽 MENUITEM "About" ACTION MsgAbout( "XML Viewer", "FiveTech Software" )
聽 聽ENDMENU

return oMenu

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

function BuildTree( oWnd )

聽 聽local oTree := TTreeView():New( 0, 0, oWnd ) 
聽 聽local oClass, cData, cMethod
聽 聽local hFile, oXmlDoc, oXmlIter, oTagActual
聽 聽local oTagLast, aRoots := {}

聽 聽oTree:nWidth = 180
聽 聽// oTree:SetImageList( oImageList )

聽 聽oTree:Expand()

聽 聽@ 0, 186 LISTBOX oLbxDatas VAR cData ITEMS { "one", "two", "three" } ;
聽 聽 聽 SIZE 200, 200 PIXEL OF oWnd

聽 聽@ 0, 391 LISTBOX oLbxMethods VAR cMethod ITEMS { "one", "two", "three" } ;
聽 聽 聽 SIZE 200, 200 PIXEL OF oWnd

聽 聽@ 0, 181 SPLITTER oSplit1 ;
聽 聽 聽 VERTICAL ;
聽 聽 聽 PREVIOUS CONTROLS oTree ; 
聽 聽 聽 HINDS CONTROLS oLbxDatas ;
聽 聽 聽 LEFT MARGIN 150 ; 聽
聽 聽 聽 RIGHT MARGIN oSplit2:nLast + 100 ;
聽 聽 聽 SIZE 4, 300 聽PIXEL ;
聽 聽 聽 OF oWnd STYLE

聽 聽@ 0, 386 SPLITTER oSplit2 ;
聽 聽 聽 VERTICAL ;
聽 聽 聽 PREVIOUS CONTROLS oLbxDatas ;
聽 聽 聽 HINDS CONTROLS oLbxMethods ;
聽 聽 聽 LEFT MARGIN oSplit1:nFirst + 120 ;
聽 聽 聽 RIGHT MARGIN 80 ;
聽 聽 聽 SIZE 4, 300 PIXEL ;
聽 聽 聽 OF oWnd STYLE

聽 聽hFile 聽 聽= FOpen( "test.xml" ) 
聽 聽oXmlDoc 聽= TXmlDocument():New( hFile )
聽 聽oXmlIter = TXmlIterator():New( oXmlDoc:oRoot )

聽 聽AAdd( aRoots, oTree )

聽 聽while ( oTagActual := oXmlIter:Next() ) != nil
聽 聽 聽 // aRoots[ oTagActual:Depth() ]:Add( oTagActual:cName ) 
聽 聽 聽 // oRoot:Add( oTagActual:cName )
聽 聽 聽 if oTagLast != nil
聽 聽 聽 聽 聽if oTagLast:Depth() < oTagActual:Depth()
聽 聽 聽 聽 聽 聽 ASize( aRoots, Len( aRoots ) + 1 )
聽 聽 聽 聽 聽 聽 aRoots[ oTagActual:Depth() ] = aRoots[ oTagActual:Depth() - 1 ]:Add( oTagActual:cName ) 
聽 聽 聽 聽 聽 聽 // MsgInfo( oTagActual:cName + ", " + "open node", oTagActual:Depth() ) 
聽 聽 聽 聽 聽endif
聽 聽 聽 聽 聽if oTagLast:Depth() > oTagActual:Depth()
聽 聽 聽 聽 聽 聽 aRoots[ oTagActual:Depth() - 1 ]:Add( oTagActual:cName )
聽 聽 聽 聽 聽 聽 // MsgInfo( oTagActual:cName + ", " + "close node", oTagActual:Depth() ) 
聽 聽 聽 聽 聽endif
聽 聽 聽 聽 聽if oTagLast:Depth() == oTagActual:Depth()
聽 聽 聽 聽 聽 聽 aRoots[ Max( oTagLast:Depth() - 1, 1 ) ]:Add( oTagActual:cName )
聽 聽 聽 聽 聽 聽 // MsgInfo( oTagActual:cName + ", " + "keeps node", oTagActual:Depth() ) 
聽 聽 聽 聽 聽endif
聽 聽 聽 else
聽 聽 聽 聽 聽AAdd( aRoots, oTree:Add( oTagActual:cName ) )
聽 聽 聽 聽 聽// MsgInfo( oTagActual:cName + ", " + "starts", oTagActual:Depth() ) 聽 
聽 聽 聽 endif
聽 聽 聽 oTagLast = oTagActual
聽 聽end 聽 
聽 
聽 聽// HEval( oTagActual:aAttributes, { | cKey, cValue | MsgInfo( cKey, cValue ) } )

聽 聽FClose( hFile )

聽 聽// oTree:bChanged = { || ShowClassInfo( oTree ) }

return nil

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




test.xml
Code (fw): Select all Collapse
<xml>
<one>
<name>FiveWin</name>
<company>FiveTech Software</company>
</one>
<two attribute1="att1" attribute2="att2">
</two>
<three>
</three>
</xml>
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 205
Joined: Fri Oct 07, 2005 05:07 PM
Re: Visor de XML
Posted: Wed Feb 27, 2013 10:02 PM
Buenas,
Creo que asi queda mejor la estructura

Code (fw): Select all Collapse
#include "FiveWin.ch"
#include "Splitter.ch"

static oSplit1, oSplit2, oLbxDatas, oLbxMethods

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

function Test()

聽 聽local oWnd

聽 聽DEFINE WINDOW oWnd TITLE "XML viewer" ;
聽 聽 聽 MENU BuildMenu()

聽 聽ACTIVATE WINDOW oWnd ;
聽 聽 聽 ON INIT BuildTree( oWnd ) ;
聽 聽 聽 ON RESIZE ( If( oSplit1 != nil, oSplit1:AdjLeft(),),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 If( oSplit2 != nil, oSplit2:AdjRight(),) )

return nil

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


function BuildMenu()

聽 聽local oMenu

聽 聽MENU oMenu
聽 聽 聽 MENUITEM "About" ACTION MsgAbout( "XML Viewer", "FiveTech Software" )
聽 聽ENDMENU

return oMenu

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


function BuildTree( oWnd )

聽 聽local oTree := TTreeView():New( 0, 0, oWnd )
聽 聽local oClass, cData, cMethod
聽 聽local hFile, oXmlDoc, oXmlIter, oTagActual
聽 聽local oTagLast, aRoots := {}

聽 聽oTree:nWidth = 180
聽 聽// oTree:SetImageList( oImageList )

聽 聽oTree:Expand()

聽 聽@ 0, 186 LISTBOX oLbxDatas VAR cData ITEMS { "one", "two", "three" } ;
聽 聽 聽 SIZE 200, 200 PIXEL OF oWnd

聽 聽@ 0, 391 LISTBOX oLbxMethods VAR cMethod ITEMS { "one", "two", "three" } ;
聽 聽 聽 SIZE 200, 200 PIXEL OF oWnd

聽 聽@ 0, 181 SPLITTER oSplit1 ;
聽 聽 聽 VERTICAL ;
聽 聽 聽 PREVIOUS CONTROLS oTree ;
聽 聽 聽 HINDS CONTROLS oLbxDatas ;
聽 聽 聽 LEFT MARGIN 150 ;
聽 聽 聽 RIGHT MARGIN oSplit2:nLast + 100 ;
聽 聽 聽 SIZE 4, 300 聽PIXEL ;
聽 聽 聽 OF oWnd STYLE

聽 聽@ 0, 386 SPLITTER oSplit2 ;
聽 聽 聽 VERTICAL ;
聽 聽 聽 PREVIOUS CONTROLS oLbxDatas ;
聽 聽 聽 HINDS CONTROLS oLbxMethods ;
聽 聽 聽 LEFT MARGIN oSplit1:nFirst + 120 ;
聽 聽 聽 RIGHT MARGIN 80 ;
聽 聽 聽 SIZE 4, 300 PIXEL ;
聽 聽 聽 OF oWnd STYLE

聽 聽hFile 聽 聽= FOpen( "test.xml" )
聽 聽oXmlDoc 聽= TXmlDocument():New( hFile )
聽 聽oXmlIter = TXmlIterator():New( oXmlDoc:oRoot )

聽 聽AAdd( aRoots, oTree )

聽 聽while ( oTagActual := oXmlIter:Next() ) != nil
聽 聽 聽 // aRoots[ oTagActual:Depth() ]:Add( oTagActual:cName )
聽 聽 聽 // oRoot:Add( oTagActual:cName )
聽 聽 聽 if oTagLast != nil
聽 聽 聽 聽 聽if oTagLast:Depth() < oTagActual:Depth()
聽 聽 聽 聽 聽 聽 ASize( aRoots, Len( aRoots ) + 1 )
聽 聽 聽 聽 聽 聽 aRoots[ oTagActual:Depth() + 1 ] = aRoots[ oTagActual:Depth() ]:Add( oTagActual:cName )

聽 聽 聽 聽 聽endif
聽 聽 聽 聽 聽if oTagLast:Depth() > oTagActual:Depth()
聽 聽 聽 聽 聽 聽 aRoots[ oTagActual:depth() + 1 ] := aRoots[ oTagActual:Depth() ]:Add( oTagActual:cName )
聽 聽 聽 聽 聽endif
聽 聽 聽 聽 聽if oTagLast:Depth() == oTagActual:Depth()
聽 聽 聽 聽 聽 聽 aRoots[ Max( oTagLast:Depth(), 1 ) ]:Add( oTagActual:cName )
聽 聽 聽 聽 聽endif
聽 聽 聽 else
聽 聽 聽 聽 聽AAdd( aRoots, oTree:Add( oTagActual:cName ) )

聽 聽 聽 endif
聽 聽 聽 oTagLast = oTagActual
聽 聽end

聽 聽// HEval( oTagActual:aAttributes, { | cKey, cValue | MsgInfo( cKey, cValue )} )

聽 聽FClose( hFile )

聽 聽// oTree:bChanged = { || ShowClassInfo( oTree ) }

return nil

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


Saludos/regards

RenOmaS



skype: americo.balboa
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Visor de XML
Posted: Wed Feb 27, 2013 10:23 PM

gracias! :-)

Creo que a煤n falla en ramas hijas, a ver si conseguimos arreglarlo :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 205
Joined: Fri Oct 07, 2005 05:07 PM
Re: Visor de XML
Posted: Wed Feb 27, 2013 10:29 PM
Aca me funciona bien



son xml's simples..
Saludos/regards

RenOmaS



skype: americo.balboa
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Visor de XML
Posted: Wed Feb 27, 2013 10:57 PM

Si, cierto, est谩 ya funcionando genial :-) Muchas gracias!

Ahora lo suyo seria que en el lado derecho mostremos el valor de cada item...

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Visor de XML
Posted: Wed Feb 27, 2013 11:39 PM
Esta versi贸n ya muestra los valores de los items a la derecha :-)

xmltree.prg
Code (fw): Select all Collapse
#include "FiveWin.ch"
#include "Splitter.ch"

static oSplit1, oSplit2, oLbxDatas, oLbxMethods

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

function Test()

聽 聽local oWnd

聽 聽DEFINE WINDOW oWnd TITLE "XML viewer" ;
聽 聽 聽 MENU BuildMenu()

聽 聽ACTIVATE WINDOW oWnd ;
聽 聽 聽 ON INIT BuildTree( oWnd ) ;
聽 聽 聽 ON RESIZE ( If( oSplit1 != nil, oSplit1:AdjLeft(),),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 If( oSplit2 != nil, oSplit2:AdjRight(),) )

return nil

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


function BuildMenu()

聽 聽local oMenu

聽 聽MENU oMenu
聽 聽 聽 MENUITEM "About" ACTION MsgAbout( "XML Viewer", "(c) FiveTech Software 2013" )
聽 聽ENDMENU

return oMenu

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


function BuildTree( oWnd )

聽 聽local oTree := TTreeView():New( 0, 0, oWnd )
聽 聽local oClass, cData, cMethod
聽 聽local hFile, oXmlDoc, oXmlIter, oTagActual
聽 聽local oTagLast, aRoots := {}

聽 聽oTree:nWidth = 180
聽 聽// oTree:SetImageList( oImageList )

聽 聽oTree:Expand()

聽 聽@ 0, 186 LISTBOX oLbxDatas VAR cData ITEMS {} ;
聽 聽 聽 SIZE 200, 200 PIXEL OF oWnd

聽 聽@ 0, 391 LISTBOX oLbxMethods VAR cMethod ITEMS {} ;
聽 聽 聽 SIZE 200, 200 PIXEL OF oWnd

聽 聽@ 0, 181 SPLITTER oSplit1 ;
聽 聽 聽 VERTICAL ;
聽 聽 聽 PREVIOUS CONTROLS oTree ;
聽 聽 聽 HINDS CONTROLS oLbxDatas ;
聽 聽 聽 LEFT MARGIN 150 ;
聽 聽 聽 RIGHT MARGIN oSplit2:nLast + 100 ;
聽 聽 聽 SIZE 4, 300 聽PIXEL ;
聽 聽 聽 OF oWnd STYLE

聽 聽@ 0, 386 SPLITTER oSplit2 ;
聽 聽 聽 VERTICAL ;
聽 聽 聽 PREVIOUS CONTROLS oLbxDatas ;
聽 聽 聽 HINDS CONTROLS oLbxMethods ;
聽 聽 聽 LEFT MARGIN oSplit1:nFirst + 120 ;
聽 聽 聽 RIGHT MARGIN 80 ;
聽 聽 聽 SIZE 4, 300 PIXEL ;
聽 聽 聽 OF oWnd STYLE

聽 聽hFile 聽 聽= FOpen( "test.xml" )
聽 聽oXmlDoc 聽= TXmlDocument():New( hFile )
聽 聽oXmlIter = TXmlIterator():New( oXmlDoc:oRoot )

聽 聽AAdd( aRoots, oTree )

聽 聽while ( oTagActual := oXmlIter:Next() ) != nil
聽 聽 聽 if oTagLast != nil
聽 聽 聽 聽 聽if oTagLast:Depth() < oTagActual:Depth()
聽 聽 聽 聽 聽 聽 ASize( aRoots, Len( aRoots ) + 1 )
聽 聽 聽 聽 聽 聽 aRoots[ oTagActual:Depth() + 1 ] = aRoots[ oTagActual:Depth() ]:Add( oTagActual:cName )
聽 聽 聽 聽 聽 聽 aRoots[ oTagActual:Depth() + 1 ]:Cargo = oTagActual:cData
聽 聽 聽 聽 聽endif

聽 聽 聽 聽 聽if oTagLast:Depth() > oTagActual:Depth()
聽 聽 聽 聽 聽 聽 aRoots[ oTagActual:depth() + 1 ] = aRoots[ oTagActual:Depth() ]:Add( oTagActual:cName )
聽 聽 聽 聽 聽 聽 aRoots[ oTagActual:depth() + 1 ]:Cargo = oTagActual:cData
聽 聽 聽 聽 聽endif

聽 聽 聽 聽 聽if oTagLast:Depth() == oTagActual:Depth()
聽 聽 聽 聽 聽 聽 aRoots[ Max( oTagLast:Depth(), 1 ) ]:Add( oTagActual:cName ):Cargo = oTagActual:cData 
聽 聽 聽 聽 聽endif
聽 聽 聽 else
聽 聽 聽 聽 聽AAdd( aRoots, oTree:Add( oTagActual:cName ) )
聽 聽 聽 聽 聽ATail( aRoots ):Cargo = oTagActual:cData
聽 聽 聽 endif
聽 聽 聽 oTagLast = oTagActual
聽 聽end

聽 聽// HEval( oTagActual:aAttributes, { | cKey, cValue | MsgInfo( cKey, cValue )} )

聽 聽FClose( hFile )

聽 聽oTree:bChanged = { | oItem | oLbxDatas:SetItems( { oItem:GetSelected():Cargo } ) }

return nil

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




test.xml
Code (fw): Select all Collapse
<xml>
<one>
<name>FiveWin</name>
<company>FiveTech Software
<country>Spain</country>
<region>EU</region>
</company>
</one>
<two attribute1="att1" attribute2="att2">
</two>
<three>
<first>any</first>
<second>value</second>
</three>
</xml>
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Visor de XML
Posted: Wed Feb 27, 2013 11:57 PM
Y esta versi贸n ya muestra los atributos de cada item en el listbox de m谩s a la derecha :-)

xmltree.prg
Code (fw): Select all Collapse
#include "FiveWin.ch"
#include "Splitter.ch"

static oSplit1, oSplit2, oLbxDatas, oLbxMethods

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

function Test()

聽 聽local oWnd

聽 聽DEFINE WINDOW oWnd TITLE "XML viewer" ;
聽 聽 聽 MENU BuildMenu()

聽 聽ACTIVATE WINDOW oWnd ;
聽 聽 聽 ON INIT BuildTree( oWnd ) ;
聽 聽 聽 ON RESIZE ( If( oSplit1 != nil, oSplit1:AdjLeft(),),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 If( oSplit2 != nil, oSplit2:AdjRight(),) )

return nil

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


function BuildMenu()

聽 聽local oMenu

聽 聽MENU oMenu
聽 聽 聽 MENUITEM "About" ACTION MsgAbout( "XML Viewer", "(c) FiveTech Software 2013" )
聽 聽ENDMENU

return oMenu

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


function BuildTree( oWnd )

聽 聽local oTree := TTreeView():New( 0, 0, oWnd )
聽 聽local oClass, cData, cMethod
聽 聽local hFile, oXmlDoc, oXmlIter, oTagActual
聽 聽local oTagLast, aRoots := {}

聽 聽oTree:nWidth = 180
聽 聽// oTree:SetImageList( oImageList )

聽 聽oTree:Expand()

聽 聽@ 0, 186 LISTBOX oLbxDatas VAR cData ITEMS {} ;
聽 聽 聽 SIZE 200, 200 PIXEL OF oWnd

聽 聽@ 0, 391 LISTBOX oLbxMethods VAR cMethod ITEMS {} ;
聽 聽 聽 SIZE 200, 200 PIXEL OF oWnd

聽 聽@ 0, 181 SPLITTER oSplit1 ;
聽 聽 聽 VERTICAL ;
聽 聽 聽 PREVIOUS CONTROLS oTree ;
聽 聽 聽 HINDS CONTROLS oLbxDatas ;
聽 聽 聽 LEFT MARGIN 150 ;
聽 聽 聽 RIGHT MARGIN oSplit2:nLast + 100 ;
聽 聽 聽 SIZE 4, 300 聽PIXEL ;
聽 聽 聽 OF oWnd STYLE

聽 聽@ 0, 386 SPLITTER oSplit2 ;
聽 聽 聽 VERTICAL ;
聽 聽 聽 PREVIOUS CONTROLS oLbxDatas ;
聽 聽 聽 HINDS CONTROLS oLbxMethods ;
聽 聽 聽 LEFT MARGIN oSplit1:nFirst + 120 ;
聽 聽 聽 RIGHT MARGIN 80 ;
聽 聽 聽 SIZE 4, 300 PIXEL ;
聽 聽 聽 OF oWnd STYLE

聽 聽hFile 聽 聽= FOpen( "test.xml" )
聽 聽oXmlDoc 聽= TXmlDocument():New( hFile )
聽 聽oXmlIter = TXmlIterator():New( oXmlDoc:oRoot )

聽 聽AAdd( aRoots, oTree )

聽 聽while ( oTagActual := oXmlIter:Next() ) != nil
聽 聽 聽 if oTagLast != nil
聽 聽 聽 聽 聽if oTagLast:Depth() < oTagActual:Depth()
聽 聽 聽 聽 聽 聽 ASize( aRoots, Len( aRoots ) + 1 )
聽 聽 聽 聽 聽 聽 aRoots[ oTagActual:Depth() + 1 ] = aRoots[ oTagActual:Depth() ]:Add( oTagActual:cName )
聽 聽 聽 聽 聽 聽 aRoots[ oTagActual:Depth() + 1 ]:Cargo = oTagActual
聽 聽 聽 聽 聽endif

聽 聽 聽 聽 聽if oTagLast:Depth() > oTagActual:Depth()
聽 聽 聽 聽 聽 聽 aRoots[ oTagActual:depth() + 1 ] = aRoots[ oTagActual:Depth() ]:Add( oTagActual:cName )
聽 聽 聽 聽 聽 聽 aRoots[ oTagActual:depth() + 1 ]:Cargo = oTagActual
聽 聽 聽 聽 聽endif

聽 聽 聽 聽 聽if oTagLast:Depth() == oTagActual:Depth()
聽 聽 聽 聽 聽 聽 aRoots[ Max( oTagLast:Depth(), 1 ) ]:Add( oTagActual:cName ):Cargo = oTagActual 
聽 聽 聽 聽 聽endif
聽 聽 聽 else
聽 聽 聽 聽 聽AAdd( aRoots, oTree:Add( oTagActual:cName ) )
聽 聽 聽 聽 聽ATail( aRoots ):Cargo = oTagActual
聽 聽 聽 endif
聽 聽 聽 oTagLast = oTagActual
聽 聽end

聽 聽FClose( hFile )

聽 聽oTree:bChanged = { | oItem | oLbxDatas:SetItems( { oItem:GetSelected():Cargo:cData } ),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 oLbxMethods:Reset(),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 HEval( oItem:GetSelected():Cargo:aAttributes,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 { | cKey, cData | oLbxMethods:Add( cKey + " : " + cData ) } ) }

return nil

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




test.xml
Code (fw): Select all Collapse
<xml>
<one>
<name>FiveWin</name>
<company>FiveTech Software
<country>Spain</country>
<region>EU</region>
</company>
</one>
<two attribute1="att1" attribute2="att2">
</two>
<three>
<first>any</first>
<second>value</second>
</three>
</xml>
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Visor de XML
Posted: Thu Feb 28, 2013 12:27 AM
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Visor de XML
Posted: Thu Feb 28, 2013 04:23 PM
Esta modificaci贸n puede ser necesaria en la clase TXmlDocument de Harbour, seg煤n el xml inspeccionado:

METHOD New( xElem, nStyle ) CLASS TXMLDocument
Code (fw): Select all Collapse
         IF ! Empty( ::oRoot:oChild ) .AND. ::oRoot:oChild:cName == "xml" .and. ::oRoot:oChild:cData != nil
            ::cHeader := "<=xml " + ::oRoot:oChild:cData + "?>"
         ENDIF
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 205
Joined: Fri Oct 07, 2005 05:07 PM
Re: Visor de XML
Posted: Thu Feb 28, 2013 07:51 PM
Tambem que no me quiere tomar es algunos xml's que tengan atributos asi: Font.Name="Arial",
NO se si sea e formato correcto de un fichero xml.

Code (fw): Select all Collapse
<TfrxMemoView Name="System" Align="baBottom" Left="-26,45671" Top="480,000676141732" Width="18,89765" Height="566,929133858268" ShowHint="False" AutoWidth="True" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Arial" 聽/>


Estoy a querer leer fichero de fastreport
Saludos/regards

RenOmaS



skype: americo.balboa
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Visor de XML
Posted: Thu Feb 28, 2013 08:36 PM
Americo, (?)

Puesto que usamos las funciones de XML de Harbour y xHarbour (contrib/xhb/txml.prg), si eres tan amable podrias crear un peque帽o ejemplo que no use FWH y que demuestre el problema con los puntos y preguntarlo en la lista de desarrollo de Harbour:

https://groups.google.com/forum/?fromgroups#!forum/harbour-devel

gracias
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 205
Joined: Fri Oct 07, 2005 05:07 PM
Re: Visor de XML
Posted: Fri Mar 01, 2013 12:56 PM
Am茅rico, (?)

Si.

Ya coloque en el forum indicado

Gracias.
Saludos/regards

RenOmaS



skype: americo.balboa

Continue the discussion