Managing Groups of Elements?

Subject: Managing Groups of Elements?
From: Nigel Byrnes <byrnes@xxxxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 02 Jul 1999 10:31:44 +0100
Hi all XSL-ers

Considering the following DTD:

<!ELEMENT news (title, newsItem*)>
<!ELEMENT title (#PCDATA)>

<!ELEMENT newsItem (headline, strapline, link)>
<!ELEMENT headline (#PCDATA)>
<!ELEMENT strapline (#PCDATA)>

For an example of what the XML document might look, check out Listing
One at the foot of the mail.

The problem is that the number of newsItems may be too large to fit on
one screen. Indeed I have a requirement to fit no more than four
newsItems on one page. In cases where there are more than four, a link
should be present at the bottom of the page to navigate to the next

My current progress on this problem is shown in Listing Two. I have
managed to create a template which creates a HTML page but without any
management of the newsItem elements.

Any help on this problem will be appreciated. Thanks in advance,


============== Listing One: ======================
<?XML version="1.0" encoding="UTF-8"?>
 <title>Todays Top Stories</title>
  <headline>House Prices Still On The Rise</headline>
  <newsItem>The latest property market survey released by the Halifax
found the increase in house prices continued through June, with the
average up 1.8% to £76,877.</newsItem>




============= Listing Two: =========================

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="";>

<xsl:template match="NEWS">
  <title>Nigel's Yahoo News Content Negotiation Demonstration</title>
  <h1><xsl:value-of select=".//TITLE"/></h1>
   <xsl:for-each select=".//NEWSITEM">
  <h2><xsl:value-of select=".//HEADLINE"/></h2>
   <xsl:value-of select=".//STRAPLINE"/>
   <xsl:element name="a">
   <xsl:attribute name="href">
    <xsl:value-of select=".//LINK"/></xsl:attribute>


begin:          vcard
fn:             Nigel Byrnes
n:              Byrnes;Nigel
org:            Philips Research
email;internet: byrnes@xxxxxxxxxxxxxxxxxxxxxxxx
title:          Research Scientist
note:           <BR>Software Engineering and Appications Group<BR>Philips Research Labs<BR> Cross Oak Lane<BR>Redhill<BR>Surrey<BR>RH1 5LA<BR>UK<P>Phone: +44 (0) 1293 815 578<BR>Fax: +44 (0) 1293 815 500<BR>GSM: 07899 940 391
x-mozilla-cpt:  ;0
x-mozilla-html: TRUE
version:        2.1
end:            vcard

Current Thread