CHAPTER 2 RELATED XML RECOMMENDATIONS The first line specifies what nodes in the source tree the template matches. It uses an XPath expression to determine the node. You ll find out more about XPath a little later in the chapter. In this case, you re matching the root node, which is indicated by a slash (/). Note Technically, the root node isn t the same as the root element. The root note is at a higher level in the document and has the root element as a child. This allows the stylesheet to access information in the prolog and epilog, as well as information in elements. The template specifies what should happen when the XSLT processor encounters the root. In this case, the result tree includes the HTML tags indicated within the template. It should generate the following output:
Title
Format
Genre
The result tree sets up the HTML document and adds a link to an external CSS stylesheet called style.css.The closing
and tags appear after the other content that you include. The next section within the stylesheet includes each element as a row in the table using another template. This time the template matches each element. Because there are multiple DVD elements, it s appropriate to use an xsl:for-each statement:
The xsl:for-eachstatement finds the node using the XPath expression /library/DVD. In other words, start with the root node, locate the element, and move to the node. This statement retrieves all of the nodes in the XML document. Note: If you are looking for best quality webspace to host and run your tomcat application check Vision personal web hosting services
This entry was posted
on Sunday, April 29th, 2007 at 8:18 am and is filed under Tomcat.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.