JSP as XML Documents
- Every JSP tag can be written in XML format in replacement of the
JSP standard syntax.
- Scriptlets
- JSP: <% code %>
- XML: <jsp:scriplet >
code </jsp:scriplet>
- Expressions
- JSP: <%= code %>
- XML: <jsp:expression > code
</jsp:expression>
- Declarations
- JSP: <%! code %>
- XML: <jsp:declaration> code
</jsp:expression>
- Actions
- XML: <jsp:action_name attribute="value
/>
- Directives
- JSP: <%@ directive_name %>
- XML: <jsp:directive.directive_name
/>
- Comments
- JSP: <%-- comment --%>
- XML: <!-- comment -->
- Converting from
JSP Format to
XML Format is fairly
straightforward.
- Java XML Parsers