[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: layout problem

Subject: RE: layout problem
From: Roelof Wobben <rwobben@xxxxxxxxxxx>
Date: Thu, 8 Dec 2011 11:22:31 +0000
RE:  layout problem

What Im trying to do is to make this layout (http://www.notepadchaos.com) in
xml and xslt.

What I have so far is this :

home.xsl :

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"

<xsl:import href="../utilities/master.xsl"/>
<xsl:import href="../utilities/sections.xsl"/>

<xsl:template match="data">
 <xsl:call-template name="section-content"/>


master.xsl :

<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0"

<xsl:import href="../utilities/common.xsl"/>
<xsl:import href="../utilities/sections.xsl"/>

 doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
 indent="yes" />

<xsl:template match="/">
  <xsl:call-template name="head"/>
  <xsl:apply-templates />
  <xsl:call-template name="bottom"/>


sections.xsl :

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"

<xsl:template name="section-content">
       <div id="outer">
          <div id="container">
                  <div id="search">
                    <form method="get" id="searchform"
                       <input type="text" value="" name="s" id="s"
class="txtField" />
                      <input type="submit" id="searchsubmit" class="btnSearch"
value="Find It ;" />
                <div id="title">
                   <h2>Tamara Wobben </h2>
               <div id="content">
                    <div class="col01">

             <xsl:for-each select="section/entry">
  <div class="post">
   <h2><xsl:value-of select="title"/></h2>
                      <div class="post-inner">
         <h4><xsl:value-of select="heading"/></h4>
       <xsl:copy-of select="description/*"/>
       <xsl:copy-of select="body/*"/>


common.xsl :

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"

<xsl:template name="head">
  <title><xsl:value-of select="$website-name"/> - <xsl:value-of
  <link rel="stylesheet" type="text/css"
  <link rel="alternate" type="application/rss+xml" title="Notepad Chaos RSS
Feed" href="http://www.notepadchaos.com/feed/" />
<link rel="pingback" href="http://www.notepadchaos.com/xmlrpc.php" />

<link rel="alternate" type="application/rss+xml" title="Notepad Chaos Feed"
href="http://www.notepadchaos.com/feed/" />
<link rel="alternate" type="application/rss+xml" title="Notepad Chaos Comments
Feed" href="http://www.notepadchaos.com/comments/feed/" />
<link rel="EditURI" type="application/rsd+xml" title="RSD"
href="http://www.notepadchaos.com/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml"
href="http://www.notepadchaos.com/wp-includes/wlwmanifest.xml" />
<link rel='index' title='Notepad Chaos' href='http://www.notepadchaos.com/'

<xsl:template name="bottom">
 <div id="footer-holder">
  <div class="footer">
        <a href="http://www.notepadchaos.com/">Notepad Chaos</a><br />
        <a href="http://www.notepadchaos.com/">Notepad Chaos</a> uses the <a
href="http://www.notepadchaos.com">"Notepad Chaos v2"</a> theme.
  <span class="evaneckard">
         <a href="http://www.evaneckard.com">Evan Eckard Design</a>
   <span class="smashing">
      <a href="http://www.smashingmagazine.com">Smashing Magazine</a>
   <span class="rss">
       <a href="http://www.notepadchaos.com/feed/">RSS</a>


I use this layout (
https://github.com/bauhouse/sym-bauhouse/tree/master/pages) as a example.

But if there a better way I will take that.


> Date: Thu, 8 Dec 2011 10:52:21 +0000
> From: andrew.j.welch@xxxxxxxxx
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  layout problem
> On 8 December 2011 10:34, Roelof Wobben <rwobben@xxxxxxxxxxx> wrote:
> > Hello,
> > I have this xml :
> > Why don't I get to see the output as I expected on the screen ?
> Someone might put in the effort for you, but you really need to
> re-post a 'small complete runnable example', containing only what's
> necessary to demonstrate your problem. You don't have a root matching
> template, and only one named template, so it needs an initial template
> setting - as you didnt mention it its hard to know if thats
> intentional.
> Also, remember the helpful guide when you are new to xslt - avoid
> named templates and avoid for-each, use the apply-templates and many
> small templates.
> --
> Andrew Welch
> http://andrewjwelch.com

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.