The XSLT Functions

The XSLT Functions

The following list includes, in overview, the functions built into XSLT:

  • current() . Returns the current nodenot the context node. The current node is the present node in loops such as <xsl:for-each> . You cannot use current in patterns.

  • document() . Enables you to read in multiple documents.

  • element-available() . Indicates whether an extension element is available.

  • format-number() . Formats numbers for display.

  • function-available() . Indicates whether an extension function is available.

  • generate-id () . Causes the XSLT processor to assign and return an identifier to a node. When you call generate-id again on the same node, this function returns the previously assigned identifier.

  • key() . Enables you to search by key.

  • system-property () . Enables you to check three system properties: xsl:version (the version of XSLT supported by the XSLT processor), xsl:vendor (the name of the XSLT processors vendor), and xsl:vendor-url (the URL of the XSLT processors vendor).

  • unparsed-entity-uri () . Gives you access to unparsed entities as declared in a DTD or schema using a URI.

The following sections explain all these functions in detail, with examples.

current()

The current function returns the current nodenot the context node. The context node for a template is the node in the matched node set to which the template is being applied. The current node, on the other hand, is the present node in loops such as <xsl:for-each> . This function returns the current node as a node set with one node:

 node-set current() 

Note that you cannot use current in patterns because patterns are supposed to be processing- path independent, and the way XSLT processors may implement structures such as loops may vary.

To see how current works, look at the following example, in which I match <PLANET> elements with a template. I also put an <xsl:for-each> element inside the template, and apply the template only if the context node matched by the template is the same as the current node in the present itera-tion in the <xsl:for-each> element:

Listing 8.1 Using the current Function
 <?xml version="1.0"?>  <xsl:stylesheet version="1.0"  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">      <xsl:template match="/PLANETS">          <HTML>          .          .          .                  <TABLE BORDER="2">                      <TR>                          <TD>Name</TD>                          <TD>Mass</TD>                          <TD>Radius</TD>                          <TD>Day</TD>                      </TR>                      <xsl:apply-templates/>                  </TABLE>              </BODY>          </HTML>      </xsl:template>      <xsl:template match="PLANET">         <xsl:for-each select="/PLANETS/*[.=current()]">         <TR>            <TD><xsl:value-of select="NAME"/></TD>            <TD><xsl:apply-templates select="MASS"/></TD>            <TD><xsl:apply-templates select="RADIUS"/></TD>            <TD><xsl:apply-templates select="RADIUS"/></TD>            <TD><xsl:apply-templates select="DAY"/></TD>         </TR>         </xsl:for-each>      </xsl:template>      <xsl:template match="MASS">          <xsl:value-of select="."/>          <xsl:text> </xsl:text>          <xsl:value-of select="@UNITS"/>      </xsl:template>          .          .          .      <xsl:template match="DAY">          <xsl:value-of select="."/>          <xsl:text> </xsl:text>          <xsl:value-of select="@UNITS"/>      </xsl:template>  </xsl:stylesheet> 

The net result of this stylesheet is the same as if the <xsl:for-each> element were not there at all, because the body of the <xsl:for-each> element is applied only when the context node is the same as the current node.

document()

The document function is a particularly useful one, because it enables you to read multiple documents and process their contents. Heres how you use document :

 node-set document(uri, base-uri?) 

You pass this function the uri argument, which can be the URI of a document to read in, or a node set of nodes whose string values are URIs. You can also pass a second, optional, argument, base-uri , which is a node set, and the base URI of this node set is used to resolve any relative URIs found in the uri argument.

In the following example, I use an XSLT processor on one document, planets1.xml, but also read in a second, planets2.xml, and process that document as well. Heres planets1.xml:

Listing 8.2 planets1.xml
 <?xml version="1.0"?>  <?xml-stylesheet type="text/xml" href="planets.xsl"?>  <PLANETS href="planets2.xml">  </PLANETS> 

Heres planets2.xml, which has one planet in a <PLANET> element:

Listing 8.3 planets2.xml
 <?xml version="1.0"?>  <PLANET>      <NAME>Mercury</NAME>      <MASS UNITS="(Earth = 1)">.0553</MASS>      <DAY UNITS="days">58.65</DAY>      <RADIUS UNITS="miles">1516</RADIUS>      <DENSITY UNITS="(Earth = 1)">.983</DENSITY>      <DISTANCE UNITS="million miles">43.4</DISTANCE><!--At perihelion-->  </PLANET> 

And heres the stylesheet, planets.xsl, that Ill use on planets1.xml. This stylesheet has a template that matches the <PLANETS> element in planets1.xml, and in that template, Ill use <xsl:apply-templates> and the document function to read in planets2.xml:

Listing 8.4 Using the document Function
 <?xml version="1.0"?>  <xsl:stylesheet version="1.0"  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">      <xsl:template match="/PLANETS">          <HTML>              <HEAD>                  <TITLE>                      The Planets Table                  </TITLE>              </HEAD>              <BODY>                  <H1>                      The Planets Table                  </H1>                  <TABLE BORDER="2">                      <TR>                          <TD>Name</TD>                          <TD>Mass</TD>                          <TD>Radius</TD>                          <TD>Day</TD>                      </TR>                      <xsl:apply-templates select="document(@href)"/>                  </TABLE>              </BODY>          </HTML>      </xsl:template>      <xsl:template match="PLANET">         <TR>            <TD><xsl:value-of select="NAME"/></TD>            <TD><xsl:apply-templates select="MASS"/></TD>            <TD><xsl:apply-templates select="RADIUS"/></TD>            <TD><xsl:apply-templates select="DAY"/></TD>         </TR>     </xsl:template>          .          .          .      <xsl:template match="DAY">          <xsl:value-of select="."/>          <xsl:text> </xsl:text>          <xsl:value-of select="@UNITS"/>      </xsl:template>  </xsl:stylesheet> 

This stylesheet processes the data in planets1.xml and also reads in and processes planets2.xml as well; here is the full resultas you can see, the data for planets2.xml has been added as it should be:

 <HTML>      <HEAD>          <TITLE>              The Planets Table          </TITLE>      </HEAD>      <BODY>          <H1>              The Planets Table          </H1>          <TABLE BORDER="2">              <TR>                  <TD>Name</TD>                  <TD>Mass</TD>                  <TD>Radius</TD>                  <TD>Day</TD>              </TR>              <TR>                  <TD>Mercury</TD>                  <TD>.0553 (Earth = 1)</TD>                  <TD>1516 miles</TD>                  <TD>58.65 days</TD>              </TR>          </TABLE>      </BODY>  </HTML> 

The document function is useful because it enables you to read in additional documents at run time, such as copyright or disclaimer references, company letterhead, and so on.

element-available()

You can use the element-available function to determine whether a particular extension element is available. Heres how you use this function:

 boolean element-available(element-name) 

You pass this function the name of the element youre looking for, and it returns true if the element is available, false otherwise .

You saw this function in Chapter 5. In the element-available example in that chapter, I checked for an element named <starpowder:calculate> this way:

 <xsl:choose xmlns:starpowder="http://www.starpowder.com">      <xsl:when test="element-available('starpowder:calculate')">          <starpowder:calculate xsl:extension-element-prefixes="starpowder"/>      </xsl:when>      <xsl:otherwise>          <xsl:text>Sorry, can't do math today.</xsl:text>      </xsl:otherwise>  </xsl:choose> 

format-number()

As its name implies, you can use the format-number function to format numbers into strings. Heres how you use this function:

 string format-number(number, format, name?) 

This function returns the formatted number as a string. You pass it the number to format, a format string, and an optional name string. The name string is a QName that specifies a format as created by the <xsl:decimal-format> element (which youll see at the end of this chapter).

You write the format string to follow the conventions of the Java DecimalFormat class.

The Java DecimalFormat Class

As of this writing, the documentation for the Java DecimalFormat class is available online at http://java.sun.com/products/jdk/1.1/docs/api/java.text.DecimalFormat.html.

Here are the parts of a format string:

  • format-string:= subpattern (;subpattern)?

  • subpattern:= prefix? integer (.fraction)?suffix?

  • prefix:= [#x0..#xFFFD] - specialCharacters

  • suffix:= [#x0..#xFFFD] - specialCharacters

  • integer:= #* 0* 0

  • fraction:= 0* #*

Here are the special characters ( specialCharacters above ) that you can use in a subpattern (you can change these characters with the <xsl:decimal-format> element which youll see at the end of this chapter):

  • A digit always appears at this place.

  • A digit, unless it is a redundant leading or trailing zero.

  • The decimal separator.

  • A grouping separator.

  • Separates formats.

  • A minus sign.

  • Multiply by 100 and show as percentage.

  • Multiply by 1000 and show as per mille.

  • Separates mantissa and exponent.

  • The symbol for currency (#xA4).

  • Used to quote special characters.

To see how this works, look at the following example, in which I format the values from planets.xml that are displayed in the HTML table:

Listing 8.5 Formatting Numbers
 <?xml version="1.0"?>  <xsl:stylesheet version="1.0"  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">      <xsl:template match="/PLANETS">          .          .          .      </xsl:template>      <xsl:template match="PLANET">         <TR>            <TD><xsl:value-of select="NAME"/></TD>            <TD><xsl:apply-templates select="MASS"/></TD>            <TD><xsl:apply-templates select="RADIUS"/></TD>            <TD><xsl:apply-templates select="DAY"/></TD>         </TR>     </xsl:template>      <xsl:template match="MASS">          <xsl:value-of select="format-number(., '#.###')"/>          <xsl:text> </xsl:text>          <xsl:value-of select="@UNITS"/>      </xsl:template>      <xsl:template match="RADIUS">          <xsl:value-of select="format-number(., '#,###')"/>          <xsl:text> </xsl:text>          <xsl:value-of select="@UNITS"/>      </xsl:template>      <xsl:template match="DAY">          <xsl:value-of select="format-number(., '###.##')"/>          <xsl:text> </xsl:text>          <xsl:value-of select="@UNITS"/>      </xsl:template>  </xsl:stylesheet> 

Heres the result, where you can see the formatted numbers:

 <HTML>      <HEAD>          <TITLE>              The Formatted Planets Table          </TITLE>      </HEAD>      <BODY>          <H1>              The Formatted Planets Table          </H1>          <TABLE BORDER="2">              <TR>                  <TD>Name</TD>                  <TD>Mass</TD>                  <TD>Radius</TD>                  <TD>Day</TD>              </TR>              <TR>                  <TD>Mercury</TD>                  <TD>0.055 (Earth = 1)</TD>                  <TD>1,516 miles</TD>                  <TD>58.65 days</TD>              </TR>              <TR>                  <TD>Venus</TD>                  <TD>0.815 (Earth = 1)</TD>                  <TD>3,716 miles</TD>                  <TD>116.75 days</TD>              </TR>              <TR>                  <TD>Earth</TD>                  <TD>1 (Earth = 1)</TD>                  <TD>2,107 miles</TD>                  <TD>1 days</TD>              </TR>          </TABLE>      </BODY>  </HTML> 

You can see this result document in Figure 8.1. (MSXML3 and Saxon drop leading zeros, so 0.055 appears as .055, and so on.)

Figure 8.1. Formatting numbers using XSLT.
graphics/08fig01.gif

The following examples show how to put format strings to work. Note that you can use a semicolon (;) to separate patterns for positive and negative numbers:

  • number: 4567, format string: #,###, result: 4,567

  • number: 4567.8, format string: ####.##, result: 4567.8

  • number: 4567.8, format string: #,##0.00, result: 4,567.80

  • number: 456.789, format string: #,##0.00, result: 456.79

  • number: 4567890, format string: #,##0.00, result: 4,567,890.00

  • number: 4567, format string: ###0.0###, result: 4567.0

  • number: .00045, format string: ##0.0###, result: 0.0005

  • number: .45, format string: #00%, result: 45%

  • number: -4.56, format string: #.00;(#.00), result: (4.56)

  • number: -45, format string: #,##0.00, result: -45

function-available()

You use the XSLT 1.0 function function-available to test whether an extension function is available:

 boolean function-available(function-name) 

You pass this function the name of the function youre looking for, and it returns true if the function is available, and false otherwise.

You first saw the following example in Chapter 5. In this case, I want to use the extension function starpowder:calculate to do some math, and if its not available, I want to send the text Sorry, cant do math today. to the result document. (You could, of course, also quit processing and display an error message with the <xsl:message> element.)

 <xsl:choose xmlns:starpowder="http://www.starpowder.com">      <xsl:when test="function-available('starpowder:calculate')">          <xsl:value-of select="starpowder:calculate('2+2')"/>      </xsl:when>      <xsl:otherwise>          <xsl:text>Sorry, can't do math today.</xsl:text>      </xsl:otherwise>  </xsl:choose> 

generate-id()

The generate-id function causes the XSLT processor to assign an identifier (returned as a string) to a node. Heres how you use this function:

 string generate-id(node) 

You pass this function a node set containing just the node for which you want an identifier (any nodes after the first one are ignored), and this function returns a unique identifier for that node. If you pass this function the same node again, it returns the same identifier. Note that identifiers vary by XSLT processor.

The following example is from Chapter 6, but in this case Im going to add a hyperlinked table of contents to planets.html. To generate that table of contents, I use <xsl:for-each> to loop over all the planets. Each time through the loop, I create a hyperlink and use an attribute value template to create an HREF attribute set to a unique identifier for the current planet:

 <?xml version="1.0"?>  <xsl:stylesheet version="1.0"  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">      <xsl:template match="/PLANETS">          <HTML>              <HEAD>                  <TITLE>                      The Planets Table                  </TITLE>              </HEAD>              <BODY>                  <H1>                      The Planets Table                  </H1>                  <xsl:for-each select="PLANET">                      <H2><A HREF="#{generate-id()}">                          <xsl:value-of select="NAME"/></A>                      </H2>                      <P/>                  </xsl:for-each>                   .                   .                   . 

This adds an identifier to each planet and creates the necessary hyperlinks . I can create the hyperlink anchors in the planetary data HTML table, setting the anchors NAME attribute to the identifier for each <PLANET> element in turn so that it becomes a hyperlink target:

 <?xml version="1.0"?>  <xsl:stylesheet version="1.0"  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">      <xsl:template match="/PLANETS">          <HTML>          .          .          .          </HTML>      </xsl:template>      <xsl:template match="PLANET">         <TR>            <TD><A NAME="{generate-id(.)}">            <xsl:value-of select="NAME"/></A></TD>            <TD><xsl:apply-templates select="MASS"/></TD>            <TD><xsl:apply-templates select="RADIUS"/></TD>            <TD><xsl:apply-templates select="DAY"/></TD>         </TR>     </xsl:template>      <xsl:template match="MASS">          <xsl:value-of select="."/>          <xsl:text> </xsl:text>          <xsl:value-of select="@UNITS"/>      </xsl:template>          .          .          .      <xsl:template match="DAY">          <xsl:value-of select="."/>          <xsl:text> </xsl:text>          <xsl:value-of select="@UNITS"/>      </xsl:template>  </xsl:stylesheet> 

Thats all it takes; now Ive created hyperlinks whose HREF attribute is set to an identifier for a <PLANET> element, and I made each <PLANET> element a hyperlink target using the same identifier.

When the user clicks a hyperlink in the table of contents, the browser scrolls to the corresponding planets entry in the HTML table. Heres what the result document looks like if I use Xalan:

 <HTML>      <HEAD>          <TITLE>              The Planets Table          </TITLE>      </HEAD>      <BODY>          <H1>              The Planets Table          </H1>          <H2>          <A href="#N5">Mercury</A>          </H2>          <P></P>          <H2>          <A href="#N20">Venus</A>          </H2>          <P></P>          <H2>          <A href="#N3B">Earth</a>          </H2>          <P></P>          <TABLE BORDER="2">              <TR>                  <TD>Name</TD>                  <TD>Mass</TD>                  <TD>Radius</TD>                  <TD>Day</TD>              </TR>              <TR>                  <TD><A NAME="N5">Mercury</A>                  </TD><TD>.0553 (Earth = 1)</TD>                  <TD>1516 miles</TD>                  <TD>58.65 days</TD>              </TR>              <TR>                  <TD><A NAME="N20">Venus</A></TD>                  <TD>.815 (Earth = 1)</TD>                  <TD>3716 miles</TD>                  <TD>116.75 days</TD>              </TR>              <TR>                  <TD><A NAME="N3B">Earth</A></TD>                  <TD>1 (Earth = 1)</TD>                  <TD>2107 miles</TD>                  <TD>1 days</TD>              </TR>          </TABLE>      </BODY>  </HTML> 

key()

You use the key function to find nodes with a specific value for a named key; heres how you use this function:

 node-set key(name, value) 

You pass this function the name of the key as a string, and the required value for the key you want to match. This function returns a node set of nodes that match.

To create keys, you use the <xsl:key> element. You first saw the following example in Chapter 4; here, I use keys to match planets whose COLOR attribute is set to BLUE:

 <?xml version="1.0"?>  <?xml-stylesheet type="text/xml" href="planets.xsl"?>  <PLANETS>          .          .          .      <PLANET COLOR="BLUE">          <NAME>Earth</NAME>          <MASS UNITS="(Earth = 1)">1</MASS>          <DAY UNITS="days">1</DAY>          <RADIUS UNITS="miles">2107</RADIUS>          <DENSITY UNITS="(Earth = 1)">1</DENSITY>          <DISTANCE UNITS="million miles">128.4</DISTANCE><!--At perihelion-->      </PLANET>  </PLANETS> 

Now I can create a key, using <xsl:key> , named COLOR . This key matches <PLANET> elements and checks their COLOR attribute. Heres what that key, COLOR , looks like:

 <?xml version="1.0"?>  <xsl:stylesheet version="1.0"  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">      <xsl:key name="COLOR" match="PLANET" use="@COLOR"/>          .          .          . 

At this point, I can use the pattern key() to match <PLANET> elements with the COLOR attribute set to BLUE this way:

 <?xml version="1.0"?>  <xsl:stylesheet version="1.0"  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">      <xsl:key name="COLOR" match="PLANET" use="@COLOR"/>      <xsl:template match="/PLANETS">          <HTML>          .          .          .                  <TABLE BORDER="2">                      <TR>                          <TD>Name</TD>                          <TD>Mass</TD>                          <TD>Radius</TD>                          <TD>Day</TD>                      </TR>                      <xsl:apply-templates select="key('COLOR', 'BLUE')"/>                  </TABLE>              </BODY>          </HTML>      </xsl:template>          .          .          . 

And heres the resultas you can see, Earth was the only planet that matched the pattern used:

 <HTML>      <HEAD>          <TITLE>              The Planets Table          </TITLE>      </HEAD>      <BODY>          <H1>              The Planets Table          </H1>          <TABLE BORDER="2">              <TR>                  <TD>Name</TD>                  <TD>Mass</TD>                  <TD>Radius</TD>                  <TD>Day</TD>              </TR>              <TR>                  <TD>Earth</TD>                  <TD>1 (Earth = 1)</TD>                  <TD>2107 miles</TD>                  <TD>1 days</TD>              </TR>          </TABLE>      </BODY>  </HTML> 

system-property()

The system-property function returns the value of several system properties as strings; heres how you use this function:

 string system-property(property) 

You can test the following possible system property values:

  • xsl:version . Returns the XSLT version.

  • xsl:vendor . Returns a string identifying the XSLT processor vendor

  • xsl:vendor-url . Returns the XSLT processor vendors URL.

Heres an example; you can test the XSLT version by calling system-property('xsl:version') :

 <?xml version="1.0"?>  <xsl:stylesheet version="2.0"  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">          .          .          .  <xsl:if text="system-property('xsl:version')=2.0">      <xsl:namespace name="starpowder"/>  </xsl:if>          .          .          .  </xsl:stylesheet> 

Checking the XSLT version this way is useful if you want to use features that have been introduced in recent versions.

unparsed-entity-uri()

The unparsed-entity-uri function gives you access to declarations of unparsed entities in the DTD or schema of the source document. An unparsed entity is typically binary data, such as an image file. (For more on unparsed entities, see Inside XML .) This is how you use this function:

 string unparsed-entity-uri(name) 

You pass the name of the unparsed entity to this function, and it returns the identifier for the entity. In the following example, I add a DTD to planets.xml and declare three unparsed entities corresponding to images of the planets image1 , image2 , and image3 and I refer to those entities by adding an IMAGE attribute to each <PLANET> element:

Listing 8.6 planets.xml with Unparsed Entities
 <?xml version="1.0"?>  <?xml-stylesheet type="text/xml" href="planets.xsl"?>  <!DOCTYPE PLANETS [ <!ELEMENT PLANET (CUSTOMER)*>  <!ELEMENT CUSTOMER (NAME,MASS,RADIUS,DAY)>  <!ELEMENT NAME (#PCDATA)>  <!ELEMENT MASS (#PCDATA)>  <!ELEMENT RADIUS (#PCDATA)>  <!ELEMENT DAY (#PCDATA)>  <!ENTITY image1 SYSTEM "http://starpowder.com/image1.gif" NDATA GIF>>  <!ENTITY image2 SYSTEM "http://starpowder.com/image2.gif" NDATA GIF>>  <!ENTITY image3 SYSTEM "http://starpowder.com/image3.gif" NDATA GIF>>  ]>  <PLANETS>      <PLANET IMAGE="image1">          <NAME>Mercury</NAME>          <MASS UNITS="(Earth = 1)">.0553</MASS>          <DAY UNITS="days">58.65</DAY>          <RADIUS UNITS="miles">1516</RADIUS>          <DENSITY UNITS="(Earth = 1)">.983</DENSITY>          <DISTANCE UNITS="million miles">43.4</DISTANCE><!--At perihelion-->      </PLANET>      <PLANET IMAGE="image2">          <NAME>Venus</NAME>          <MASS UNITS="(Earth = 1)">.815</MASS>          <DAY UNITS="days">116.75</DAY>          <RADIUS UNITS="miles">3716</RADIUS>          <DENSITY UNITS="(Earth = 1)">.943</DENSITY>          <DISTANCE UNITS="million miles">66.8</DISTANCE><!--At perihelion-->      </PLANET>      <PLANET IMAGE="image3">          <NAME>Earth</NAME>          <MASS UNITS="(Earth = 1)">1</MASS>          <DAY UNITS="days">1</DAY>          <RADIUS UNITS="miles">2107</RADIUS>          <DENSITY UNITS="(Earth = 1)">1</DENSITY>          <DISTANCE UNITS="million miles">128.4</DISTANCE><!--At perihelion-->      </PLANET>  </PLANETS> 

(Note that some XSLT processors are built on XML parsers that check to see whether they can find the entity at the given URI, so if youre going to try out this example, substitute the URI of some real images.) Now I can retrieve the URI of the images by using unparsed-entity-uri in a stylesheet and create HTML <IMG> elements using this function in the result document:

Listing 8.7 Using unparsed-entity-uri
 <?xml version="1.0"?>  <xsl:stylesheet version="1.0"  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">      <xsl:template match="/PLANETS">          <HTML>          .          .          .          </HTML>      </xsl:template>      <xsl:template match="PLANET">         <TR>            <TD><xsl:value-of select="NAME"/><IMG SRC="{unparsed-entity-uri(@IMAGE)}"/></ graphics/ccc.gif TD>            <TD><xsl:apply-templates select="MASS"/></TD>            <TD><xsl:apply-templates select="RADIUS"/></TD>            <TD><xsl:apply-templates select="DAY"/></TD>         </TR>     </xsl:template>      <xsl:template match="MASS">          <xsl:value-of select="."/>          <xsl:text> </xsl:text>          <xsl:value-of select="@UNITS"/>      </xsl:template>          .          .          .      <xsl:template match="DAY">          <xsl:value-of select="."/>          <xsl:text> </xsl:text>          <xsl:value-of select="@UNITS"/>      </xsl:template>  </xsl:stylesheet> 

And heres the result document:

 <HTML>      <HEAD>          <TITLE>              The Planets Table          </TITLE>      </HEAD>      <BODY>          <H1>              The Planets Table          </H1>          <TABLE BORDER="2">              <TR>                  <TD>Name</TD>                  <TD>Mass</TD>                  <TD>Radius</TD>                  <TD>Day</TD>              </TR>              <TR>                  <TD>Mercury<IMG SRC="http://starpowder.com/image1.gif"></TD>                  <TD>.0553 (Earth = 1)</TD>                  <TD>1516 miles</TD>                  <TD>58.65 days</TD>              </TR>              <TR>                  <TD>Venus<IMG SRC="http://starpowder.com/image2.gif"></TD>                  <TD>.815 (Earth = 1)</TD>                  <TD>3716 miles</TD>                  <TD>116.75 days</TD>              </TR>              <TR>                  <TD>Earth<IMG SRC="http://starpowder.com/image3.gif"></TD>                  <TD>1 (Earth = 1)</TD>                  <TD>2107 miles</TD>                  <TD>1 days</TD>              </TR>          </TABLE>      </BODY>  </HTML> 

That completes the XSLT functions. Ill turn to the XPath functions next , starting with those you use on node sets.



Inside XSLT
Inside Xslt
ISBN: B0031W8M4K
EAN: N/A
Year: 2005
Pages: 196

Similar book on Amazon

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