[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Select first two elements

Subject: RE: Select first two elements
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sat, 14 Jan 2006 08:28:10 -0000
select first
You've probably forgotten that the element names are in a namespace, but
since you haven't shown us your failing code, we can only guess what you've
done wrong.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: mac.rost@xxxxxxxxx [mailto:mac.rost@xxxxxxxxx] 
> Sent: 14 January 2006 06:05
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [Norton AntiSpam]  Select first two elements
> 
> It's been a while since I have done any XSL (maybe 2 1/2 
> years!) I have a 
> friend that wants his last 2 posts from an atom xml feed to 
> show. I'm *trying* 
> to get any for loop that I can find in xsl to work, but 
> nothing is at all.
> 
> Basic structure is like so:
> <feed>
>      <entry>
>            <title></title>
>            <content></content>
>      </entry>
>      ...
>      ...
> </feed>
> 
> I just need to be able to select the first two in the xml 
> doc. Once I can get 
> this, you won't hear a peep from me in another two years!
> 
> example:
> ==================================
> <feed xmlns="http://purl.org/atom/ns#" version="0.3" xml:lang="en-US">
> 	<link href="https://www.blogger.com/atom/6526525" 
> rel="service.post" 
> title="Quality Crash Tests" type="application/atom+xml"/>
> 	<link href="https://www.blogger.com/atom/6526525" 
> rel="service.feed" 
> title="Quality Crash Tests" type="application/atom+xml"/>
> 	<title mode="escaped" type="text/html">Quality Crash 
> Tests</title>
> 	<tagline mode="escaped" type="text/html">You make me 
> dizzy, running 
> circles in my head. One of these days I'll chase you down. </tagline>
> 	<link href="http://www.qualitycrashtests.com/blog.html" 
> rel="alternate" 
> title="Quality Crash Tests" type="text/html"/>
> 	<id>tag:blogger.com,1999:blog-6526525</id>
> 	<modified>2005-11-18T04:08:17Z</modified>
> 	<generator url="http://www.blogger.com/" 
> version="5.15">Blogger</generator>
> 	<info mode="xml" type="text/html">
> 		<div xmlns="http://www.w3.org/1999/xhtml">This 
> is an Atom 
> formatted XML site feed. It is intended to be viewed in a 
> Newsreader or 
> syndicated to another site. Please visit the <a 
> href="http://help.blogger.com/bin/answer.py?answer=697">Blogge
> r Help</a> for 
> more info.</div>
> 	</info>
> 	<convertLineBreaks 
> xmlns="http://www.blogger.com/atom/ns#">true</convertLineBreaks>
> 	<entry xmlns="http://purl.org/atom/ns#">
> 		<link 
> href="https://www.blogger.com/atom/6526525/113228545952389772" 
> rel="service.edit" title="Testing" type="application/atom+xml"/>
> 		<author>
> 			<name>B</name>
> 		</author>
> 		<issued>2005-11-17T21:43:00-06:00</issued>
> 		<modified>2005-11-18T03:44:19Z</modified>
> 		<created>2005-11-18T03:44:19Z</created>
> 		<link 
> href="http://www.qualitycrashtests.com/2005/11/testing.html" 
> rel="alternate" 
> title="Testing" type="text/html"/>
> 		<id>tag:blogger.com,1999:blog-6526525.post-
> 113228545952389772</id>
> 		<title mode="escaped" type="text/html">Testing</title>
> 		<content type="application/xhtml+xml" 
> xml:base="http://www.qualitycrashtests.com/blog.html" 
> xml:space="preserve">
> 			<div 
> xmlns="http://www.w3.org/1999/xhtml">I'm testing 
> to see if the change I just made is working. Maybe. Maybe not.</div>
> 		</content>
> 		<draft 
> xmlns="http://purl.org/atom-blog/ns#">false</draft>
> 	</entry>
> 	<entry xmlns="http://purl.org/atom/ns#">
> 		<link 
> href="https://www.blogger.com/atom/6526525/113211592413384759" 
> rel="service.edit" title="President Who?" 
> type="application/atom+xml"/>
> 		<author>
> 			<name>B</name>
> 		</author>
> 		<issued>2005-11-15T22:30:00-06:00</issued>
> 		<modified>2005-11-16T04:38:44Z</modified>
> 		<created>2005-11-16T04:38:44Z</created>
> 		<link 
> href="http://www.qualitycrashtests.com/2005/11/president-
> who.html" rel="alternate" title="President Who?" type="text/html"/>
> 		<id>tag:blogger.com,1999:blog-6526525.post-
> 113211592413384759</id>
> 		<title mode="escaped" 
> type="text/html">President Who?</title>
> 		<content type="application/xhtml+xml" 
> xml:base="http://www.qualitycrashtests.com/blog.html" 
> xml:space="preserve">
> </content>
> </entry>
> </feed>

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.