|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.functions.Extensions
public class Extensions
This class implements functions that are supplied as standard with SAXON, but which are not defined in the XSLT or XPath specifications.
To invoke these functions, use a function call of the form prefix:name() where name is the method name, and prefix maps to a URI such as http://saxon.sf.net/net.sf.saxon.functions.Extensions (only the part of the URI after the last slash is important).
Method Summary | |
---|---|
static SequenceIterator |
after(XPathContext context,
SequenceIterator ns1,
SequenceIterator ns2)
Find all the nodes in ns1 that are after the first node in ns2. |
static byte[] |
base64BinaryToOctets(Base64BinaryValue in)
Convert a base64Binary value to a sequence of integers representing the octets contained in the value |
static String |
base64BinaryToString(XPathContext context,
Base64BinaryValue in,
String encoding)
Convert a base64Binary value to a String, assuming a particular encoding |
static XQueryExpression |
compileQuery(XPathContext context,
String query)
Compile a string containing a source query transformations |
static Templates |
compileStylesheet(XPathContext context,
DocumentInfo doc)
Compile a document containing a stylesheet module into a stylesheet that can be used to perform transformations |
static BigDecimal |
decimalDivide(BigDecimal arg1,
BigDecimal arg2,
int scale)
Perform decimal division to a user-specified precision |
static boolean |
deepEqual(XPathContext context,
SequenceIterator arg1,
SequenceIterator arg2,
String collation,
String flags)
Perform a parameterized deep-equals() test |
static DocumentInfo |
discardDocument(XPathContext context,
DocumentInfo doc)
Remove a document from the document pool. |
static DateTimeValue |
fileLastModified(XPathContext context,
String fileURI)
This function determines the file modification time. |
static String |
generateId(NodeInfo node)
The function saxon:generate-id() is equivalent to the standard XSLT function generate-id(). |
static Configuration |
getConfiguration(XPathContext c)
Return the Configuration object |
static XPathContext |
getContext(XPathContext c)
Return the XPathContext object |
static Controller |
getController(XPathContext c)
Return the Controller object |
static String |
getPseudoAttribute(XPathContext c,
String name)
Get a pseudo-attribute of a processing instruction. |
static boolean |
hasSameNodes(SequenceIterator p1,
SequenceIterator p2)
Determine whether two node-sets contain the same nodes |
static byte[] |
hexBinaryToOctets(HexBinaryValue in)
Convert a hexBinary value to a sequence of integers representing the octets contained in the value |
static String |
hexBinaryToString(XPathContext context,
HexBinaryValue in,
String encoding)
Convert a hexBinary value to a String, assuming a particular encoding |
static Value |
highest(SequenceIterator nsv)
Get the node with maximum numeric value of the string-value of each of a set of nodes |
static SequenceIterator |
highest(XPathContext context,
SequenceIterator nsv,
Evaluate.PreparedExpression pexpression)
Get the maximum numeric value of a stored expression over a set of nodes |
static DateTimeValue |
lastModified(XPathContext c)
This function implements the last-modified() function without any argument. |
static DateTimeValue |
lastModified(XPathContext context,
NodeInfo node)
This function implements the last-modified(node) function with one argument which
must be a node. |
static SequenceIterator |
leading(XPathContext context,
SequenceIterator in,
Evaluate.PreparedExpression pexp)
Get the items that satisfy the given expression, up to and excluding the first one (in sequence order) that doesn't satisfy the expression. |
static int |
lineNumber(NodeInfo node)
Return the line number of the specified node. |
static int |
lineNumber(XPathContext c)
Return the line number of the context node. |
static Value |
lowest(SequenceIterator nsv)
Get the node with minimum numeric value of the string-value of each of a set of nodes |
static SequenceIterator |
lowest(XPathContext context,
SequenceIterator nsv,
Evaluate.PreparedExpression pexpression)
Get the node with minimum numeric value of the string-value of each of a set of nodes |
static NodeInfo |
namespaceNode(XPathContext context,
String prefix,
String uri)
Create a parentless namespace node. |
static Base64BinaryValue |
octetsToBase64Binary(byte[] in)
Convert a sequence of integers in the range 0-255, representing a sequence of octets, to a base64Binary value |
static HexBinaryValue |
octetsToHexBinary(byte[] in)
Convert a sequence of integers in the range 0-255, representing a sequence of octets, to a hexBinary value |
static String |
path(XPathContext c)
Return an XPath expression that identifies the current node |
static void |
pauseTracing(XPathContext c)
Switch tracing off. |
static SequenceIterator |
query(XPathContext context,
XQueryExpression query)
Run a previously-compiled query. |
static SequenceIterator |
query(XPathContext context,
XQueryExpression query,
Item source)
Run a previously-compiled query |
static SequenceIterator |
query(XPathContext context,
XQueryExpression query,
Item source,
SequenceIterator params)
Run a previously-compiled query, supplying parameters to the transformation. |
static void |
resumeTracing(XPathContext c)
Resume tracing. |
static SequenceIterator |
sort(XPathContext context,
SequenceIterator input)
Sort a sequence of nodes or atomic values, using the atomic value itself, or the atomized value of the node, as the sort key. |
static SequenceIterator |
sort(XPathContext context,
SequenceIterator input,
Evaluate.PreparedExpression sortKeyExpression)
Sort a sequence of nodes or atomic values, using a given expression to calculate the sort key. |
static Base64BinaryValue |
stringToBase64Binary(String in,
String encoding)
Convert a string to a base64Binary value in a given encoding |
static HexBinaryValue |
stringToHexBinary(String in,
String encoding)
Convert a string to a hexBinary value in a given encoding |
static List |
stringToUtf8(String in)
Get the UTF-8 encoding of a string |
static String |
systemId(XPathContext c)
Return the system identifier of the context node |
static DocumentInfo |
transform(XPathContext context,
Templates templates,
NodeInfo source)
Run a transformation to convert an input tree to an output document |
static DocumentInfo |
transform(XPathContext context,
Templates templates,
NodeInfo source,
SequenceIterator params)
Run a transformation to convert an input tree to an output document, supplying parameters to the transformation. |
static QNameValue |
typeAnnotation(XPathContext context,
Item item)
Display the value of the type annotation of a node or an atomic value |
static boolean |
validCharacter(XPathContext c,
int in)
Test whether a given integer is the codepoint of a valid XML character |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void pauseTracing(XPathContext c)
c
- the XPath dynamic contextpublic static void resumeTracing(XPathContext c)
c
- the XPath dynamic contextpublic static String systemId(XPathContext c) throws XPathException
c
- the XPath dynamic context
XPathException
public static String generateId(NodeInfo node)
node
- the node whose identifier is required
public static int lineNumber(XPathContext c)
c
- the XPath dynamic context
public static int lineNumber(NodeInfo node)
node
- the node whose line number is required
public static DocumentInfo discardDocument(XPathContext context, DocumentInfo doc)
context
- the evaluation context (supplied implicitly by the call mechanism)doc
- the document to be released from the document pool
public static boolean hasSameNodes(SequenceIterator p1, SequenceIterator p2) throws XPathException
p1
- The first node-set. The iterator must be correctly ordered.p2
- The second node-set. The iterator must be correctly ordered.
XPathException
public static SequenceIterator sort(XPathContext context, SequenceIterator input)
context
- the XPath dynamic contextinput
- the sequence to be sorted
public static SequenceIterator sort(XPathContext context, SequenceIterator input, Evaluate.PreparedExpression sortKeyExpression)
context
- the XPath dynamic contextinput
- the sequence to be sortedsortKeyExpression
- the expression used to compute the sort keys
public static Value highest(SequenceIterator nsv) throws XPathException
nsv
- the input sequence
XPathException
public static SequenceIterator highest(XPathContext context, SequenceIterator nsv, Evaluate.PreparedExpression pexpression) throws XPathException
context
- the XPath dynamic evaluation contextnsv
- the input sequencepexpression
- the expression whose maximum is to be computed
XPathException
public static Value lowest(SequenceIterator nsv) throws XPathException
nsv
- the input sequence
XPathException
public static SequenceIterator lowest(XPathContext context, SequenceIterator nsv, Evaluate.PreparedExpression pexpression) throws XPathException
context
- the XPath dynamic evaluation contextnsv
- the input sequencepexpression
- the expression whose minimum is to be computed
XPathException
public static SequenceIterator leading(XPathContext context, SequenceIterator in, Evaluate.PreparedExpression pexp)
context
- the XPath dynamic evaluation contextin
- the input sequencepexp
- the expression against which items are to be tested
public static SequenceIterator after(XPathContext context, SequenceIterator ns1, SequenceIterator ns2) throws XPathException
context
- the dynamic evaluation contextns1
- the first operandns2
- the second operand
XPathException
public static String path(XPathContext c) throws XPathException
c
- the XPath dynamic context
XPathException
public static QNameValue typeAnnotation(XPathContext context, Item item)
context
- the XPath dynamic contextitem
- the node or atomic value whose type annotation is required
public static XPathContext getContext(XPathContext c)
c
- the context object
public static Controller getController(XPathContext c)
c
- the XPath dynamic context
public static Configuration getConfiguration(XPathContext c)
c
- the XPath dynamic context
public static String getPseudoAttribute(XPathContext c, String name) throws XPathException
c
- the XPath dynamic context. The context item should be a processing instruction,
though it doesn't matter if it isn't: the function will look at the string-value of the context item
whatever it is.name
- the name of the required pseudo-attribute
XPathException
public static BigDecimal decimalDivide(BigDecimal arg1, BigDecimal arg2, int scale)
arg1
- the numeratorarg2
- the denominatorscale
- the required number of digits in the result of the division
public static List stringToUtf8(String in)
in
- the supplied string
public static Base64BinaryValue octetsToBase64Binary(byte[] in)
in
- the input array of bytes (octets)
public static HexBinaryValue octetsToHexBinary(byte[] in)
in
- the input array of bytes (octets)
public static byte[] base64BinaryToOctets(Base64BinaryValue in)
in
- the supplied base64Binary value
public static byte[] hexBinaryToOctets(HexBinaryValue in)
in
- the input hexBinary value
public static String base64BinaryToString(XPathContext context, Base64BinaryValue in, String encoding) throws Exception
context
- the XPath dynamic contextin
- the supplied base64Binary valueencoding
- the character encoding
Exception
public static Base64BinaryValue stringToBase64Binary(String in, String encoding) throws IOException
in
- the input stringencoding
- the desired encoding
IOException
public static String hexBinaryToString(XPathContext context, HexBinaryValue in, String encoding) throws Exception
context
- the XPath dynamic contextin
- the supplied hexBinary valueencoding
- the character encoding
Exception
public static HexBinaryValue stringToHexBinary(String in, String encoding) throws Exception
in
- the input stringencoding
- the desired encoding
Exception
public static boolean validCharacter(XPathContext c, int in)
c
- the XPath dynamic contextin
- the character to be tested
public static NodeInfo namespaceNode(XPathContext context, String prefix, String uri) throws XPathException
context
- the dynamic evaluation contextprefix
- the name of the namespace nodeuri
- the string value of the namespace node
XPathException
public static boolean deepEqual(XPathContext context, SequenceIterator arg1, SequenceIterator arg2, String collation, String flags) throws XPathException
context
- The evaluation contextarg1
- The first sequence to be comparedarg2
- The second sequence to be comparedcollation
- The collation to be used (null if the default collation is to be used)flags
- A string whose characters select options that cause the comparison to vary from the
standard fn:deep-equals() function. The flags are:
XPathException
public static DateTimeValue lastModified(XPathContext c) throws XPathException
last-modified()
function without any argument. It returns
the modification time of the file containing the context node.
c
- the dynamic evaluation context supplied by Saxon
XPathException
- XPath dynamic error reported back to Saxonpublic static DateTimeValue lastModified(XPathContext context, NodeInfo node) throws XPathException
last-modified(node)
function with one argument which
must be a node. It returns the modification time of the file containing the context node.
node
- the node supplied by a user
XPathException
- if an error occurs and the configuration option TRACE_EXTERNAL_FUNCTIONS is truepublic static DateTimeValue fileLastModified(XPathContext context, String fileURI) throws XPathException
context
- the XPath dynamic evaluation contextfileURI
- the URI of a file. This must be an absolute URI to which Saxon can connect
XPathException
- if an error occurs and the configuration option TRACE_EXTERNAL_FUNCTIONS is truepublic static Templates compileStylesheet(XPathContext context, DocumentInfo doc) throws XPathException
context
- the XPath dynamic evaluation contextdoc
- the document containing the stylesheet to be compiled
XPathException
public static DocumentInfo transform(XPathContext context, Templates templates, NodeInfo source) throws XPathException
context
- The dynamic contexttemplates
- The compiled stylesheetsource
- The initial context node representing the document to be transformed
XPathException
public static DocumentInfo transform(XPathContext context, Templates templates, NodeInfo source, SequenceIterator params) throws XPathException
context
- The dynamic contexttemplates
- The compiled stylesheetsource
- The initial context node representing the document to be transformedparams
- A sequence of nodes (typically element nodes) supplying values of parameters.
The name of the node should match the name of the parameter, the typed value of the node is
used as the value of the parameter.
XPathException
public static XQueryExpression compileQuery(XPathContext context, String query) throws XPathException
context
- the XPath dynamic evaluation contextquery
- a string containing the query to be compiled
XPathException
public static SequenceIterator query(XPathContext context, XQueryExpression query) throws XPathException
context
- The dynamic contextquery
- The compiled query
XPathException
public static SequenceIterator query(XPathContext context, XQueryExpression query, Item source) throws XPathException
context
- The dynamic contextquery
- The compiled querysource
- The initial context item for the query (may be null)
XPathException
public static SequenceIterator query(XPathContext context, XQueryExpression query, Item source, SequenceIterator params) throws XPathException
context
- The dynamic contextquery
- The compiled querysource
- The initial context node for the query (may be null)params
- A sequence of nodes (typically element nodes) supplying values of parameters.
The name of the node should match the name of the parameter, the typed value of the node is
used as the value of the parameter.
XPathException
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |