This function returns the part of $arg which appears before the last occurrence of $delim. If $arg does not contain $delim, a zero-length string is returned.

If you split the string “XPath-is-fun” as $arg with $delim “-” you will get the following result:

XPath-is

Unfortunately, this function is not provided in XSLT 1.0. But there is a possibility of realizing this without any 3rd party libraries (e.g. EXSLT). The following example shows, how this can be done with XSLT 1.0.

The result of this easy method call is tokenized by spaces, so we get:

"XPath", "is", "fun"

Unfortunately, this function is not provided in XSLT 1.0, but there is the possibility of realizing this without any 3rd party libraries (e.q. EXSLT). The following example shows, how this can be done with XSLT 1.0.

With XSLT 2.0, a method is provided, which quite simply determines the current date or time.

<xsl:value-of select="current-dateTime()"/>

Unfortunately, this is not possible with XSLT 1.0, but there is the option to realize this using Java or JavaScript resources within the stylesheet. Here is an example, using Java, that works with Xalan and is default available in the ORACLE JRE.

Recently I had the problem of validating XHTML file using DTD schema and Java. As for DTD validation to find little on the Internet, I would like to explain briefly how this is possible by simply using Java resources.

In some circumstance it is neccessary to get a sorted List of files from folder. Therefore the Java API provides some functions to access the local file system. The following snippets will demonstrate how the identified files can be sorted useful:Readmore…