RE: [xsl] Can grouping here the solution ?

Subject: RE: [xsl] Can grouping here the solution ?
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 21 Nov 2011 11:45:42 -0500
At 2011-11-21 16:29 +0000, Roelof Wobben wrote:
Can I select the group on multiple things

Yes, by grouping the groups as I showed you.

This script does what i need but I don't see how I can take care that ony 1 month and 1 page are displayed.

I do not understand your concern. Can you please post what you want to display for the XML content you showed us?

Perhaps the problem is in your choice of the word "grouping". If you want to only show from your content all of the titles for a given month and page, then you do not need grouping, you only need filtering.

I hope the filtering example below helps. It does not rely on grouping.

. . . . . . . . . . Ken

t:\ftemp>type roelof.xml
<?xml version="1.0" encoding="UTF-8"?>
<section id="1" handle="blog">Blog</section>
 <entry id="1">
  <titel handle="zwanger">Zwanger ??</titel>
  <datum time="23:00" weekday="5">2005-02-04</datum>
  <tekst mode="formatted"><p>Hoera, het is zover, eindelijk (...)</p>
  <entry id="2">
   <titel handle="7-weken-echo">7 weken echo</titel>
   <datum time="22:00" weekday="1">2005-02-21</datum>
   <tekst mode="formatted"><p>Ik stond al onder behandeling  (...)</p>
  <entry id="3">
   <titel handle="appelgebak">Appelgebak</titel>
   <datum time="23:00" weekday="6">2005-02-26</datum>
   <tekst mode="formatted"><p>Met appelgebak zijn we naar jouw (...)</p>

t:\ftemp>xslt2 roelof.xml roelof2.xsl roelof.out "month=02" "page=2"

t:\ftemp>type roelof.out
For month "02" and page "2":

t:\ftemp>xslt2 roelof.xml roelof2.xsl roelof.out "month=02" "page=1"

t:\ftemp>type roelof.out
For month "02" and page "1":
Zwanger ??
7 weken echo

t:\ftemp>type roelof2.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="";
<xsl:output method="text"/>

<xsl:param name="month" required="yes"/>
<xsl:param name="page" required="yes"/>

<xsl:template match="display-articles">
  <xsl:text>For month "</xsl:text>
  <xsl:value-of select="$month"/>
  <xsl:text>" and page "</xsl:text>
  <xsl:value-of select="$page"/>
  <xsl:for-each select="entry[substring(datum,6,2)=$month and page=$page]">
    <xsl:value-of select="titel"/>


-- Contact us for world-wide XML consulting and instructor-led training Free 5-hour video lecture: XSLT/XPath 1.0 & 2.0 Crane Softwrights Ltd. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Google+ profile: Legal business disclaimers:

Current Thread