JSP.7.6 Transforming a JSP Page into an XML Document


The standard XML document for a JSP page is defined by transformation of the JSP page.

  • Add a <jsp:root> element as the root. Enable a "jsp" namespace prefix for the standard tags within this root.

  • Convert all the <% elements into valid XML elements as described in Section JSP.7.4.1 and following sections.

  • Convert the quotation mechanisms appropriately.

  • Convert the taglib directive into namespace attributes of the <jsp:root> element.

  • Create CDATA elements for all segments of the JSP page that do not correspond to JSP elements.

A quick summary of the transformation is shown in Table JSP.7-1:

Table JSP.7-1. XML Standard Tags for Directives and Scripting Elements

JSP Page Element

XML Equivalent

<%@ page ... %>

<jsp:directive.page ... />

<%@ taglib ... %>

jsp:root element is annotated with namespace information.

<%@ include ... %>

<jsp:directive.include .../>

<%! ... %>

<jsp:declaration> .... </jsp:declaration>

<% ... %>

<jsp:scriptlet> .... </jsp:scriptlet>

<%= .... %>

<jsp:expression> .... </jsp:expression>

JSP.7.6.1 Quoting Conventions

The quoting rules for the JSP 1.1 specification are designed to be friendly for hand authoring, they are not valid XML conventions.

Quoting conventions are converted in the generation of the XML document from the JSP page. This is not yet described in this version of the specification.

JSP.7.6.2 Request-Time Attribute Expressions

Request-time attribute expressions are of the form " <%= expression %> ." Although this syntax is consistent with the syntax used elsewhere in a JSP page, it is not a legal XML syntax. The XML mapping for these expressions is into values of the form " %= expression' % ," where the JSP specification quoting convention has been converted to the XML quoting convention.



Java 2 Platform, Enterprise Edition. Platform and Component Specifications
Java 2 Platform, Enterprise Edition: Platform and Component Specifications
ISBN: 0201704560
EAN: 2147483647
Year: 2000
Pages: 399

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net