Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6182587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:13:27+00:00 2026-05-24T01:13:27+00:00

I just started playing around with XSLT and PHP. However what I can’t figure

  • 0

I just started playing around with XSLT and PHP. However what I can’t figure out is, in normal template engine you would normally generate your HTML from at least two templates (the frame and the page content).
The “frame” would only contain the standard page layout

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
    <!-- Stylesheets etc would go here -->
    </head>
    <body>
    <!-- Content would go here -->
    </body>
</html>

while the content would contain the actual data.

What would be the best way to realize that using PHP and XSLT?

Ben

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T01:13:28+00:00Added an answer on May 24, 2026 at 1:13 am

    I do it like this:

    View.xsl

    <?xml version="1.0" encoding="UTF-8"?>
    
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    
        <xsl:import href="layout.xsl"/>
    
        <xsl:template name="content">
            2. View Content
        </xsl:template>
    
        <xsl:template match="/">
            <xsl:call-template name="layout"/>
        </xsl:template>
    
    </xsl:stylesheet>
    

    Layout.xsl

    <xsl:template name="jscss"/>
    
    <xsl:template name="layout">
        <html>
            <head>
                <title>layout.xsl</title>
            </head>
            <body>
                1. Layout Content
                <xsl:call-template name="content" />
                3. Layout Content
            </body>
        </html>
    </xsl:template>
    

    Transform View.xsl and you get:

    1. Layout Content
    2. View Content
    3. Layout Content
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just started playing around with, how is everyone linking up their component ids ?
I just started playing around with Mozilla Jetpack , and I love it so
I just started playing around with threading today and I ran into something that
I just started playing around with the 960 CSS framework and found that it
I just started playing around with WPF today, and I couldn't find the datagridview
So I've just started playing around with Django and I decided to give it
I've just started playing around with Scala, and I just learned about how methods
I've just started playing around in Haskell. After years of Ruby, I got used
Ok...so I've just started playing around with Codeigniter. I've followed the two tuts on
Have just started playing with ASP.NET MVC and have stumbled over the following situation.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.