Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

XSLT vs Templating, Part 2

by Masem (Monsignor)
on Feb 07, 2002 at 04:37 UTC ( #143791=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    SELECT id, name, xp, lat, long FROM monks ORDER BY lat LIMIT 25
    
  2. or download this
    Benchmark: timing 50 iterations of DBI and CGI, DBI and Print, DBI and
    + TT2, XML and TT2/Simple, XML and TT2/XPath, XML and XSLT...
    DBI and CGI:  5 wallclock secs ( 2.02 usr +  0.02 sys =  2.04 CPU) @ 2
    +4.51/s (n=50)
    ...
    DBI and TT2         4.55/s 1220%    302%  122%  --    -81%  -98%
    DBI and CGI         24.5/s 7003%   2062% 1093%  438%   --   -88%
    DBI and Print        200/s 57860% 17540% 9636% 4292%  716%  --
    
  3. or download this
                   XSLT Transform
    DBI -->  XML -----------------> XHTML
    
  4. or download this
    CGI-->userinfo -----|
                        |         Data Pruning XSLT
    ...
                                                      |
                                                      V
                                                    XHTML
    
  5. or download this
    #!/usr/bin/perl -w
    
    ...
      my $results = $stylesheet->transform( $source );
      print $target $stylesheet->output_string( $results );
    }
    
  6. or download this
    [% colorrow = 0 %] 
    <html>
    ...
    </table>
    </body>
    </html>
    
  7. or download this
    [% USE xml = XML.Simple( results ) %] 
    [% xml %]
    ...
    </table>
    </body>
    </html>
    
  8. or download this
    [% USE xpath= XML.XPath( results ) %] 
    [% colorrow = 0 %] 
    ...
    </table>
    </body>
    </html>
    
  9. or download this
    <xsl:stylesheet version = '1.0'
            xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
    ...
      </xsl:template>
      
    </xsl:stylesheet>
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://143791]
Approved by root
help
Chatterbox?
[1nickt]: choroba Updated the PR, using Config instead of exposing the hackery. Using cpanfile-dump does not work to test, as shown in the earlier PR comment, even when using a binary built for a particular Perlbrew perl, the output seems to be
[1nickt]: ... from the system perl binary. Using cpanm --installdeps . does use the expected perl and tus the check acts correctly.
[choroba]: Nice, thanks. I'll look into it later, about to leave ATM.
[1nickt]: Aye-aye cap'n 🖖

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (10)
As of 2017-10-18 16:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (249 votes). Check out past polls.

    Notices?