Extension functions and Oracle V2 parser

Subject: Extension functions and Oracle V2 parser
From: "Terris" <terris@xxxxxxxxxx>
Date: Thu, 23 Sep 1999 17:06:35 -0700
Does or will the Oracle v2 Java XML parser supportXSLT extension functions?

Here is a cool example of an implementation at
http://www.jclark.com/xml/xt.html.  Somethinglike this would be a good way
to manipulatetext in more interesting ways (regular expressions, etc.).
--------------

A call to a function ns:foo where ns is bound to a namespace of
the form http://www.jclark.com/xt/java/className is treated as a
call of the static method foo of the class with fully-qualified
name className. Hyphens in method names are removed with the
character following the hyphen being upper-cased. Overloading
based on number of parameters is supported; overloading based on
parameter types is not. A non-static method is treated like a
static method with the this object as an additional first
argument. A constructor is treated like a static method named
new. Extension functions can return objects of arbitrary types
which can then be passed as arguments to other extension
functions or stored in variables.

For example, the following

<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/XSL/Transform/1.0";;
  xmlns:date="http://www.jclark.com/xt/java/java.util.Date";;
  xmlns="http://www.w3.org/TR/REC-html40";;
  result-ns="">

<xsl:template match="/">
  <html>
    <xsl:if test="function-available('date:to-string') and
function-available('date:new')">
      <p><xsl:value-of select="date:to-string(date:new())"/></p>
    </xsl:if>
  </html>
</xsl:template>

</xsl:stylesheet>
will print out the current date.





 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread