Last change
on this file since 27087 was 27087, checked in by ak19, 11 years ago |
Implemented RSS support for GS3. At present, can see this with a=rss in the url, when a collection is built. Soon will have a button (at least for the GS3 demo collection).
|
File size:
1.6 KB
|
Line | |
---|
1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
2 | <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="xsl">
|
---|
3 | <!-- exclude-result-prefixes="#default">-->
|
---|
4 |
|
---|
5 | <!-- http://www.xml.com/lpt/a/1027 -->
|
---|
6 | <xsl:output method="xml" version="1.0" encoding="utf-8"/>
|
---|
7 |
|
---|
8 | <!-- set page title -->
|
---|
9 |
|
---|
10 | <xsl:template name="pageTitle">RSS feed</xsl:template>
|
---|
11 |
|
---|
12 | <!-- select only the rss child of /page/pageResponse and then copy all its attributes and
|
---|
13 | descendant elements and their attributes too into the output
|
---|
14 | http://stackoverflow.com/questions/1141216/xsl-copy-the-entire-xml-except-a-parent-node-but-keep-its-child-node
|
---|
15 | http://stackoverflow.com/questions/5378610/copy-xml-document-with-all-elements-except-a-black-list-of-elements
|
---|
16 | http://stackoverflow.com/questions/5876382/using-xslt-to-copy-all-nodes-in-xml
|
---|
17 |
|
---|
18 | To do a straightforward copy of input into output:
|
---|
19 | <xsl:template match="/">
|
---|
20 | <xsl:copy-of select="." />
|
---|
21 | </xsl:template>
|
---|
22 | -->
|
---|
23 |
|
---|
24 | <!-- This should work without requiring further templates. Find out why it doesn't work
|
---|
25 | <xsl:template match="/page/pageResponse/rss">
|
---|
26 | <xsl:apply-templates />
|
---|
27 | </xsl:template>
|
---|
28 | -->
|
---|
29 | <!-- Even this doesn't work
|
---|
30 | <xsl:template match="/page">
|
---|
31 | <xsl:apply-templates />
|
---|
32 | </xsl:template>
|
---|
33 | -->
|
---|
34 |
|
---|
35 | <xsl:template match="/page">
|
---|
36 | <xsl:apply-templates select="pageResponse/rss"/>
|
---|
37 | </xsl:template>
|
---|
38 |
|
---|
39 | <!--Identity template, copies all content of matching template(s) into the output -->
|
---|
40 | <xsl:template match="@* | node()">
|
---|
41 | <xsl:copy>
|
---|
42 | <xsl:apply-templates select="@* | node()"/>
|
---|
43 | </xsl:copy>
|
---|
44 | </xsl:template>
|
---|
45 |
|
---|
46 | </xsl:stylesheet>
|
---|
47 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.