FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour HOWTO: XML + XSLT = HTML
Posts: 731
Joined: Fri Oct 07, 2005 07:42 AM
HOWTO: XML + XSLT = HTML
Posted: Wed Oct 05, 2011 11:49 AM
Buenas, como estoy últimamente haciendo de I+D, me plantearon una serie de problemas, y uno de ellos era, como fusionar unos datos para enviarlos por mail en el cuerpo de mensaje.
La solución es muy sencilla, tanto que me cuesta creer que funcione :-)

Code (fw): Select all Collapse
function transformIt()
    Local strResult
    // Declare two new MSXML DOMDocument objects.
    Local objSrcTree := CreateObject( "MSXML2.DOMDocument.6.0" )
    Local objXSLT    := CreateObject( "MSXML2.DOMDocument.6.0" )

    // Load the two DOMDocuments with the XML document and the XSLT style sheet.
    objSrcTree:load('region.xml')
    objXSLT:load('region.xsl')

    // Use the transformNode method to apply the XSLT to the XML.
    strResult := objSrcTree:transformNode(objXSLT)

    // Assign the resulting string to the result tree object's
    // innerHTML property.
    memowrit( "region.html", strResult )

return nil


Desde http://msdn.microsoft.com/en-us/library/windows/desktop/ms757854(v=VS.85).aspx tenéis el ejemplo del XML y XSL, este código os devolverá el HMTL formado.
Saludos

Rafa Carmona ( rafa.thefullARROBAgmail.com___quitalineas__)
Posts: 682
Joined: Tue Feb 14, 2006 09:48 AM
Re: HOWTO: XML + XSLT = HTML
Posted: Thu Oct 06, 2011 04:31 PM

Muy interesante Rafa. Facil y sencillo. :lol: increible.

Saludos desde Mallorca
Biel Maimó
http://bielsys.blogspot.com/

Continue the discussion