Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Printing VFP9 HTML Output
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00972248
Message ID:
00984246
Vues:
43
This message has been marked as a message which has helped to the initial question of the thread.
Disagreed <s>.

How complicated is the following, really? More complicated than WDSL and other XML dialects?
<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
  <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>

  <xsl:template match="/">

    <html>

    <head>
      <title>VFP Report HTML 
       <xsl:value-of select="/Reports/VFP-Report/VFP-RDL/@id"/>
      </title>
      <xsl:comment>
        Transformed by report2simplehtml.xslt, a very simple XSLT, 
        suitable for use in VFP-Report XML via HTMLListener class. 
        (c) Lisa Slater Nicholls 
      </xsl:comment>
    </head>

    <body bgcolor="white">
      <table width="95%" border="0" align="center">
        <xsl:apply-templates select="/Reports/VFP-Report[1]/Data/PH[1]"/>
        <xsl:apply-templates select="/Reports/VFP-Report[1]/Data/D"/>
      </table>
    </body>
  
    </html>

    </xsl:template>
    
    <xsl:template match="PH">
       <tr>
         <xsl:for-each select="./T">
           <th><xsl:value-of select="."/></th>
         </xsl:for-each>
      </tr>
    </xsl:template>

    <xsl:template match="D">
       <tr>
         <xsl:for-each select="./E">
           <td><xsl:value-of select="."/></td>
         </xsl:for-each>
       </tr>
    </xsl:template>

</xsl:stylesheet>
Meanwhile, XMLListener and its descendents make XSLT pretty darned easy to use.
   DO (_REPORTOUTPUT) WITH 5, "ox"
   ox.xsltProcessorUser = "c:\temp\simple.xslt"
   * it will intelligently handle a filename, 
   * a string, or a processor object
   REPORT FORM ? object ox
>L<
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform