1 package net.sf.saxon.exslt; 2 import net.sf.saxon.expr.XPathContext; 3 import net.sf.saxon.pattern.AnyNodeTest; 4 import net.sf.saxon.type.ItemType; 5 import net.sf.saxon.type.Type; 6 import net.sf.saxon.value.Value; 7 8 12 13 14 15 public abstract class Common { 16 17 20 private Common() { 21 } 22 23 27 28 public static Value nodeSet(Value frag) { 29 return frag; 30 } 31 32 36 37 public static String objectType(XPathContext context, Value value) { 38 ItemType type = value.getItemType(); 39 if (Type.isSubType(type, AnyNodeTest.getInstance())) { 40 return "node-set"; 41 } else if (Type.isSubType(type, Type.STRING_TYPE)) { 42 return "string"; 43 } else if (Type.isSubType(type, Type.NUMBER_TYPE)) { 44 return "number"; 45 } else if (Type.isSubType(type, Type.BOOLEAN_TYPE)) { 46 return "boolean"; 47 } else { 48 return type.toString(context.getController().getNamePool()); 49 } 50 } 51 52 53 } 54 55 56 57 58 59 | Popular Tags |