KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > saxon > functions > TreatFn


1 package net.sf.saxon.functions;
2 import net.sf.saxon.expr.*;
3 import net.sf.saxon.om.Item;
4 import net.sf.saxon.om.SequenceIterator;
5 import net.sf.saxon.trans.XPathException;
6 import net.sf.saxon.type.ItemType;
7
8 /**
9 * This class supports the XPath 2.0 functions exactly-one(), one-or-more(), zero-or-one().
10 * Because Saxon doesn't do strict static type checking, these are essentially identity
11 * functions; the run-time type checking is done as part of the function call mechanism
12 */

13
14 public class TreatFn extends SystemFunction {
15
16     /**
17     * Evaluate the function
18     */

19
20     public Item evaluateItem(XPathContext context) throws XPathException {
21         return argument[0].evaluateItem(context);
22     }
23
24     /**
25     * Iterate over the results of the function
26     */

27
28     public SequenceIterator iterate(XPathContext context) throws XPathException {
29        return argument[0].iterate(context);
30     }
31
32 }
33
34 //
35
// The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
36
// you may not use this file except in compliance with the License. You may obtain a copy of the
37
// License at http://www.mozilla.org/MPL/
38
//
39
// Software distributed under the License is distributed on an "AS IS" basis,
40
// WITHOUT WARRANTY OF ANY KIND, either express or implied.
41
// See the License for the specific language governing rights and limitations under the License.
42
//
43
// The Original Code is: all this file.
44
//
45
// The Initial Developer of the Original Code is Michael H. Kay.
46
//
47
// Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
48
//
49
// Contributor(s): none.
50
//
51
Popular Tags