// $Id: CXslFile.cc,v 1.2 2003/04/08 13:54:17 ta_muto Exp $

#include <views/CXslFile.h>
#include <CXmlLibs.h>

wax::CXslFile::~CXslFile()
{
	if(reader != NULL)	delete reader;
	if(stylesheet != NULL)	xsltFreeStylesheet(stylesheet);
}

xsltStylesheetPtr wax::CXslFile::getXslDocument()
{
	return stylesheet;
}

bool wax::CXslFile::retrieve()
{
	xmlDocPtr doc = CXmlLibs::read(reader);
	if(doc == NULL)	return false;

	stylesheet = xsltParseStylesheetDoc(doc);
	if(stylesheet == NULL)	return false;
	return true;
}
