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;
	}
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;
	}
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 ; }
Encode given stylesheet into a compact JavaScript representation

@param  string $xsl Original stylesheet
@return string      JavaScript representation of the compressed stylesheet
Encode given stylesheet into a compact JavaScript representation