Created
July 17, 2010 21:12
-
-
Save LeifW/479861 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import net.sf.saxon.functions.ExtensionFunctionCall | |
import net.sf.saxon.om.SequenceIterator | |
import net.sf.saxon.om.SingletonIterator.makeIterator | |
import net.sf.saxon.om.SingleNodeIterator | |
import net.sf.saxon.expr.XPathContext | |
import net.sf.saxon.om.StructuredQName | |
import net.sf.saxon.value.SequenceType.{SINGLE_STRING, SINGLE_ELEMENT_NODE} | |
import net.sf.saxon.value.StringValue | |
class ExtFunCall extends ExtensionFunctionCall { | |
def call(args:Array[SequenceIterator], context:XPathContext) = makeIterator( new StringValue("hello") ) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import net.sf.saxon.functions.ExtensionFunctionDefinition | |
import net.sf.saxon.om.StructuredQName | |
import net.sf.saxon.value.SequenceType | |
import SequenceType.{SINGLE_STRING, SINGLE_ELEMENT_NODE} | |
class ExtFunDef extends ExtensionFunctionDefinition { | |
val getFunctionQName = new StructuredQName("mp", "http://musicpath.org", "sparql") | |
val getMinimumNumberOfArguments = 1 | |
//val getMaximumNumberOfArguments = 1 | |
val getArgumentTypes = List(SINGLE_STRING).toArray | |
def getResultType(suppliedArgumentTypes:Array[SequenceType]) = SINGLE_ELEMENT_NODE | |
def makeCallExpression = new ExtFunCall | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment