mirror of
https://github.com/rn10950/RetroZilla.git
synced 2024-11-09 17:30:18 +01:00
1353 lines
27 KiB
HTML
1353 lines
27 KiB
HTML
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
|
||
|
"http://www.w3.org/TR/REC-html40/loose.dtd">
|
||
|
<HTML>
|
||
|
<HEAD>
|
||
|
<TITLE>TransforMiiX Test Cases</TITLE>
|
||
|
</HEAD>
|
||
|
<BODY BGCOLOR="#FFFFFF" Text="#000000">
|
||
|
<CENTER>
|
||
|
<FONT COLOR="BLUE" FACE="Arial">
|
||
|
<B>MITRE</B>
|
||
|
</FONT>
|
||
|
<BR>
|
||
|
<B>Transfor<FONT COLOR="blue">Mii</FONT>X Test Cases</B>
|
||
|
</CENTER>
|
||
|
<P ALIGN="CENTER">This document serves to test XPath and XSLT functions.</P>
|
||
|
<TABLE>
|
||
|
<TR BGColor="#E0E0FF">
|
||
|
<TD Colspan="2" ALIGN="CENTER">
|
||
|
<B>Boolean Functions</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<B>Function:</B>
|
||
|
</TD>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<I>boolean</I>
|
||
|
<B> boolean(</B>
|
||
|
<I>object</I>
|
||
|
<B>)</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="boolean(descendant::z)"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">true</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">true</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="boolean(*)"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">true</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">true</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<B>Function:</B>
|
||
|
</TD>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<I>boolean</I>
|
||
|
<B> false()</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="false()"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">false</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">false</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<B>Function:</B>
|
||
|
</TD>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<I>boolean</I>
|
||
|
<B> true()</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-ofselect="true()"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">true</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">true</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<B>Function:</B>
|
||
|
</TD>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<I>boolean</I>
|
||
|
<B> not(</B>
|
||
|
<I>boolean</I>
|
||
|
<B>)</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="not(true())"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">false</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">false</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
</TABLE>
|
||
|
<TABLE>
|
||
|
<TR BGColor="#E0E0FF">
|
||
|
<TD Colspan="2" ALIGN="CENTER">
|
||
|
<B>NodeSet Functions</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<B>Function:</B>
|
||
|
</TD>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<I>number</I>
|
||
|
<B> count(</B>
|
||
|
<I>node-set</I>
|
||
|
<B>)</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="count(*)"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">4</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">4</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<B>Function:</B>
|
||
|
</TD>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<I>number</I>
|
||
|
<B> position()</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="*[position()=3]"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">z</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">z</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<B>Function:</B>
|
||
|
</TD>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<I>number</I>
|
||
|
<B> last()</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="*[last()-1]"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">z</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">z</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<B>Function:</B>
|
||
|
</TD>
|
||
|
<TD BGColor="#EEEEEE">String<B> local-name(</B>
|
||
|
<I>node-set?</I>
|
||
|
<B>)</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="local-name(names/abc:test-name)"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">test-name</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">test-name</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<B>Function:</B>
|
||
|
</TD>
|
||
|
<TD BGColor="#EEEEEE">String<B> local-name(</B>
|
||
|
<I>node-set?</I>
|
||
|
<B>)</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="local-name()"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">document</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">document</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<B>Function:</B>
|
||
|
</TD>
|
||
|
<TD BGColor="#EEEEEE">String<B> name(</B>
|
||
|
<I>node-set?</I>
|
||
|
<B>)</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="name(names/abc:test-name)"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">abc:test-name</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">abc:test-name</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<B>Function:</B>
|
||
|
</TD>
|
||
|
<TD BGColor="#EEEEEE">String<B> namespace-uri(</B>
|
||
|
<I>node-set?</I>
|
||
|
<B>)</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="namespace-uri(names/abc:test-name)"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">abc</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">abc</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
</TABLE>
|
||
|
<TABLE>
|
||
|
<TR BGColor="#E0E0FF">
|
||
|
<TD Colspan="2" ALIGN="CENTER">
|
||
|
<B>String Functions</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<B>Function:</B>
|
||
|
</TD>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<I>string</I>
|
||
|
<B> string(</B>
|
||
|
<I>object?</I>
|
||
|
<B>)</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="string()"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">x y z</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue"> x y z </FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="string('xyz')"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">xyz</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">xyz</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<B>Function:</B>
|
||
|
</TD>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<I>string</I>
|
||
|
<B> concat(</B>
|
||
|
<I>string, string, string*</I>
|
||
|
<B>)</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="concat('abc', 'def')"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">abcdef</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">abcdef</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<B>Function:</B>
|
||
|
</TD>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<I>boolean</I>
|
||
|
<B> contains(</B>
|
||
|
<I>string, string</I>
|
||
|
<B>)</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="contains('abcdef', 'efg')"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">false</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">false</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="contains('abcdef', 'bcd')"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">true</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">true</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<B>Function:</B>
|
||
|
</TD>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<I>boolean</I>
|
||
|
<B> starts-with(</B>
|
||
|
<I>string, string</I>
|
||
|
<B>)</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="starts-with('abcdef', 'abc')"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">true</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">true</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="starts-with('abcdef', 'xyz')"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">false</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">false</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<B>Function:</B>
|
||
|
</TD>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<I>number</I>
|
||
|
<B> string-length(</B>
|
||
|
<I>string?</I>
|
||
|
<B>)</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="string-length(name())"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">8</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">8</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="string-length('abcdef')"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">6</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">6</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<B>Function:</B>
|
||
|
</TD>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<I>string</I>
|
||
|
<B> substring(</B>
|
||
|
<I>string, number, number?</I>
|
||
|
<B>)</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="substring('12345', 1.5, 2.6)"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">234</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">234</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="substring('12345', 0, 3)"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">12</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">12</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="substring('12345', 0 div 0, 3)"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue"></FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue"></FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="substring('12345', 1, 0 div 0)"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue"></FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue"></FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="substring('12345', -42, 1 div 0)"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">12345</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">12345</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="substring('12345', -1 div 0, 1 div 0)"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue"></FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue"></FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<B>Function:</B>
|
||
|
</TD>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<I>string</I>
|
||
|
<B> substring-after(</B>
|
||
|
<I>string, string</I>
|
||
|
<B>)</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="substring-after('1999/04/01', '/')"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">04/01</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">04/01</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<B>Function:</B>
|
||
|
</TD>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<I>string</I>
|
||
|
<B> substring-before(</B>
|
||
|
<I>string, string</I>
|
||
|
<B>)</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="substring-before('1999/04/01', '/')"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">1999</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">1999</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<B>Function:</B>
|
||
|
</TD>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<I>string</I>
|
||
|
<B> translate(</B>
|
||
|
<I>string, string, string</I>
|
||
|
<B>)</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="translate('bar', 'abc', 'ABC')"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">BAr</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">BAr</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="translate('---aaa---', 'abc-', 'ABC')"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">AAA</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">AAA</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
</TABLE>
|
||
|
<TABLE>
|
||
|
<TR BGColor="#E0E0FF">
|
||
|
<TD Colspan="2" ALIGN="CENTER">
|
||
|
<B>Number Functions</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<B>Function:</B>
|
||
|
</TD>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<I>number</I>
|
||
|
<B> number(</B>
|
||
|
<I>object?</I>
|
||
|
<B>)</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="number()"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">NaN</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">NaN</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="number('654.97')"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">654.97</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">654.97</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<B>Function:</B>
|
||
|
</TD>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<I>number</I>
|
||
|
<B> round(</B>
|
||
|
<I>number</I>
|
||
|
<B>)</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="round(1.75)"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">2</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">2</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="round(1.25)"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">1</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">1</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="round(-0.5)"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">0</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">0</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="round(0.5)"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">1</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">1</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<B>Function:</B>
|
||
|
</TD>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<I>number</I>
|
||
|
<B> floor(</B>
|
||
|
<I>number</I>
|
||
|
<B>)</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="floor(2.2)"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">2</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">2</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="floor(-2.2)"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">-3</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">-3</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<B>Function:</B>
|
||
|
</TD>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<I>number</I>
|
||
|
<B> ceiling(</B>
|
||
|
<I>number</I>
|
||
|
<B>)</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="ceiling(2.2)"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">3</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">3</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="ceiling(-2.2)"/><BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">-2</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">-2</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
</TABLE>
|
||
|
<TABLE>
|
||
|
<TR BGColor="#E0E0FF">
|
||
|
<TD Colspan="2" ALIGN="CENTER">
|
||
|
<B>XSLT Extension Functions</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<B>Function:</B>
|
||
|
</TD>
|
||
|
<TD BGColor="#EEEEEE">
|
||
|
<I>string</I>
|
||
|
<B> generate-id(</B>
|
||
|
<I>NodeSet?</I>
|
||
|
<B>)</B>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="generate-id()"/><BR>
|
||
|
<BR>
|
||
|
<B>Note:</B>
|
||
|
<UL>
|
||
|
<FONT COLOR="red">This function will generate a unique id for the current node.I don't what this will be exactly, until run-time</FONT>
|
||
|
</UL>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">id{some-number}.0.1</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">id134934984.0.1</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="TOP">
|
||
|
<B>Test:</B>
|
||
|
</TD>
|
||
|
<TD><xsl:value-of select="generate-id(..)"/><BR>
|
||
|
<B>Note:</B>
|
||
|
<UL>
|
||
|
<FONT COLOR="red">This function will generate a unique id for the parent of the current node.I don't what this will be exactly, until run-time</FONT>
|
||
|
</UL>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Desired Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">id{some-number}</FONT>
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD>
|
||
|
<B>Result:</B>
|
||
|
</TD>
|
||
|
<TD>
|
||
|
<FONT COLOR="blue">id134934984</FONT>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
</TABLE>
|
||
|
</BODY>
|
||
|
</HTML>
|