1 package org.ejen.ext; 22 23 import org.ejen.util.DOMUtil; 24 import org.ejen.util.XSLUtil; 25 import org.w3c.dom.Node ; 26 import org.apache.xalan.extensions.ExpressionContext; 27 import org.apache.xml.utils.WrappedRuntimeException; 28 29 56 public class XMLInclude { 57 58 61 protected XMLInclude() {} 62 63 80 public static Node load(ExpressionContext context, String fileName) { 81 return load(XSLUtil.evaluate(context, fileName)); 82 } 83 84 91 protected static Node load(String fileName) { 92 try { 93 return DOMUtil.parseXMLFile(fileName).getDocumentElement(); 94 } catch (WrappedRuntimeException e) { 95 throw e; 96 } catch (Exception e) { 97 throw new WrappedRuntimeException(e); 98 } 99 } 100 } 101 | Popular Tags |