001    package railo.runtime.functions.decision;
002    
003    import org.w3c.dom.Node;
004    import org.w3c.dom.NodeList;
005    
006    import railo.runtime.PageContext;
007    import railo.runtime.ext.function.Function;
008    import railo.runtime.text.xml.struct.XMLStruct;
009    
010    /**
011     * Check if a value is a XML Node 
012     */
013    public final class IsXmlNode implements Function {
014    
015            public static boolean call(PageContext pc, Object value) {
016                if(value instanceof Node)return true;
017                else if(value instanceof NodeList) return ((NodeList)value).getLength()>0;
018                else if(value instanceof XMLStruct) return true;
019                return false;
020            }
021    }