xsl-list
[Top] [All Lists]

[xsl] where's here the error

2011-12-31 03:08:06


Hello, 

 

I try to use this idea for my site 
(http://symphony-cms.com/learn/articles/view/overriding-templates/ ) 

 

So I did this : 

 

 

master.xml : 

 

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:import href="../utilities/top.xsl"/>
<xsl:import href="../utilities/frontpage-article.xsl"/>
<xsl:import href="../utilities/recent_posts.xsl"/>


<xsl:output method="xml"
 doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";
 omit-xml-declaration="yes"
 encoding="UTF-8"
 indent="yes" />

<xsl:template match="/">
<xsl:apply-templates select="data/params" mode="top" />
     <body>
             <div id="outer">
                 <div id="container">
                     <div id="search">
                         <form method="get" id="searchform" 
action="http://www.notepadchaos.com/";>
                             <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><xsl:text>Tamara Wobben</xsl:text></h2>
                        </div>
                     </div>
                     <div id="content">
                        <div class="col01">
                                <div class="post">
                                     <xsl:apply-templates select="data" />
                                </div></div>
                              <div class="side-columns">
                             <div class="col02">
                                 <div class="pages">
                                     <!-- hier komen de losse pagina's -->
                                 </div>
                                 <div class="pages-bottom"></div>
                                 <div class="categories-upper"></div>
                                 <div class="categories">
                                    <!-- hier komt het menu  -->
                                </div>
                                 <div class="categories-btm"></div>
                                </div>
                             <div class ="col03"> 
                                <div class="recent-posts" >
                                   <xsl:apply-templates 
select="data/recent-posts/entry" />
                                </div>
                                <div class="postit-bottom"></div>
                            </div>
                         </div>
<br style="clear:both" />
                     </div>
                     <xsl:apply-templates select="data/params" mode="down" />   
                              
                </div>              
            </body>            
</xsl:template>

</xsl:stylesheet>

 

frontpage.xsl : 

 

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:import href="../utilities/master.xsl"/>
<xsl:import href="../utilities/frontpage-article.xsl"/>

<xsl:template name="data">
     <xsl:apply-templates select="section/entry" />
</xsl:template>

</xsl:stylesheet>

 

 

frontpage-article.xsl : 

 

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:template match="section/entry">
   <h2><value-of select="title" /></h2>
</xsl:template>

 

</xsl:stylesheet>

 

And here's my xml : 

 

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

     <data> 

      <params> 

         <today>2011-12-31</today> 

         <current-time>09:56</current-time>

         <this-year>2011</this-year> 

         <this-month>12</this-month>

         <this-day>31</this-day> 

         <timezone>+01:00</timezone>

         <website-name>Tamara Wobben</website-name> 

         <page-title>frontpage</page-title> 

         <root>http://test.tamarawobben.nl</root> 

         <workspace>http://test.tamarawobben.nl/workspace</workspace> 

         <root-page>frontpage</root-page> 

         <current-page>frontpage</current-page> 

         <current-page-id>6</current-page-id> 

         <current-path>/?debug</current-path> 

         <parent-path>/</parent-path>

         <current-url>http://test.tamarawobben.nl/?debug</current-url>

         <upload-limit>2097152</upload-limit> 

         <symphony-version>2.2.5</symphony-version> 

         <cookie-username>xxxxx</cookie-username> 

         <cookie-pass>xxxxx</cookie-pass> 

          <site-mode>live</site-mode> 

      </params>

      <events /> 

            <image> 

               <section id="7" handle="images">Images</section> 

                    <entry id="13"> 

                         <image size="22 KB" path="/images" type="image/jpeg"> 

                              <filename>img_5874.jpg</filename> 

                              <meta creation="2011-12-19T18:40:04+01:00" 
width="400" height="267" /> 

                         </image> 

                     </entry> 

             </image> 

             <recent-posts> 

                     <section id="9" handle="dagboek">Dagboek</section> 

                           <entry id="15"> 

                                <datum time="00:00" 
weekday="2">2005-02-22</datum> 

                                <titel handle="7-weken-echo">7 weken 
echo</titel> 

                           </entry> 42

             </recent-posts> 

              <section> 

                  <section id="6" handle="sections">Sections</section> 

                          <entry id="12"> 

                               <title handle="even-voorstellen">Even 
Voorstellen</title> 

                                     <tekst><p>FLOAT : img_5874.jpg</p> 55 
56<p>Naam : Tamara Wobben<br /> 57Geboorte gewicht : 2000 gram<br /> 58Geboorte 
lengte : 44 cm.<br /> 59Geboortedatum : 1 september 2005  </p> 

                                     </tekst> 

                          </entry> 

              </section>

</data>

 

But it looks like the references are not right. The xslt processor dumps all 
the data on the screen. You can see it at http://test.tamarawobben.nl 

Can anyone give me a tip where I went wrong ?

 

Roelof

 


                                          
--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>