Setter for `$this->_xsl`, can optionally load the XSLT from a file.

@param string $xsl
The XSLT for this XSLT page
@param boolean $isFile
If set to true, the XSLT will be loaded from a file. It is false by default
485882
public function setXSL($xsl, $isFile = false)
    {
        $this->_xsl = ($isFile ? file_get_contents($xsl) : $xsl);
    }
1047694
static public function makeSlug($title, $isFile = FALSE)
    {
        $slug = strtr(
                utf8_decode(mb_strtolower($title, 'UTF-8')),
                utf8_decode(
                        'àáâãäåòóôõöøèéêëçìíîïùúûüÿñ'),
                        'aaaaaaooooooeeeeciiiiuuuuyn');
        if ($isFile)
        {
            return preg_replace(array('`[^a-z0-9\._]`i', '`[-]+`'), '-', $slug);
        }
        return preg_replace(array('`[^a-z0-9]`i', '`[-]+`'), '-', $slug);
    }
1256060
public static XSLUpdate readFile(final InstallFile _installFile)
    {
        final XSLUpdate ret = new XSLUpdate(_installFile);
        final XSLDefinition definition = ret.new XSLDefinition(_installFile);
        ret.addDefinition(definition);
        return ret;
    }
1245855
protected void loadDataFromFile(InputStream is) throws IOException {
		PHPFileParser fp = new PHPFileParser(is);
		createInternalDataStructre(fp.getSections());
	}
139613
protected function loadElementsFromXmlFileWithPath($xmlFile, $nodePath)
    {
        $xml = file_get_contents($xmlFile);
        // Remove whitespaces between closing tag and opening tag.
        $xml = preg_replace('/>\s+</', '><', $xml);

        $doc = new \DOMDocument();
        $doc->loadXML($xml);

        $xpath = new \DOMXpath($doc);
        $elements = $xpath->query($nodePath);

        return $elements;
    }
986821
public function load($ofxFile)
    {
        $content = file_get_contents($ofxFile);

        //Headers
        $inicio = stripos($content, '<OFX>');
        $header = trim(substr($content, 0, $inicio));
        $this->headers = $this->headers($header);

        $content = str_replace($header, '', $content);

        $dom = new \DOMDocument();
        $dom->loadXML($content);

        //Ofx
        $this->saldoTotal = $dom->getElementsByTagName('BALAMT')->item(0)->textContent;
        $this->dataInicial = $this->date($dom->getElementsByTagName('DTSTART')->item(0)->textContent);
        $this->dataFinal = $this->date($dom->getElementsByTagName('DTEND')->item(0)->textContent);

        //Conta
        $this->conta->banco = $dom->getElementsByTagName('BANKID')->item(0)->textContent;
        $this->conta->numConta = substr($dom->getElementsByTagName('ACCTID')->item(0)->textContent, 5);
        $this->conta->agencia = substr($dom->getElementsByTagName('ACCTID')->item(0)->textContent, 0, 5);

        //Transacoes
        foreach ($dom->getElementsByTagName('STMTTRN') as $item) {
            $transacao = new Transacao();

            $transacao->tipo = $item->getElementsByTagName('TRNTYPE')->item(0)->textContent;
            $transacao->valor = $item->getElementsByTagName('TRNAMT')->item(0)->textContent;
            $transacao->descricao = $item->getElementsByTagName('MEMO')->item(0)->textContent;
            $transacao->data = $this->date($item->getElementsByTagName('DTPOSTED')->item(0)->textContent);
            $transacao->checkNum = $item->getElementsByTagName('CHECKNUM')->item(0)->textContent;
            $transacao->transacaoId = $item->getElementsByTagName('FITID')->item(0)->textContent;

            $this->transacoes[] = $transacao;
        }
    }
1061795
def load_xml(self, xmlfile):
        

        self.logger.info('Loading XML')

        for c in self.components:
            c.load_xml(xmlfile)

        for name in self.like.sourceNames():
            self.update_source(name)

        self._fitcache = None

        self.logger.info('Finished Loading XML')
485
public function set_html($source, $from_file = false)
    {
        if ($from_file && file_exists($source)) {
            $this->html = file_get_contents($source);
        } else {
            $this->html = $source;
        }

        $this->_converted = false;
    }
1002728
public function readInet($isCollectionElement = false) {
		if ($isCollectionElement) {
			$data = $this->read($this->readShort());
		} else {
			$data = $this->data;
		}
		return inet_ntop($data);
	}
931082
private void init(InputSource is) throws TagLibException {
	// print.dumpStack();
	try {
	    xmlReader = XMLUtil.createXMLReader();
	    xmlReader.setContentHandler(this);
	    xmlReader.setErrorHandler(this);
	    xmlReader.setEntityResolver(new TagLibEntityResolver());
	    xmlReader.parse(is);
	}
	catch (IOException e) {

	    // String fileName=is.getSystemId();
	    // String message="IOException: ";
	    // if(fileName!=null) message+="In File ["+fileName+"], ";
	    throw new TagLibException(e);
	}
	catch (SAXException e) {
	    // String fileName=is.getSystemId();
	    // String message="SAXException: ";
	    // if(fileName!=null) message+="In File ["+fileName+"], ";
	    throw new TagLibException(e);
	}

    }
497007
public static XslTransformer getTransformer(File xslFile) throws TransformerConfigurationException {
    	if (xslFile == null) {
    		throw new IllegalArgumentException("xslFile is null");
    	}
        return getTransformer(new StreamSource(xslFile));
    }
425601
public function xmlShouldBeValid($xmlFile, $schemaPath)
    {
        $dom = new DomDocument();
        $dom->load($this->workingDir . '/' . $xmlFile);

        $dom->schemaValidate(__DIR__ . '/schema/' . $schemaPath);
    }
971638
public function isValidMetaFile()
	{
		if ( $this->metaFile ) return true;

		$metaFilePath = key( $this->contents ) . "/" . XBRL_TaxonomyPackage::metaFolderName . "/" . XBRL_TaxonomyPackage::taxonomyPackageFilename;

		try
		{
			// The XML should be valid
			$xml = $this->getFileAsXML( $metaFilePath );
			// Can't access the namespace of an element from SimpleXML so use the DOM version
			$dom = dom_import_simplexml( $xml );
			$namespace = $dom->namespaceURI;
			unset( $dom );

			// The root element should be taxonomyPackage
			if ( $xml->getName() != XBRL_TaxonomyPackage::rootElementNme )
			{
				throw XBRL_TaxonomyPackageException::withError( "tpe:invalidMetaDataFile", $ex->getMessage() );
			}

			$this->metaFile = $xml;

			// Now time to read elements and validate the document
			$xmlAttributes = $xml->attributes( 'xml', true );
			$lang = isset( $xmlAttributes['lang'] ) ? (string)$xmlAttributes['lang'] : '';

			foreach ( $xml->children( $namespace ) as $name => $element )
			{
				switch ( $name )
				{
					case 'name':
					case 'description':
					case 'publisher':

						$elementXmlAttributes = $element->attributes( 'xml', true );
						$elementLang = isset( $elementXmlAttributes['lang'] ) ? (string)$elementXmlAttributes['lang'] : $lang;

						if ( empty( $elementLang ) )
						{
							throw XBRL_TaxonomyPackageException::withError( "tpe:missingLanguageAttribute", "The language code must not be empty") ;
						}

						if ( isset( $this->$name[ $elementLang ] ) )
						{
							throw XBRL_TaxonomyPackageException::withError( "tpe:duplicateLanguagesForElement", "The language must be unique across all names");
						}

						$this->$name[ $elementLang ] = (string)$element;

						unset( $elementAttributes );
						break;

					case 'identifier':
					case 'version':
					case 'publisherURL':
					case 'publisherCountry':
					case 'publicationDate':
					case 'publisherCountry':

						// There should be only one instance
						if ( ! is_null( $this->$name ) )
						{
							throw XBRL_TaxonomyPackageException::withError( "tpe:invalidMetaDataFile", "The element '$name' must not be repeated");
						}

						// Check for a valid country code if relevant
						if ( $name == 'publisherCountry' && ( strlen( (string)$element ) != 2 || ! isset( self::$countries[ (string)$element ] ) ) )
						{
							throw XBRL_TaxonomyPackageException::withError( 'tpe:invalidMetaDataFile', "The contry code '$element' is not a valid 2-letter country code" );
						}

						$this->$name = (string)$element;
						break;

					case 'license':

						// There should be only one instance
						if ( ! is_null( $this->$name ) )
						{
							throw XBRL_TaxonomyPackageException::withError( "tpe:invalidMetaDataFile", "The element '$name' must not be repeated");
						}

						$elementAttributes = $xml->attributes();
						$licenseName = isset( $elementAttributes['name'] ) ? (string)$elementAttributes['name'] : '';
						if ( ! $licenseName ) continue;
						$href = isset( $elementAttributes['href'] ) ? (string)$elementAttributes['href'] : '';

						$this->$name['name'] = $licenseName;
						$this->$name['href'] = $href;

						unset( $licenseName );
						unset( $href );
						unset( $elementAttributes );
						break;

					case 'entryPoints':

						$elementXmlAttributes = $element->attributes( 'xml', true );
						$elementLang = isset( $elementXmlAttributes['lang'] ) ? (string)$elementXmlAttributes['lang'] : $lang;

						$entryPoints = array();

						foreach ( $element->children( $namespace ) as $entryPointName => $entryPoint )
						{
							$elementXmlAttributes = $entryPoint->attributes( 'xml', true );
							$elementLang2 = isset( $elementXmlAttributes['lang'] ) ? (string)$elementXmlAttributes['lang'] : $elementLang;

							$entryPoints[] = array();
							$index = count( $entryPoints ) - 1;

							foreach ( $entryPoint->children( $namespace ) as $elementName => $element )
							{
								switch ( $elementName )
								{
									case 'name':
									case 'description':

										$elementXmlAttributes = $element->attributes( 'xml', true );
										$elementLang3 = isset( $elementXmlAttributes['lang'] ) ? (string)$elementXmlAttributes['lang'] : $elementLang2;

										if ( empty( $elementLang3 ) )
										{
											throw XBRL_TaxonomyPackageException::withError( "tpe:missingLanguageAttribute", "The language code must not be empty") ;
										}

										if ( isset( $entryPoints[ $index ][ $elementName ][ $elementLang3 ] ) )
										{
											throw XBRL_TaxonomyPackageException::withError( "tpe:duplicateLanguagesForElement", "The language must be unique across all names");
										}

										$entryPoints[ $index ][ $elementName ][ $elementLang3 ] = (string)$element;

										unset( $elementXmlAttributes );
										break;

									case 'version':

										// There should be only one instance
										if ( isset( $entryPoints[ $index ][ $elementName ] ) )
										{
											throw XBRL_TaxonomyPackageException::withError( "tpe:invalidMetaDataFile", "The element '$elementName' must not be repeated");
										}

										$entryPoints[ $index ][ $elementName ] = (string)$element;
										break;

									case 'entryPointDocument':

										$elementAttributes = $element->attributes();
										if ( ! isset( $elementAttributes->href ) )
										{
											throw XBRL_TaxonomyPackageException::withError( "tpe:invalidMetaDataFile", "Missing the @href on element '$elementName'");
										}

										$href = (string)$elementAttributes->href;
										$entryPoints[ $index ][ $elementName ][] = $href;

										unset( $href );
										unset( $elementAttributes );
										break;

									case 'languages':

										foreach ( $element as $languageElement => $language )
										{
											$entryPoints[ $index ][ $elementName ][] = (string)$language;
										}
										unset( $languageElement );
										unset( $language );
										break;
								}
							}

							unset( $element );
							unset( $elementName );
						}


						$this->entryPoints = $entryPoints;

						unset( $entryPoints );
						unset( $entryPoint );
						unset( $entryPointName );

						break;

					default:

						// supersededTaxonomyPackages
						// versioningReports
						break;
				}
			}

			unset( $element );

		}
		catch ( XBRL_TaxonomyPackageException $ex )
		{
			throw $ex;
		}
		catch ( Exception $ex )
		{
			throw XBRL_TaxonomyPackageException::withError( "tpe:invalidMetaDataFile", $ex->getMessage() );
		}

		return true;
	}
652225
public function isHeader($isHeader = true)
        {
            foreach ($this->_cells as $cell) {
                $cell->isHeader($isHeader);
            }

            return $this;
        }
814377
def load_xslt(filename=None, xsl=None):
    '''
    '''
    parser = _get_xmlparser()
    if filename is not None:
        xslt_doc = etree.parse(filename, parser=parser)
    if xsl is not None:
        xslt_doc = etree.fromstring(xsl, parser=parser)

    return etree.XSLT(xslt_doc)
1282769
public function saveXML(string $XMLfile): void
    {
        $file = new FileManager();
        $file->saveLittleFile($this->xmlData, $XMLfile);
    }
789757
public function run()
    {
        CommonFunctions::checkForExtensions(array('xsl'));
        $xmlfile = $this->getXMLString();
        $xslfile = "phpsysinfo.xslt";
        $domxml = new DOMDocument();
        $domxml->loadXML($xmlfile);
        $domxsl = new DOMDocument();
        $domxsl->load($xslfile);
        $xsltproc = new XSLTProcessor;
        $xsltproc->importStyleSheet($domxsl);
        echo $xsltproc->transformToXML($domxml);
    }