You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by js...@apache.org on 2002/10/22 10:10:12 UTC

cvs commit: jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/html radioToPDA.jelly

jstrachan    2002/10/22 01:10:12

  Modified:    jelly    maven.xml
  Added:       jelly/src/test/org/apache/commons/jelly/html
                        radioToPDA.jelly
  Log:
  Added a simple Jelly script which converts the HTML output by Radio Userland's RSS aggregator to a simple HTML format without any tables that is readable by PDAs such as my Sharp Zaurus.
  This little script enables me to download RSS news feeds to my PDA and read it on the commute to work! Hooary!
  
  Revision  Changes    Path
  1.41      +22 -0     jakarta-commons-sandbox/jelly/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/maven.xml,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- maven.xml	10 Oct 2002 22:19:18 -0000	1.40
  +++ maven.xml	22 Oct 2002 08:10:12 -0000	1.41
  @@ -526,5 +526,27 @@
       </java>
     </goal>
   
  +  <goal name="test:discovery" prereqs="jelly-task">
  +    <java classname="org.apache.commons.jelly.impl.TestTagLibraryResolver" fork="yes">
  +      <classpath refid="test.classpath"/>
  +      <sysproperty key="org.apache.commons.logging.simplelog.defaultlog" value="debug"/>
  +    </java>
  +  </goal>
  +
  +  <goal name="demo:compactxml" prereqs="jelly-task">
  +  	<mkdir dir="build/compactxml"/>
  +  	
  +		<xslt basedir="." destdir="build/compactxml" 
  +			includes="*.xml" extension=".cml" style="src/script/asCompact.xsl"/>
  +  </goal>
  +
  +
  +  <goal name="demo:radio2pda" prereqs="jelly-task" 
  +		description="Converts the HTML news output of Radio Userland to simple HTML viewable on a PDA">
  +    <java classname="org.apache.commons.jelly.Jelly" fork="yes">
  +      <classpath refid="test.classpath"/>
  +      <arg value="src/test/org/apache/commons/jelly/html/radioToPDA.jelly"/> 
  +    </java>
  +  </goal>
   
   </project>
  
  
  
  1.1                  jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/html/radioToPDA.jelly
  
  Index: radioToPDA.jelly
  ===================================================================
  <?xml version="1.0"?>
  <j:jelly 
  	xmlns:j="jelly:core" 
  	xmlns:x="jelly:xml" 
  	xmlns:html="jelly:html" 
  	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:file name="target/radio.html" outputMode="html">
  		<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="*"/>
  			</jsl:template>
  				
  			<jsl:template match="tr">
  				<br />
  				<div>
  					<jsl:applyTemplates select="*"/>
  				</div>
  			</jsl:template>
  				
  			<jsl:template match="script|img|input"/>
  		
  			<!-- pass through all other elements -->
  			<jsl:template match="*">
  				<jsl:copy>
  					<jsl:applyTemplates/>
  				</jsl:copy>
  			</jsl:template>
  
  			<jsl:template match="@*"/>
  		</jsl:stylesheet>
  	</j:file> 
  	
  </j:jelly>
  
  
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>