[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] can this idea work ?

Subject: RE: [xsl] can this idea work ?
From: Roelof Wobben <rwobben@xxxxxxxxxxx>
Date: Fri, 10 Feb 2012 16:07:01 +0000

Sorry for the missing data.

Here a simpliefied xslt with everything needed.

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

<xsl:output method="xml"
 doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
 indent="yes" />

<xsl:template match="/">

           <xsl:apply-templates select="data" />


<xsl:template match="data">
      <xsl:apply-templates select="dagboek/entry"/>


<xsl:template match="dagboek/entry" >
    <xsl:value-of select="titel" />
     <xsl:apply-templates select="dagboek/entry[nieuwe-pagina = 'yes']"
mode="pagegroup" />
      <xsl:apply-templates select="tekst" />

<xsl:template match="entry" mode="pagegroup">
       <xsl:apply-templates select=". |
following-sibling::entry[not(nieuwe-pagina = 'yes') and
preceding-sibling::entry[nieuwe-pagina = 'yes'][1] = current()]" />


<xsl:template match="tekst//p[starts-with(., 'FLOAT : ')]" priority="1">
    <img class="float-left" src="{$workspace}/images/{substring-after(.,
'FLOAT : ')}" />

<xsl:template match="tekst//*">
    <xsl:element name="{name()}">
        <xsl:apply-templates select="* | @* | text()"/>

<xsl:template match="tekst//@*">
    <xsl:attribute name="{name(.)}">
        <xsl:value-of select="."/>

And here the simpliefied xml :



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

             <entry id="20">


                <tekst mode="formatte"">

                     Article 1


                <titel handle="nekplooimeting">Nekplooimeting </titel>

                <datum time="00:00" weekday="5">2005-04-01</datum>


             <entry id="21">


               <tekst mode="formatted">

                   Article 2


                    <titel handle="vlokkentest">Vlokkentest ?</titel>

                    <datum time="19:16" weekday="1">2005-04-04</datum>




What I was expecting was a page where only the first arcticle and the article
between the first article and the next article with <nieuwe-pagina = "yes"> is

Now it's schowing both articles where I was expecting to see only the first

---------------------------------------- > Date: Fri, 10 Feb 2012 12:40:20
+0000 > From: davidc@xxxxxxxxx > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > CC:
rwobben@xxxxxxxxxxx > Subject: Re: [xsl] can this idea work ? > > On
10/02/2012 12:29, Roelof Wobben wrote: > > So I thought this xslt 1.0 could do
the job : > > > > > > you haven't said what output you expected from the
stylesheet or what > output you got, and we can't run the code you posted as
it imports files > you have not posted. > > If the imported files are not
relevant to your problem make a small > (without all the irrelevant text and
elements) input file and a small > complete runnable xsl stylesheet and then
say what output you got and > what output you expected/wanted. > > David > >
________________________________________________________________________ > The
Numerical Algorithms Group Ltd is a company registered in England > and Wales
with company number 1249803. The registered office is: > Wilkinson House,
Jordan Hill Road, Oxford OX2 8DR, United Kingdom. > > This e-mail has been
scanned for all viruses by Star. The service is > powered by MessageLabs. >

Current Thread