1 16 19 package org.apache.xalan.lib; 20 21 import org.apache.xalan.extensions.ExpressionContext; 22 import org.apache.xml.dtm.DTMIterator; 23 import org.apache.xml.dtm.ref.DTMNodeIterator; 24 import org.apache.xpath.NodeSet; 25 26 39 public class ExsltCommon 40 { 41 59 public static String objectType (Object obj) 60 { 61 if (obj instanceof String ) 62 return "string"; 63 else if (obj instanceof Boolean ) 64 return "boolean"; 65 else if (obj instanceof Number ) 66 return "number"; 67 else if (obj instanceof DTMNodeIterator) 68 { 69 DTMIterator dtmI = ((DTMNodeIterator)obj).getDTMIterator(); 70 if (dtmI instanceof org.apache.xpath.axes.RTFIterator) 71 return "RTF"; 72 else 73 return "node-set"; 74 } 75 else 76 return "unknown"; 77 } 78 79 99 public static NodeSet nodeSet(ExpressionContext myProcessor, Object rtf) 100 { 101 return Extensions.nodeset(myProcessor, rtf); 102 } 103 104 } 105 | Popular Tags |