package siprp.higiene.gestao.importacao;

import java.io.ByteArrayOutputStream;
import java.io.FileOutputStream;
import java.io.InputStream;

import com.evolute.utils.xml.XSLTransformer;

public class Importador
{
	public static void main( String args[] )
		throws Exception
	{
		Importador importador = new Importador();
		importador.converter();
	}
	
	public void converter()
		throws Exception
	{
		InputStream xsl = getClass().getClassLoader().getResourceAsStream( "siprp/higiene/gestao/importacao/importacao_ods_to_xml.xsl" );
		InputStream xmlContent = getClass().getClassLoader().getResourceAsStream( "siprp/higiene/gestao/importacao/content.xml" );
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		XSLTransformer.getXSLTransformer().transform( xmlContent, xsl, baos );
		FileOutputStream fos = new FileOutputStream( "/home/fpalma/projectos2/SIPRP/SIPRPSoft/src/siprp/higiene/gestao/importacao/data.xml" );
		fos.write( baos.toByteArray() );
		fos.close();
		System.out.println( new String( baos.toByteArray() ) );
	}
	
	public void importar()
	{
		
	}
}
