xsl-list
[Top] [All Lists]

[xsl] Stream processing a web site that streams XML

2014-06-18 04:33:25
Hi Folks,

This web site emits a continuous stream of XML:

http://xmpp.wordpress.com:8008/firehose.xml?type=text/plain

(Neat! Thanks George!)

You can open a browser and plug in that URL to see the XML. The XML is a stream 
of Atom <entry> elements inside a <stream> root element.

I wrote an XSLT program which uses the new XSLT 3.0 stream-processing 
capability. The XSLT program connects to the web site and then outputs the 
value of each Atom <title> element. Below is my XSLT program. When run it 
produces an unending stream of titles. Very cool.

Here is my XSLT program:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                xmlns:atom="http://www.w3.org/2005/Atom";
                version="3.0">
    
    <xsl:template match="/">
        <xsl:stream 
href="http://xmpp.wordpress.com:8008/firehose.xml?type=text/plain";>
            <xsl:for-each select="stream/atom:entry/atom:source/atom:title">
                <xsl:message>
                    <xsl:value-of select="." />
                </xsl:message>
            </xsl:for-each>
        </xsl:stream>
    </xsl:template>
    
</xsl:stylesheet>
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>
  • [xsl] Stream processing a web site that streams XML, Costello, Roger L. costello(_at_)mitre(_dot_)org <=