[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Extension functions and Oracle V2 parser
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|