Created
June 19, 2026 16:04
-
-
Save otherjoel/3cb0269157aea18038a404b754379554 to your computer and use it in GitHub Desktop.
Splitflap example of Atom feed with XSLT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <?xml-stylesheet href="http://example.com/transform.xsl" type="text/xsl"?> | |
| <feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"> | |
| <title type="text">River City Library Blog</title> | |
| <link rel="self" href="https://example.com/feed.atom" /> | |
| <link rel="alternate" href="http://example.com/blog" /> | |
| <updated>1912-06-21T00:00:00-06:00</updated> | |
| <id>tag:example.com,2012:blog</id> | |
| <generator uri="https://joeldueck.com/what-about/splitflap" version="1.2">Splitflap</generator> | |
| <entry> | |
| <title type="text">Chaucer, Rabelais and Balzac</title> | |
| <link rel="alternate" href="https://example.com/first-post.html" /> | |
| <updated>1912-06-21T00:00:00-06:00</updated> | |
| <published>1912-06-21T00:00:00-06:00</published> | |
| <author> | |
| <name>Marian Paroo</name> | |
| <email>marian@example.com</email> | |
| </author> | |
| <id>tag:example.com,2012:blog.first-post</id> | |
| <content type="html"><article><p>My first post; content TK</p></article></content> | |
| </entry> | |
| </feed> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #lang racket/base | |
| (require racket/file | |
| splitflap) | |
| (define my-id (mint-tag-uri "example.com" "2012" "blog")) | |
| (define my-items | |
| (list | |
| (feed-item | |
| (append-specific my-id "first-post") ; item-specific ID | |
| "https://example.com/first-post.html" ; URL | |
| "Chaucer, Rabelais and Balzac" ; title | |
| (person "Marian Paroo" "marian@example.com") ; author | |
| (infer-moment "1912-06-21") ; publish date | |
| (infer-moment "1912-06-21") ; updated date | |
| '(article (p "My first post; content TK"))))) | |
| (define my-feed | |
| (feed | |
| my-id ; tag URI | |
| "http://example.com/blog" ; site URL | |
| "River City Library Blog" ; Title | |
| my-items)) | |
| (display-to-file | |
| (parameterize ([feed-xslt-stylesheet "http://example.com/transform.xsl"]) | |
| (express-xml my-feed 'atom "https://example.com/feed.atom")) | |
| "feed.atom" #:exists 'replace) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment