Parses an XML file and produces a Templates object.

@param filename
name of .xsl file, to be looked up in the classpath, under the
same package as this class.
@return Templates object usable for XSL transformation
439690
private Templates getTemplates(String filename) {
	// InputStream is =
	// AnnotationViewGenerator.class.getResourceAsStream(filename);
	Templates templates;
	InputStream is = null;
	try {
	    is = ResourceHelper.getInputStream("viewer/" + filename);
	    templates = mTFactory.newTemplates(new StreamSource(is));
	} catch (Exception e) {
	    throw new UIMARuntimeException(e);
	} finally {
	    IOUtils.closeQuietly(is);
	}
	return templates;
    }
237229
def parseFile(filename):
    
    ret = libxml2mod.xmlParseFile(filename)
    if ret is None:raise parserError('xmlParseFile() failed')
    return xmlDoc(_obj=ret)
707774
private File getTemplateFile(String filename) throws IOException {
        File templateFile=null;
        final String resource = TEMPLATE_RESOURCES_PATH + "/" + filename;
        InputStream is = Setup.class.getClassLoader().getResourceAsStream(resource);
        if (null == is) {
            throw new RuntimeException("Unable to load required template: " + resource);
        }
        templateFile = File.createTempFile("temp", filename);
        templateFile.deleteOnExit();
        try {
            return copyToNativeLineEndings(is, templateFile);
        } finally {
            is.close();
        }
    }
603244
def htmlParseFile(filename, encoding):
    
    ret = libxml2mod.htmlParseFile(filename, encoding)
    if ret is None:raise parserError('htmlParseFile() failed')
    return xmlDoc(_obj=ret)
956249
public static Template parse(String input) {
        return new Template(input, Tag.getTags(), Filter.getFilters());
    }
1284725
public void load(String filename) throws FileNotFoundException, SAXException, IOException, ParserConfigurationException {
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    loadMessages(builder.parse(new CSFileInputStream(filename)));
  }
758549
protected static function loadXml( $fileName )
	{
		$xml	= XML_ElementReader::readFile( $fileName );
		foreach( $xml as $sectionNode )
		{
			$sectionName	= $sectionNode->getAttribute( 'name' );
			foreach( $sectionNode as $valueNode )
			{
				$item	= array(
					'key'		=> $valueNode->getAttribute( 'name' ),
					'value'		=> (string) $valueNode,
					'type'		=> $valueNode->getAttribute( 'type' ),
				);
	
				if( $valueNode->hasAttribute( 'comment' ) )
					$item['comment']	= $valueNode->getAttribute( 'comment' );
				settype( $item['value'], $item['type'] );
				$data[$sectionName][]	= $item;
			}
		}
		return $data;
	}
32013
public static JavaClass getBcelClass(final String filename) throws IOException {
    final ClassParser parser = new ClassParser(filename);
    return parser.parse();
  }
814377
def load_xslt(filename=None, xsl=None):
    '''
    '''
    parser = _get_xmlparser()
    if filename is not None:
        xslt_doc = etree.parse(filename, parser=parser)
    if xsl is not None:
        xslt_doc = etree.fromstring(xsl, parser=parser)

    return etree.XSLT(xslt_doc)
1042126
public static String toXml(Collection<?> root, String rootName, Class clazz) {
		return toXml(root, rootName, clazz, null);
	}
785241
private static void transform(final String xmlFileName, final String xsltFileName, final String outputFileName) {
        Source xsltSource = null;
        if (StringUtils.isNotBlank(xsltFileName)) {
            // Use the given stylesheet.
            xsltSource = new StreamSource(new File(xsltFileName));
        } else {
            // Use the default stylesheet.
            xsltSource = new StreamSource(Thread.currentThread().getContextClassLoader().getResourceAsStream(DEFAULT_XSLT_SHEET));
        }

        // Transform the given input file and put the result in the given output file.
        final Source xmlSource = new StreamSource(new File(xmlFileName));
        final Result xmlResult = new StreamResult(new File(outputFileName));

        XmlUtils.transform(xmlSource, xsltSource, xmlResult);
    }
958327
def htmlCreateFileParserCtxt(filename, encoding):
    
    ret = libxml2mod.htmlCreateFileParserCtxt(filename, encoding)
    if ret is None:raise parserError('htmlCreateFileParserCtxt() failed')
    return parserCtxt(_obj=ret)
877928
public T loadXml(File file) {

    FileResource resource = new FileResource(file);
    return loadXml(resource);
  }
727230
private ThymeLeafTemplateImplementation getTemplateByFile(File templateFile) {
        try {
            return getTemplateByURL(templateFile.toURI().toURL());
        } catch (MalformedURLException e) {  //NOSONAR
            // Ignored.
        }
        return null;
    }
1013832
function templateFile( $templateName )
    {
        if ( isset( $this->Templates[$templateName] ) )
        {
            return $this->Templates[$templateName]['filepath'];
        }
        return false;
    }
748498
public InputStream getConfPathXmlStream(String filePathName){
     int i = filePathName.lastIndexOf(".xml");
     String name = filePathName.substring(0, i);
     name = name.replace('.', '/');
     name += ".xml";
     return getConfStream(name);
  }
971927
public InputStream loadTemplate(String fileName) throws IOException {
	Path currentPath=new Path(fileName);
	return openFile(currentPath);
}