Code example for StreamSource

Methods: setSystemId

0
		File xsl = new File("E:\\HIN\\source\\hin-web\\src\\main\\webapp\\data-layer\\Rim_with_id.xsl");
		File out = new File("E:\\HIN\\source\\hin-web\\src\\main\\webapp\\data-layer\\TranFormed_with_id.xml");
 
		TransformerFactory tFactory = TransformerFactory.newInstance();
 
		StreamSource source = new StreamSource(xsl);
		source.setSystemId(xsl);
		 
		Transformer tr = null;
		try { 
			tr = tFactory.newTransformer(source);
			/*File list = new File(((String)tr.getParameter("baseDirFullPath")).concat(((String)tr.getParameter("baseDirFullPath"))))*/ 
			tr.setParameter("helper",  new XSLHelper());
		} catch (TransformerConfigurationException e1) {
			logger.error("TransformationConfiguration error: "+e1.getMessage());
		} 
		try { 
			StreamResult result = new StreamResult(out);
			StreamSource docSrc = new StreamSource(xml);
			docSrc.setSystemId(xml);
			tr.transform(docSrc, result);