[Htmlparser-developer] jsp tags
Brought to you by:
derrickoswald
From: Derrick O. <Der...@Ro...> - 2003-10-01 11:57:39
|
Working through some of the unit test failures from the lexer integration I came upon this one: /** * Bug reported by Gordon Deudney 2002-03-15 * Nested JSP Tags were not working */ public void testNestedTags() throws ParserException { String s = "input type=\"text\" value=\"<%=\"test\"%>\" name=\"text\""; String line = "<"+s+">"; createParser(line); parseAndAssertNodeCount(1); assertTrue("The node found should have been an Tag",node[0] instanceof Tag); Tag tag = (Tag) node[0]; assertEquals("Tag Contents",s,tag.getText()); } This implies that handling jsp would need a different mode in the lexer, presumably because the JSP processing happens prior to HTML processing. It might also mean that attribute values, string and remark nodes could have children, if we wish to actually parse jsp tags rather than just pass them through. Looking at two tags: <tagname attribute="<%= some text"> <tagname attribute="<%= "hello world" %>"> The first is legitimate HTML syntax, but illegal JSP. The second is legitimate JSP syntax but illegal HTML. Either the test is wrong and it should use single quotes: String s = "input type=\"text\" value=\"<%='test'%>\" name=\"text\""; or there will need to be a toggle on the lexer to switch to 'handling jsp' mode. Any thoughts. |