CHAPTER 6 INTRODUCTION TO XSLT 179 Selecting (Web design seattle)

CHAPTER 6 INTRODUCTION TO XSLT 179 Selecting Each Planet with The beginning lines of planets2.xsl are the same as in the previous example. The first change to the stylesheet is in the header template. The new lines appear in bold:

Visit NASA! | Tour the solar system

Quick reference

The added lines create a heading for the table of contents and start an unordered list. The stylesheet loops through each of the

elements in the element. The content from each

element the name of the planet provides the name for the anchor. It also supplies the text for each list item:
  • #
  • To explain it in a bit more detail, each time the template finds an

    element in the body of the page, it outputs an
  • tag. After that, it creates an tag. Then the template uses xsl:attribute to add an attribute to the tag called href, and it sets the value of the attribute to be a hash symbol (#) followed by whatever content is in the

    tag (text()). Finally, the template closes the href attribute. So, if the

    tag contains the text Venus, the template outputs the following tag:
    From our experience, we can recommend
    PHP5 Web Hosting services, if you need affordable webhost to host and run your web application.

  • Leave a Reply