[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 12:21:03 +0000
RE:  layout problem
----------------------------------------
> Date: Thu, 8 Dec 2011 11:36:14 +0000
> From: andrew.j.welch@xxxxxxxxx
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  layout problem
>
> It's not clear what question you are asking...
>
> Looking at your code you can make some improvments:
>
> > <xsl:template match="data">
> > <xsl:call-template name="section-content"/>
> > </xsl:template>
>
> Don't do that ^^^^, just move the contents of the named template
> 'section-content' into the body of the template.
>



So it will be this :



<xsl:template match ="data">

   <div id="outer">
          <div id="container">
                  <div id="search">
                    <form method="get" id="searchform"
action="http:/test.tamarawobben.nl/">
                       <input type="text" value="" name="s" id="s"
class="txtField" />
                      <input type="submit" id="searchsubmit" class="btnSearch"
value="Find It ;" />
                  </form>
                </div>
                <div id="title">
                   <h2>Tamara Wobben </h2>
               </div>
               <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/*"/>
                      </div>
             </div>
   </xsl:for-each>
       </div>
       </div>
      </div>
</div>
</xsl:template>




> > <body>
> > <xsl:call-template name="head"/>
> > <xsl:apply-templates />
> > <xsl:call-template name="bottom"/>
> > </body>
>
> Instead of the call-template you should use apply-templates and modes.
> If you really do have to use named templates, pass the context
> explicitly as a parameter. The reason is it helps whoever maintains
> the code down the line.





oke, That will be then this :



<body>

   <xsl:apply-templates mode="head">

   <xsl:apply-templates>

   <xsl:apply-templates mode="bottom"

</body>






>
> > <xsl:template name="section-content">
>
> change that to a match



that one would be deleted because it's merged with the template match="data"






>
> > <xsl:for-each select="section/entry">
>
> change that to apply-templates



So that would be :





<xsl: apply-templates match="section/entry">






>
>
> > <xsl:template name="head">
>
> > <xsl:template name="bottom">
>
> change those to matches with a mode





The last one would be :



<xsl: template mode="head">

<xsl: template mode="bottom">

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.