| <?xml version="1.0"?> |
| <!-- |
| Copyright 2002,2004 The Apache Software Foundation. |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| <j:jelly |
| xmlns:j="jelly:core" |
| xmlns:x="jelly:xml" |
| xmlns:html="jelly:html" |
| xmlns:log="jelly:log" |
| xmlns:jsl="jelly:jsl"> |
| |
| <!-- |
| || This script parsers the current news using Radio Userland's news aggregator |
| || and then outputs it in a simple HTML format that can be read easily on a PDA |
| --> |
| |
| <html:parse var="doc" html="http://127.0.0.1:5335/system/pages/news"/> |
| |
| <j:if test="${empty(outputFile)}"> |
| <j:set var="outputFile" value="target/radio.html"/> |
| </j:if> |
| |
| <log:info>About to generate file ${outputFile}</log:info> |
| |
| <j:file name="${outputFile}" outputMode="html" encoding="ISO-8859-1"> |
| <jsl:stylesheet select="$doc"> |
| <jsl:template match="/"> |
| <jsl:applyTemplates/> |
| </jsl:template> |
| |
| <!-- strip out these elements--> |
| <jsl:template match="form|table|td|center"> |
| <jsl:applyTemplates select="child::node()"/> |
| </jsl:template> |
| |
| <jsl:template match="tr"> |
| <br /> |
| <div> |
| <jsl:applyTemplates select="child::node()"/> |
| </div> |
| </jsl:template> |
| |
| <jsl:template match="script|img|input"/> |
| |
| <!-- pass through all other elements --> |
| <jsl:template match="*" trim="false"> |
| <jsl:copy> |
| <jsl:applyTemplates/> |
| </jsl:copy> |
| </jsl:template> |
| |
| <jsl:template match="@*"/> |
| </jsl:stylesheet> |
| </j:file> |
| |
| </j:jelly> |
| |
| |