Author: gvanmatre Date: Thu Jan 5 19:27:35 2006 New Revision: 366405 URL: http://svn.apache.org/viewcvs?rev=366405&view=rev Log: Fixed a table header <TH> parsing problem.
Modified: struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/beans/ConfigDefinitionsWatchdogFilter.java struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/parser/Parser.java struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/parser/ParserTestCase.java Modified: struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/beans/ConfigDefinitionsWatchdogFilter.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/beans/ConfigDefinitionsWatchdogFilter.java?rev=366405&r1=366404&r2=366405&view=diff ============================================================================== --- struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/beans/ConfigDefinitionsWatchdogFilter.java (original) +++ struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/config/beans/ConfigDefinitionsWatchdogFilter.java Thu Jan 5 19:27:35 2006 @@ -53,7 +53,7 @@ /** * <p>Trigger reloading of the [EMAIL PROTECTED] org.apache.shale.clay.component.Clay}'s - * xml configuration files if the <code>auto-reload-clay-files</code> init + * xml configuration files if the <code>org.apache.shale.clay.AUTO_RELOAD_CONFIG_FILES</code> init * parameter is set to <code>true</code> in the web.xml. The HTML templates * are re-cashed on-demand due to their atomicity. The XML configuration * files are shared by all [EMAIL PROTECTED] org.apache.shale.clay.component.Clay} Modified: struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/parser/Parser.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/parser/Parser.java?rev=366405&r1=366404&r2=366405&view=diff ============================================================================== --- struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/parser/Parser.java (original) +++ struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/parser/Parser.java Thu Jan 5 19:27:35 2006 @@ -144,7 +144,7 @@ * <p>This array of parent tags is cross referenced by the * <code>OPTIONAL_ENDING_TAG</code> array.</p> */ - private static final String[][] TAG_PARENTS = {{"TABLE", "TBODY"}, {"TABLE", "TBODY"}, {"TR"}, {"OL", "UL"}, {"DL"}, {"DL"}, {"DL"}, {"SELECT"}}; + private static final String[][] TAG_PARENTS = {{"TABLE", "TBODY"}, {"TR"}, {"TR"}, {"OL", "UL"}, {"DL"}, {"DL"}, {"DL"}, {"SELECT"}}; /** * <p> Modified: struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/parser/ParserTestCase.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/parser/ParserTestCase.java?rev=366405&r1=366404&r2=366405&view=diff ============================================================================== --- struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/parser/ParserTestCase.java (original) +++ struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/parser/ParserTestCase.java Thu Jan 5 19:27:35 2006 @@ -270,6 +270,7 @@ // lazy html doc1 .append("<table>") + .append("<tr><th>Test") .append("<tr><td>") .append("<ol><li>1<li>2<li>3</ol>") .append("<tr><td>") @@ -284,6 +285,7 @@ StringBuffer doc2 = new StringBuffer(); doc2 .append("<table>") + .append("<tr><th>Test</th></tr>") .append("<tr><td>") .append("<ol><li>1</li><li>2</li><li>3</li></ol>") .append("</td></tr>") @@ -553,8 +555,25 @@ value = (String) node.getAttributes().get("href"); assertEquals("Attribute href", value, "http://www.acme.com"); - + + } + + public void testTable() { + Parser p = new Parser(); + StringBuffer doc = new StringBuffer(); + + doc.append("<table>") + .append("<tr><th></th></tr>") + .append("<tr><td></td></tr>") + .append("</table>"); + + List nodes = p.parse(doc); + assertEquals("Table parse, 1 root node", nodes.size(), 1); + + Node table = (Node) nodes.get(0); + List trs = table.getChildren(); + assertEquals("tr parse, 2 root node", trs.size(), 2); } @@ -574,7 +593,7 @@ .append("</table>"); List nodes = p.parse(doc); - assertTrue("Well-formed JSP, 5 root node", nodes.size() == 5); + assertTrue("Well-formed JSP, 5 root nodes", nodes.size() == 5); Node root = (Node) nodes.get(4); assertNotNull("table node not null", root); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]