protected function getFuzzyChapterTitles() {

		$chapters = [];

		$xml = $this->getZipContent( 'content.xml' );

		// introduce a stylesheet
		$proc = new \XSLTProcessor();
		$xsl = new \DOMDocument();
		$xsl->load( __DIR__ . '/xsl/odt2html.xsl' );
		$proc->importStylesheet( $xsl );

		// throw it back into the DOM
		$dom_doc = $proc->transformToDoc( $xml );

		// get all headings
		$headings = $dom_doc->getElementsByTagName( $this->tag );

		// populate chapters with title names
		for ( $i = 0; $i < $headings->length; $i++ ) {
			$chapters[] = trim( $headings->item( $i )->nodeValue );
		}

		// get rid of h1 tags with empty values
		$chapters = array_values( array_filter( $chapters ) );

		// default chapter title if there are no h1 headings in the document
		if ( 0 === count( $chapters ) ) {
			$chapters[] = '__UNKNOWN__';
		}

		return $chapters;
	}
protected function getFuzzyChapterTitles() {

		$chapters = [];

		$xml = $this->getZipContent( 'content.xml' );

		// introduce a stylesheet
		$proc = new \XSLTProcessor();
		$xsl = new \DOMDocument();
		$xsl->load( __DIR__ . '/xsl/odt2html.xsl' );
		$proc->importStylesheet( $xsl );

		// throw it back into the DOM
		$dom_doc = $proc->transformToDoc( $xml );

		// get all headings
		$headings = $dom_doc->getElementsByTagName( $this->tag );

		// populate chapters with title names
		for ( $i = 0; $i < $headings->length; $i++ ) {
			$chapters[] = trim( $headings->item( $i )->nodeValue );
		}

		// get rid of h1 tags with empty values
		$chapters = array_values( array_filter( $chapters ) );

		// default chapter title if there are no h1 headings in the document
		if ( 0 === count( $chapters ) ) {
			$chapters[] = '__UNKNOWN__';
		}

		return $chapters;
	}
protected function getFuzzyChapterTitles ( ) { $ chapters = [ ] ; $ xml = $ this -> getZipContent ( 'content.xml' ) ; // introduce a stylesheet $ proc = new \ XSLTProcessor ( ) ; $ xsl = new \ DOMDocument ( ) ; $ xsl -> load ( __DIR__ . '/xsl/odt2html.xsl' ) ; $ proc -> importStylesheet ( $ xsl ) ; // throw it back into the DOM $ dom_doc = $ proc -> transformToDoc ( $ xml ) ; // get all headings $ headings = $ dom_doc -> getElementsByTagName ( $ this -> tag ) ; // populate chapters with title names for ( $ i = 0 ; $ i < $ headings -> length ; $ i ++ ) { $ chapters [ ] = trim ( $ headings -> item ( $ i ) -> nodeValue ) ; } // get rid of h1 tags with empty values $ chapters = array_values ( array_filter ( $ chapters ) ) ; // default chapter title if there are no h1 headings in the document if ( 0 === count ( $ chapters ) ) { $ chapters [ ] = '__UNKNOWN__' ; } return $ chapters ; }
Returns an array of available chapters, or 'unknown' if none

@return array Chapter titles
Returns an array of available chapters or unknown if none