f



Displaying only the first 5 articles

Hi,

I'm using an ASP script and an xsl file to display the feed from
Boston.com on a web page.

http://www.boston.com/tools/rss/

It works nicely but I am having trouble limiting the number of
articles (5)displayed on the page. Right now I get all articles and
want to be able to choose how many that are shown.

Appreciate any help.

Here is the xsl file:

<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="*">
<table border="1" width="600" align="center">
<tr><td valign="top" align="center" class="title" bgcolor="silver" >
<a>
<xsl:attribute name="href">
<xsl:value-of select="*[local-name()='channel']/*[local-name()='link']"/>
</xsl:attribute>
<xsl:attribute name="target">
<xsl:text>top</xsl:text>
</xsl:attribute>
<xsl:value-of select="*[local-name()='channel']/*[local-name()='title']"/>
</a>
<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
<xsl:value-of select="*[local-name()='channel']/*[local-name()='lastBuildDate']"/>
</td></tr><tr><td valign="top" bgcolor="ghostwhite" class="headlines"
>
<ul>
<xsl:for-each select="//*[local-name()='item']">
<a>
<xsl:attribute name="href">
<xsl:value-of select="*[local-name()='link']"/>
</xsl:attribute>
<xsl:attribute name="target">
<xsl:text>top</xsl:text>
</xsl:attribute>
<xsl:value-of select="*[local-name()='title']"/>
</a>
|
</xsl:for-each>
</ul>
</td></tr>
</table>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
0
burtl (8)
5/21/2004 9:42:41 AM
comp.text.xml 8781 articles. 0 followers. Post Follow

2 Replies
346 Views

Similar Articles

[PageSpeed] 27

Burt Lewis wrote:
> It works nicely but I am having trouble limiting the number of
> articles (5)displayed on the page. Right now I get all articles and
> want to be able to choose how many that are shown.
>

Assuming that the following snippet is the one that produces the articles,
you could change:

<xsl:for-each select="//*[local-name()='item']">

Into :

<xsl:for-each select="//*[local-name()='item' and position() &lt; 6]">


JW



0
jw137 (829)
5/21/2004 10:47:44 AM
Excellent, exactly what I was looking for. 

Thanks!
0
burtl (8)
5/21/2004 5:23:17 PM
Reply:

Similar Artilces:

Displaying Arabic text in XML
I have an XML schema that I want to modify. I need to change the text from English to Arabic, but I can't seem to be able to do so. <LearningResourceData Type="Session - Tutorial and Workouts"> I want to display the Type attribute in Arabic characters. How can I do that using Unicode or whatever else works? HELP! I am new to XML. Thanks. suhaddad@gmail.com wrote: > I have an XML schema that I want to modify. I need to change the text > from English to Arabic, but I can't seem to be able to do so. > > <LearningResourceData Type="Session - Tutorial and Workouts"> > > I want to display the Type attribute in Arabic characters. How can I do > that using Unicode or whatever else works? I don't speak Arabic so I can't translate "Session - Tutorial and Workouts" to that language for you but as far as having characters from different alphabets in XML you are right, an Unicode encoding like UTF-8 is a way to have your XML encoded in a way so that many different languages/scripts can be used inside of one document e.g. <?xml version="1.0" encoding="UTF-8"?> <text-list> <text xml:lang="en">Session - Tutorial and Workouts</text> <text xml:lang="ru">Встреча - консультация и</text> </text-list> -- Martin Honnen http://JavaScript.FAQTs.com/ Thank you for your help Martin. So, how can I display an at...

No text displays in RiScript 5
If I load a PostScript or PDF file into RiScript 5 I can view the file's graphics but not its text. The following window capture demonstrates the problem: http://www.namesindex.com/files/RiScript.png In this capture I have loaded the RiScript manual. If I load it into Colin Granville's PDF file viewer it displays like this: http://www.namesindex.com/files/PDF.png I've read the relevant parts of the RiScript manuals (using !PDF!) but can't find any clues to a solution. -- Ian A. Chamberlain http://www.humanism.org.uk/ - because RISC OS is not the preserve of Christian...

Re: How to find the first 5 and last 5 data? #5
On Wed, 7 May 2008 13:16:43 -0400, Nat Wooding <Nathaniel.Wooding@DOM.COM> wrote: >Jane > >I just tried to reply to this but I don't think that it went out. > >The following is an update to the code that I sent you last evening. I >added a sort at the end which takes care of the situation of their being >fewer than 10 obs. > >Data one; >input >id var1 var3 ; >cards; >1 2 21 >1 3 56 >1 7 35 >1 8 98 >1 9 22 >1 6 11 >1 4 11 >1 4 10 >1 3 2 >1 4 6 >1 3 18 >2 1 1 >2 ...

file command: "XML document text" vs "XML document text"
I've just used the file command on four files of RDF-XML with the following output: augtfidf.rdf: XML document text kyoto.rdf: XML document text stuff.rdf: XML document text tfidf.rdf: XML document text What does it mean that one of them has an extra space between "XML" and "document"? -- The kid's a hot prospect. He's got a good head for merchandising, an agent who can take you downtown and one of the best urine samples I've seen in a long time. [Dead Kennedys t-shirt] On 16.10.2012 16:06, Adam Funk wrote: > I've just used the file command on four files of RDF-XML with the > following output: > > augtfidf.rdf: XML document text > kyoto.rdf: XML document text > stuff.rdf: XML document text > tfidf.rdf: XML document text > > What does it mean that one of them has an extra space between "XML" > and "document"? Hard to tell without further information. What does file *.rdf | od -c show you? Janis Janis Papanagnou wrote: > On 16.10.2012 16:06, Adam Funk wrote: >> I've just used the file command on four files of RDF-XML with the >> following output: >> >> augtfidf.rdf: XML document text >> kyoto.rdf: XML document text >> stuff.rdf: XML document text >> tfidf.rdf: XML document text >> >> What does it mean that one ...

displaying first 50 characters of a mysql text field?
Hi all I have been searching for hours on the php website for a function that will allow me to display just the first 50 chars of a mysql text field in a results table, but i'm having no luck. I need it to create a results page for a site i'm creating in php. Can anyone help with this problem? Kind regards Marc phpuser32423 wrote: > Hi all > > I have been searching for hours on the php website for a function that > will allow me to display just the first 50 chars of a mysql text field > in a results table, but i'm having no luck. I need it to create a > resu...

Article: Welcome to the new CMS. Read me first. #5
You can view the page at http://tinyurl.com/7smun95 -- Roger Dean Message Origin: [url]http://www.travelonlinedesigns.com[/url] ...

[bind] not working with [text] on first event in 8.5.11
Hi, I'm observing a very weird behavior in the [text]. My Tcl/Tk is 8.5.11 and this seems to be the only version affected (I also = checked 8.5.9 and 8.6). The script to reproduce the problem is very simple: package require Tk pack [text .t] -fill both -expand 1 bind .t <Alt-f> "puts alt-f" Now, run the program and click on the text are to give it an input focus, t= hen press Alt+f (left Alt) twice. You will see that at the first time the l= etter "f" gets typed in the text, but second time the "alt-f" message is pr= inted in console - just like it should be. Important is to not do anything with the text widget before pressing alt+f = (except for focusing it), otherwise the problem doesn't appear. I reproduced it on Linux and Windows (both on Tcl/Tk 8.5.11). Is this just my PC or anyone else can reproduce it? Regards, Googie On 11.07.2012 22:30, Googie wrote: > Is this just my PC or anyone else can reproduce it? Cannot reproduce it on my Windows 7 professional x64 with ActiveTcl 8.5.11.0 Might it be that some applications running in the background on your system result in such a behavior? -- WBR, Eugene. On 7/11/12 1:46 PM, Eugene wrote: > On 11.07.2012 22:30, Googie wrote: >> Is this just my PC or anyone else can reproduce it? > Cannot reproduce it on my Windows 7 professional x64 with ActiveTcl 8.5.11.0 > Might it be that some applications running in the background ...

What XML technologies to learn first for "XML Processing" and "XML Mapping"?
Hi, Doing job interviews. I know XML basics, but I want to familiarize myself with the best that XML has to offer at the moment. What do I need to learn? In other words, what is the dominant XML technology being used at the moment for processing? What is the 'struts' of the XML world? I've used a bit of JDOM, DOM4J, and JAXB. I know there are other xml-to-java serialization-type technologies out there that are less cumbersome - which do I need to know first? Which are most interesting? Which could become market leaders? Also, what are alternatives, if any, to XML? I know...

Full text index discards first record from returned set on MySql 5.1.70
Hello people I am using full-text index from 6 years to now, and never found problems, b= ut now I am seeing extrange behaviour with this index and trying understand= the reason of it. I have two mirror servers (including databases but different MySql versions= ), so I can esasily compare them to verify one of them (older version) disp= lays always expected set of records, but the newer version retries a slight= ly different set when using full-text index. All tests were performed using= words with 4 or more characters to ensure use of "against" ... "in bolean = m...

Running winecfg has No text or damaged text displayed
below is a discription of a "fix" for this problem from the wiki wine page but i dont understand how the registry is relevant since i dont have windows on this box. please help 6.18. Running winecfg has No text or damaged text displayed or 6.19. Using wine over remote X11 sessions and No text or damaged text displayed Please make sure not have added any fonts to wine. Font conflicts can sometimes cause a similar issue. If a fresh wine prefix.(A copy of wine that nothing has been done to yet) Is having this problem. Try setting following in registry [HKEY_CURRENT_...

Read and display Japanese text from text file
Hi there, a while ago, I posted a question regarding reading japanese text from a text file. Well, since I solved the problem, I thought I'd post my solution for the benefit of other people with the same problem. The plan was to make a script to read and display japanese text. I will use it for making a japanese proverb script and for a japanese language study script. Method : I wrote a simple kanji text file (saved with UTF-8 encoding) I wrote a simple PHP script to display the file contents (saved with UTF-8 encoding) I specified the content-type header for the HTML page : <meta h...

How to find the first 5 and last 5 data?
Hi All I have a question to find out the 1st and last 5 subjects according to the rank of other variables. The dataset like: id var1 var3 ----------------- 1 2 21 1 3 56 1 7 35 1 8 98 ....... I want to pick the 1st 5 and last 5 rows for var3 according to var1 for each id. Hope I make the question clearly. Thanks all! Jane ...

Non-XML tagged value text to XML
I would like to use XSLT to translate some tagged value text to XML elements like this: Input Doc: <data>x=1.234 y=ABC z="Hello World"</data> Output Doc: <x>1.234</value> <y>ABC</y> <z>&quot;Hello World&quot;</z> Is XSLT up to the task? What would it look like? Most of the XSLT string processing code I've seen looks very verbose - can't be too efficient. mikea_59 wrote: > I would like to use XSLT to translate some tagged value text to XML > elements like this: > > Input Doc: > > <data>x=1.234 y=ABC z="Hello World"</data> > > Output Doc: > > <x>1.234</value> > <y>ABC</y> > <z>&quot;Hello World&quot;</z> > > Is XSLT up to the task? What would it look like? Most of the XSLT > string processing code I've seen looks very verbose - can't be too > efficient. Using XSLT 2.0 you can do that with regular expression matching as follows: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="xml" encoding="UTF-8" indent="yes" /> <xsl:template match="/"> <results> <xsl:apply-templates /> </results> </xsl:template> <xsl:template match="data"...

First FAR CRY review up.. 5 / 5
Here is another one... http://www.hexus.net/content/reviews/review.php?dXJsX3Jldmlld19JRD05MjM= Call me an old dog if you like, but no saves mean no play. I've spent too much of my life replaying missions with no player saves and I'm not going back to that ever again. On 10 Dec 2004 00:11:28 -0800, hog.badger@mbox.bol.bg (Paddy) wrote: >Here is another one... >http://www.hexus.net/content/reviews/review.php?dXJsX3Jldmlld19JRD05MjM= > >Call me an old dog if you like, but no saves mean no play. I've spent >too much of my life replaying missions with no player save...

RE: [ace-users] XML service configuration no longer works with ACE/TAO 5.4.5/1.4.5
Hi, > Well, it did definiteley work with 5.4.4. So any changes that > broke it must > have been made between 5.4.4 and 5.4.5. I also read in the > release email of > 5.4.5 in the CIAO section: > > The Config Handlers have been modified to use XML parsing code > � generated by the XML Schema Compiler (XSC). �Binary releases of XSC > � can currently be found at > (http://www.dre.vanderbilt.edu/~boris/xsc), > � and a recent snapshot of the CVS repository can be found at > � (http://www.dre.vanderbilt.edu/~wotte/xsc.tbz2). �We plan > to integrate > � XSC into the CVS repo and release soon. This is CIAO only, there must be a change in ACEXML or ACE that has done this. The ACEXML library has it own changelog > I don't know if that affects only CIAO or ACE as well, but it > might be > related. > > I would be still glad if someone has any pointers/ideas where > exactely I > should spend my time efficiently in order to investigate the problem. > > P.S. > Aren't there any nightly build configuration(s) that uses XML > rather than the > old service configuration? No, so far as I know there are no builds testing this. Another option you have is pass this on to a commercial support organization and also sponsor then an autobuild with xml service config files. Regards, Johnny Willemsen Remedy IT Postbus 101 2650 AC Berkel en Rodenrijs The ...

[tao-users] RE: [ace-users] XML service configuration no longer works with ACE/TAO 5.4.5/1.4.5
Hi Lothar > � � ACE VERSION: 5.4.5 Thanks for using the PRF form. Could you try to find the problem and send us patches to fix this? Regards, Johnny Willemsen Remedy IT Postbus 101 2650 AC Berkel en Rodenrijs The Netherlands www.theaceorb.nl / www.remedy.nl > > � � HOST MACHINE and OPERATING SYSTEM: > uname -a > Linux janus 2.6.11.4-20a-default #1 Wed Mar 23 21:52:37 UTC > 2005 x86_64 x86_64 > x86_64 GNU/Linux > > � � TARGET MACHINE and OPERATING SYSTEM, if different from HOST: > � � COMPILER NAME AND VERSION (AND PATCHLEVEL): > gcc-4.0.0 --version > gcc-4.0.0 (GCC) 4.0.0 > > � � CONTENTS OF $ACE_ROOT/ace/config.h [if you use a link to > a platform- > � � specific file, simply state which one]: > cat /opt2/linux/x86_64/ACE/1.4.4/ACE_wrappers/ace/config.h > #define ACE_HAS_XML_SVC_CONF > #include "ace/config-linux.h" > > � � CONTENTS OF > $ACE_ROOT/include/makeinclude/platform_macros.GNU (unless > � � this isn't used in this case, e.g., with Microsoft Visual C++): > cat > /opt2/linux/x86_64/ACE/1.4.4/ACE_wrappers/include/makeinclude/ > platform_macros.GNU > > # configure ACE/TAO for our use > > debug=1 > optimize=1 > exceptions=1 > threads=1 > inline=1 > rtti=1 > versioned_so=1 > interface_repo=1 > ssl=1 > > include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU ...

RE: [tao-users] RE: [ace-users] XML service configuration no longer works with ACE/TAO 5.4.5/1.4.5
Hi, > > Hi Lothar > > > > > � � ACE VERSION: 5.4.5 > > > > Thanks for using the PRF form. Could you try to find the > problem and send > > us patches to fix this? > > > > Regards, > > > > Johnny Willemsen > > I have no problem committing some time to the problem. I do > however know as > much as nothing about the ACE XML parser and it's recent > changes. It seems to > me that (some) of the recent changes might have caused the > test failures. So > if someone working actively on ACEXML gives me directions I > am willing to > spend my time investigating the problem. I can't remember that work has been done the last months so I am also amazed things broke. Nobody is actively working on it, so I think there are not much directions at this moment. Regards, Johnny Willemsen Remedy IT Postbus 101 2650 AC Berkel en Rodenrijs The Netherlands www.theaceorb.nl / www.remedy.nl On Wednesday 18 May 2005 11:01, Johnny Willemsen wrote: > Hi, > I can't remember that work has been done the last months so I am also > amazed things broke. Nobody is actively working on it, so I think there are > not much directions at this moment. Well, it did definiteley work with 5.4.4. So any changes that broke it must have been made between 5.4.4 and 5.4.5. I also read in the release email of 5.4.5 in the CIAO...

mixing raw xml display w/ formated display
I am an xml beginner trying to figure out if xml will be a good tool for a problem. I want to use the functionality associated with viewing raw xml files (namely the expanding +'s and -'s), but I also want to not display elements. For example, if I had: <name attr='Person 1'> <first>Carl</first> <last>Strange</last> </name> <name attr='Person 2'> <first>Jules</first> <last>Verne</last> </name> I would want it to display as + Person 1 + Person 2 where I could then expand it to: - Person 1 Carl Strange + Person 2 Any recommendations? Is this easy in xml? Or is some other tool better? Thanks blank101 wrote: > I want to use the functionality associated with viewing raw xml files > (namely the expanding +'s and -'s) Raw XML files are text files so if you view them raw then you should only the markup. What you describe is what some browsers do (namely IE 5/6 on Win and Mozilla browsers) which apply some XSLT default stylesheet to XML not associated otherwise with a stylesheet to create a HTML document displaying the XML as a tree structure that can be collapsed and expanded with the help of script. > but I also want to not display > elements. > > For example, if I had: > > <name attr='Person 1'> > <first>Carl</first> > <last>Strange</last> > </name> &...

XML DOM: XML/XHTML inside a text node
In my program, I get input from the user and insert it into an XHTML document. Sometimes, this input will contain XHTML, but since I'm inserting it as a text node, xml.dom.minidom escapes the angle brackets ('<' becomes '&lt;', '>' becomes '&gt;'). I want to be able to override this behavior cleanly. I know I could pipe the input through a SAX parser and create nodes to insert into the tree, but that seems kind of messy. Is there a better way? Thanks. On Thu, 2 Nov 2005 noahlt@gmail.com wrote: > In my program, I get input from the us...

Microsoft VM Display Problems with Clarion 5.5
Has anyone experienced a problem with the display of C55 web-app browse windows running under certain versions of I.E. (Win2K and WinXP). The font on the browse windows is really tiny. This appears to be related to different (newer) versions of Microsoft VM (which is not installed by default on WinXP anymore). Any comments or assistance would be appreciated. Thank you. C. Thompson Oasis Software ...

xml wrongly views as text extracted from the xml tags
we have a java framework, where we feed a request xml. this request xml is forwarded through the framework, tomcat and axis, for the backend processing, and the processing results are again received by the internet explorer, after they are transformed with an xslt by the framework. now the problem that we are facing is like - the explorer extracts the text inside all xml tags of the response xml and shows it as simple text. but, if you view the source of the 'text', it will show it all as well-formed xml. moreover, if you save the source as an xml file, and again open it through internet explorer, it will show the xml in proper way. i have tried using firefox, processing with xml spy, but with same results... has somebody experienced similar problem before??? i wonder what can be wrong in this case, and would be thankful for any pointers as to what can be the cause and solution to this. Thanks in advance, Shreyas Hi all, Finally i got what was the problem. it was because the response xml contained a <Title> </Title> tag in it. and dont know why/how, but IE was treating it as an HTML tag. i noticed that the browser window title was indeed "Mr" which is the text enclosed by the Title element. one more weird thing i noticed was that if i moved the <xsl:apply-templates> line for the tag downwords after one more template application, it was showing the xml properly alongwith the <Title> element, and not treating it as an HTML tag...

Images are loaded in IE 6 and 5.5, but not displaying until ...
NOTE: For me this is only happening in IE 6 and 5.5 on WinXP. I'm setting up a photo gallery for a friends photography site. The page in question, which is on my test site (http://getmooned.com/test/rrp/g/g01.htm), opens fine with all of the thumbnails, etc. However, when a thumbnail is clicked, the larger image does not appear. The only thing you see is the gray box where the image should be. If I right-click on the "blank" image, and click Show Image, the image appears. Before you ask, yes my settings are such that images should display. In fact, when I look at the pages local...

5.22 to 5.5
So here's the big question-- if I just bought 5.2 a couple of weeks ago...will I have to pay for the upgrade to 5.5? (That would suck.) Thanks, Bryan In article <bpdn10$1kc$1@news.fsr.net>, Bryan C. Green <bcgreen@motioncode.com> wrote: > So here's the big question-- if I just bought 5.2 a couple of weeks > ago...will I have to pay for the upgrade to 5.5? (That would suck.) There is always a free upgrade period for each major release of REALbasic -- if you purchased RB after a certain date, you get the new version free. However, since 5.5 hasn&...

IE 5.5 wants to download, not display, home page
On our company LAN, which is separate from our Web site host, most of our employees can get to our Web site, http://www.sfmuni.com, with no problem. However, one employee, when going to that URL, gets the message You have chosen to download a file from this location: / from sfmuni[1] Note that it says "sfmuni[1]" and not "sfmuni.com" or "www.sfmuni.com". The employee is using Internet Explorer 5.50.4522.1800 and Windows 2000. She reports there is no \WINNT\HOSTS file on her computer. What could be causing this, and how do we correct it? Tha...

Web resources about - Displaying only the first 5 articles - comp.text.xml

List of mammals displaying homosexual behavior - Wikipedia, the free encyclopedia
For these mammals, there is documented evidence of homosexual behavior of one or more of the following kinds: sexual behavior , courtship , affection ...

Facebook Displaying Page Insights On Page Admins’ Personal Pages?
Some Facebook page administrators are seeing modules on their personal pages displaying page insights ad, campaign , and like totals for pages ...

Facebook Displaying Unread Messages from Pages in a New Updates Module
Facebook is displaying a new “Updates” sidebar module which shows some users unread messages sent to them by Pages. Users will see the Updates ...

Don Lemon Holds Up Sign Displaying the N-Word, Uncensored, on Air CNN Live - YouTube
Don Lemon Holds Up Sign Displaying the N-Word, Uncensored, on Air Lemon held up a Confederate flag first before holding up the sign. He asked, ...

Hazelwood coal mine fire: Morwell residents displaying symptoms similar to cigarette smokers, expert ...
An expert says some locals near Victoria's Hazelwood mine fire have symptoms similar to cigarette smokers.

Police accused of displaying fake G20 weapons
Toronto's top police officer misled the public by displaying fake weapons used in a medieval-themed role-playing game to help justify their actions ...

No charges for U.S. host for displaying high-capacity magazine on TV
NBC television journalist David Gregory won't face charges for displaying a high-capacity ammunition magazine on his "Meet the Press" news program ...

Jays' Escobar suspended three games for displaying slur
Toronto Blue Jays shortstop Yunel Escobar has been suspended three games for displaying a homophobic slur on his eye-black during a game on Saturday. ...

Google Play Store now displaying age-based ratings
We reported back in May that Google was adding age-based ratings to all apps in the Play Store as determined by the International Age Rating ...

Apple displaying Ferraris & other cars at WWDC hinting at CarPlay announcements
... 2014 Filed under: AAPL Company , iOS Continue reading more about AAPL Company and iOS at 9to5Mac . What do you think? Discuss "Apple displaying ...

Resources last updated: 3/14/2016 12:49:32 AM