[xsl] pleaz help

Discussion in 'XML' started by Tjerk Wolterink, Apr 20, 2005.

  1. I have xsl code like this:

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:page="http://www.wolterinkwebdesign.com/xml/page"
    xmlns:xc="http://www.wolterinkwebdesign.com/xml/xcontent">

    <xsl:include href="xsl/xhtml/standard.xsl"/>
    <xsl:include href="xsl/xhtml/collectielib.xsl"/>

    <!-- the file collectielib.xsl defines templates for xc:fauteuil elements -->

    <xsl:eek:utput method="xml" indent="yes"/>

    <xsl:param name="absolute_url"/>
    <xsl:param name="upload_url"/>
    <xsl:param name="cols" select="3"/>

    <xsl:template match="/xc:xcontent">
    <page:page type="module">
    <page:section>
    <page:content>
    <h2>Fauteuils</h2>
    <center>
    <table class="collectie">
    <xsl:for-each select="./xc:fauteuil[(position() mod $cols)=1]">
    <xsl:sort data-type="text" select="xc:naam" order="descending"
    />
    <tr>
    <xsl:apply-templates select="."/>
    <xsl:apply-templates
    select="following-sibling::xc:fauteuil[position() &lt; $cols]"/>
    </tr>
    </xsl:for-each>
    </table>
    </center>

    </page:content>
    </page:section>
    </page:page>
    </xsl:template>
    </xsl:stylesheet>



    But with an XML input like this:


    ----------
    <?xml version="1.0" encoding="ISO-8859-1"?>

    <!DOCTYPE xc:xcontent [
    <!ENTITY % xhtml PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "schema/xhtml/xhtml1-strict.dtd">%xhtml;]>

    <xc:xcontent xmlns:xc="http://www.wolterinkwebdesign.com/xml/xcontent"
    xmlns="http://www.w3.org/1999/xhtml" module="collectie">
    <xc:content type="html">
    <xc:empty/>
    </xc:content>
    <xc:fauteuil>
    <xc:id>1</xc:id>
    <xc:naam type="string"><![CDATA[test]]></xc:naam>
    <xc:afmetingen type="string"><![CDATA[test]]></xc:afmetingen>
    <xc:foto type="img" width="2592" height="1944"><![CDATA[Rutger
    faut1.JPG]]></xc:foto>
    <xc:content type="html">
    etet
    </xc:content>
    </xc:fauteuil>
    <xc:fauteuil>
    <xc:id>2</xc:id>
    <xc:naam type="string"><![CDATA[rutger]]></xc:naam>
    <xc:afmetingen type="string"><![CDATA[rutger]]></xc:afmetingen>
    <xc:foto type="img" width="2592" height="1944"><![CDATA[Rutger
    faut2.JPG]]></xc:foto>
    <xc:content type="html">
    rr
    </xc:content>
    </xc:fauteuil>
    <xc:fauteuil>
    <xc:id>3</xc:id>
    <xc:naam type="string"><![CDATA[rutger]]></xc:naam>
    <xc:afmetingen type="string"><![CDATA[rutger]]></xc:afmetingen>
    <xc:foto type="img" width="2592" height="1944"><![CDATA[Rutger
    faut2.JPG]]></xc:foto>
    <xc:content type="html">
    rr
    </xc:content>
    </xc:fauteuil>
    <xc:fauteuil>
    <xc:id>4</xc:id>
    <xc:naam type="string"><![CDATA[rutger]]></xc:naam>
    <xc:afmetingen type="string"><![CDATA[rutger]]></xc:afmetingen>
    <xc:foto type="img" width="2592" height="1944"><![CDATA[Rutger
    faut2.JPG]]></xc:foto>
    <xc:content type="html">
    rr
    </xc:content>
    </xc:fauteuil>
    <xc:fauteuil>
    <xc:id>5</xc:id>
    <xc:naam type="string"><![CDATA[rutger]]></xc:naam>
    <xc:afmetingen type="string"><![CDATA[rutger]]></xc:afmetingen>
    <xc:foto type="img" width="2592" height="1944"><![CDATA[Rutger
    faut2.JPG]]></xc:foto>
    <xc:content type="html">
    rr
    </xc:content>
    </xc:fauteuil>
    <xc:fauteuil>
    <xc:id>6</xc:id>
    <xc:naam type="string"><![CDATA[rutger]]></xc:naam>
    <xc:afmetingen type="string"><![CDATA[rutger]]></xc:afmetingen>
    <xc:foto type="img" width="2592" height="1944"><![CDATA[Rutger
    faut2.JPG]]></xc:foto>
    <xc:content type="html">
    rr
    </xc:content>
    </xc:fauteuil>
    <xc:fauteuil>
    <xc:id>7</xc:id>
    <xc:naam type="string"><![CDATA[rutger]]></xc:naam>
    <xc:afmetingen type="string"><![CDATA[rutger]]></xc:afmetingen>
    <xc:foto type="img" width="2592" height="1944"><![CDATA[Rutger
    faut2.JPG]]></xc:foto>
    <xc:content type="html">
    rr
    </xc:content>
    </xc:fauteuil>
    </xc:xcontent>


    ----


    now i want this to be sort of like this

    <page:page type="module">
    <page:section>
    <page:content>
    <h2>Fauteuils</h2>
    <center>
    <table class="collectie">
    <tr>
    - fauteuil1
    - fauteuil2
    - fauteuil3
    </tr>
    <tr>
    - fauteuil4
    - fauteuil5
    - fauteuil6
    </tr>
    <tr>
    - fauteuil7
    </tr>
    </xsl:for-each>
    </table>
    </center>

    </page:content>
    </page:section>
    </page:page>




    But the output is like this:


    --

    <page:page type="module">
    <page:section>
    <page:content>
    <h2>Fauteuils</h2>
    <center>
    <table class="collectie">
    <tr>
    - fauteuil7
    </tr>
    <tr>
    - fauteuil1
    - fauteuil2
    - fauteuil3
    </tr>
    <tr>
    - fauteuil4
    - fauteuil5
    - fauteuil6
    </tr>
    </xsl:for-each>
    </table>
    </center>

    </page:content>
    </page:section>
    </page:page>




    ----


    i know i am asking much, but im stuck here.
     
    Tjerk Wolterink, Apr 20, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Flood
    Replies:
    0
    Views:
    1,033
    Kevin Flood
    Sep 8, 2004
  2. Kevin Flood
    Replies:
    1
    Views:
    2,769
    Kevin Flood
    Sep 13, 2004
  3. Klaus Friese
    Replies:
    0
    Views:
    481
    Klaus Friese
    Nov 22, 2004
  4. Replies:
    1
    Views:
    3,636
    A. Bolmarcich
    May 27, 2005
  5. =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=

    Help with XSL/XSL:FO for producing revision indicator bar in document.

    =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=, Apr 28, 2006, in forum: XML
    Replies:
    6
    Views:
    582
    =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=
    May 3, 2006
Loading...

Share This Page