commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject cvs commit: jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/html textScript.txt example2.jelly example.jelly
Date Fri, 19 Jul 2002 23:03:01 GMT
jstrachan    2002/07/19 16:03:01

  Modified:    jelly/src/java/org/apache/commons/jelly/tags/html
                        ParseTag.java
               jelly    maven.xml
               jelly/src/test/org/apache/commons/jelly/html example.jelly
  Added:       jelly/src/test/org/apache/commons/jelly/html textScript.txt
                        example2.jelly
  Log:
  Patched the HTML parser so that the default behaviour is to preserve case of the HTML tags,
using the first tag as the decider if the cases are different.
  
  Also created a demo to show how the NekoHTML parser can handle plain text too; so we could
use this mechanism to parse text files containing Jelly script
  
  Revision  Changes    Path
  1.2       +10 -1     jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/html/ParseTag.java
  
  Index: ParseTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/html/ParseTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ParseTag.java	19 Jul 2002 22:19:32 -0000	1.1
  +++ ParseTag.java	19 Jul 2002 23:03:00 -0000	1.2
  @@ -123,6 +123,15 @@
        */    
       protected SAXReader createSAXReader() throws Exception {
           // installs the NeckHTML parser
  -        return new SAXReader( new SAXParser() );
  +        SAXParser parser = new SAXParser();
  +        parser.setProperty(
  +            "http://cyberneko.org/html/properties/names/elems",
  +            "match"
  +        );
  +        parser.setProperty(
  +            "http://cyberneko.org/html/properties/names/attrs",
  +            "match"
  +        );
  +        return new SAXReader( parser );
       }
   }
  
  
  
  1.15      +12 -0     jakarta-commons-sandbox/jelly/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/maven.xml,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- maven.xml	19 Jul 2002 22:19:32 -0000	1.14
  +++ maven.xml	19 Jul 2002 23:03:00 -0000	1.15
  @@ -198,6 +198,18 @@
       </java>
     </goal>
   
  +  <goal name="demo:text" prereqs="jelly-task" 
  +	description="Runs the example of parsing text with tags via jelly">
  +	
  +<!--	
  +	<jelly file="src/test/org/apache/commons/jelly/html/example2.jelly"/> 
  +-->	
  +    <java classname="org.apache.commons.jelly.Jelly" fork="yes">
  +      <classpath refid="test.classpath"/>
  +      <arg value="src/test/org/apache/commons/jelly/html/example2.jelly"/> 
  +    </java>
  +  </goal>
  +
     <goal name="demo:jeez" prereqs="jelly-task" 
   	description="A demo of the jeez taglib">
   	
  
  
  
  1.2       +1 -1      jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/html/example.jelly
  
  Index: example.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/html/example.jelly,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- example.jelly	19 Jul 2002 22:19:31 -0000	1.1
  +++ example.jelly	19 Jul 2002 23:03:01 -0000	1.2
  @@ -5,7 +5,7 @@
   
     The title is: 
     
  -  <x:expr select="$doc/HTML/HEAD/TITLE"/>
  +  <x:expr select="$doc/html/head/title"/>
   
     <j:whitespace>
     	
  
  
  
  1.1                  jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/html/textScript.txt
  
  Index: textScript.txt
  ===================================================================
  this is some text
  
  <foo:bar name="a custom tag!">
  
  this is some more text
  
  <j:forEach select="${foo.bar}">
    do something
    ${12 + 12}
  </j:forEach>
  
  end of the page...  		  	
  
  
  1.1                  jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/html/example2.jelly
  
  Index: example2.jelly
  ===================================================================
  <?xml version="1.0"?>
  <j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:html="jelly:html">
  
    <html:parse var="doc" html="textScript.txt"/>
  
    <j:whitespace>
    	
    The XML of the document is
    
    <x:copyOf select="$doc"/>
    
    </j:whitespace>
    
  </j:jelly>
  
  
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message