Source for file ContentDocument.php
Documentation is available at ContentDocument.php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
* Created on 04. Jan. 2007 by Norman Markgraf (nmarkgraf(at)user.sourceforge.net)
* OpenDocumentAbstract class file.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* This software consists of voluntary contributions made by many individuals
* and is licensed under the GPL. For more information please see
* <http://opendocumentphp.org>.
* $Id: ContentDocument.php 257 2007-08-02 12:19:56Z nmarkgraf $
* @package OpenDocumentPHP
* @author Norman Markgraf (nmarkgraf(at)user.sourceforge.net)
* @copyright Copyright in 2006, 2007 by The OpenDocumentPHP Team
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License 2.0.
* @version SVN: $Id: ContentDocument.php 257 2007-08-02 12:19:56Z nmarkgraf $
* @link http://opendocumentphp.org
* @since 0.5.0 - 08. Feb. 2007
require_once 'OpenDocumentPHP/content/body/BodyFragment.php';
require_once 'OpenDocumentPHP/global/FontFaceDeclFragment.php';
require_once 'OpenDocumentPHP/global/AutomaticStylesFragment.php';
require_once 'OpenDocumentPHP/content/ScriptsFragment.php';
require_once 'OpenDocumentPHP/util/AbstractDocument.php';
* @package OpenDocumentPHP
* @author Norman Markgraf (nmarkgraf(at)user.sourceforge.net)
* @copyright Copyright in 2006, 2007 by The OpenDocumentPHP Team
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License 2.0.
* @version Release: @package_version@
* @link http://opendocumentphp.org
* @since 0.5.0 - 08. Feb. 2007
* @since 0.5.0 - 08. Feb. 2007
* @var FontFaceDeclFragment
* @since 0.5.0 - 08. Feb. 2007
* @var AutomaticStylesFragment
* @since 0.5.0 - 08. Feb. 2007
private $automaticstyles;
* @since 0.5.0 - 08. Feb. 2007
* @since 0.5.0 - 08. Feb. 2007
$this->root->appendChild($this->scripts);
// append FontFaceDeclFragment
$this->root->appendChild($this->fontfacedecl);
// append AutomaticStylesFragment
$this->root->appendChild($this->automaticstyles);
$this->root->appendChild($this->body);
* @since 0.5.0 - 08. Feb. 2007
* @since 0.5.0 - 08. Feb. 2007
* @since 0.5.0 - 08. Feb. 2007
* @since 0.5.0 - 08. Feb. 2007
return $this->fontfacedecl;
* @since 0.5.0 - 08. Feb. 2007
* Loads a content document into this ContentDocument.
* @since 0.5.2 - 26. Feb. 2007
$ret = parent :: loadXML($source);
$this->root = $this->documentElement;
$result = $this->xpath->query('/office:document-content');
$this->content = $tmp->item(0);
$result = $this->xpath->query('/office:document-content/office:scripts');
if ($result->length == 1) {
$node = $result->item(0);
$result = $this->xpath->query('/office:document-content/office:font-face-decls');
if ($result->length == 1) {
$node = $result->item(0);
$result = $this->xpath->query('/office:document-content/office:automatic-styles');
if ($result->length == 1) {
$node = $result->item(0);
$result = $this->xpath->query('/office:document-content/office:body');
if ($result->length == 1) {
$node = $result->item(0);
// This should never happend!
* Retrieve automatic-style class
* @return AutomaticStyle The automatic-style class
* @since 0.5.3 - 02. Aug. 2007
return $this->automaticstyles;
|