public function encode($xsl)
	{
		$this->xsl = $xsl;

		$this->estimateSavings();
		$this->filterSavings();
		$this->buildDictionary();

		$js = json_encode($this->getCompressedStylesheet());
		if (!empty($this->dictionary))
		{
			$js .= '.replace(' . $this->getReplacementRegexp() . ',function(k){return' . json_encode($this->dictionary) . '[k]})';
		}

		return $js;
	}