- <?php
- /*
- * sptpl_GlobalFunc.php
- *
- * This module contains some global functions used by many classes.
- * @copyright sptpl_GlobalFunc.php is part of Sptpl project {@link http://www.andrioli.com/en/sptpl.html} and it is LGPL
- * @author Andrioli Darvin <darvin (inside) andrioli (dot) com>
- * @version $Header: d:\cvs/classistd/sptpl/sptpl_GlobalFunc.php,v 2.2 2005/03/02 21:00:54 Darvin Exp $
- */
- /*
- * +-------------------------------------------------------------------------+
- * | Sptpl |
- * +-------------------------------------------------------------------------+
- * | Copyright (c) 2003-2005 Andrioli Darvin |
- * | Email <darvin (inside) andrioli (dot) com> |
- * | Web http://www.andrioli.com/en/sptpl.html |
- * | Download http://www.phpclasses.org/browse.html/package/1326.html |
- * | |
- * +-------------------------------------------------------------------------+
- * | This library is free software; you can redistribute it and/or modify |
- * | it under the terms of the GNU Lesser General Public License as |
- * | published by the Free Software Foundation; either version 2 of the |
- * | License, or (at your option) any later version. |
- * | |
- * | This library is distributed in the hope that it will be useful, but |
- * | WITHOUT ANY WARRANTY; without even the implied warranty of |
- * | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
- * | Lesser General Public License for more details. |
- * | |
- * | You should have received a copy of the GNU Lesser General Public |
- * | License along with this library; if not, write to the Free Software |
- * | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- * +-------------------------------------------------------------------------+
- */
-
-
-
- /**
- * Return the text for the specified node.
- *
- * @param object node data field name
- * @access global
- */
- function GetDomValue1($Node)
- {
- if(!is_object($Node))
- trigger_error('Internal error: GetDomValue, first parameter must be an object',E_USER_ERROR);
- $Text="";
- $child = $Node->first_child();
- while($child) {
- // echo '<br>child:';
- // print_r($child);
- if($child->node_type()==XML_TEXT_NODE
- || $child->node_type()==XML_CDATA_SECTION_NODE ) {
- // echo '<br>-->'.nl2br($child->node_value()).'<--';
- // echo '<br>++>'.nl2br(preg_replace("/^[ ]*\n/","=",$pippo)).'<++';
- $preg_out=preg_replace("/^[ ]*\n/","",$child->node_value());
- $Text.=rtrim($preg_out);
- }
- $child = $child->next_sibling();
- }
- // echo '<br>++>'.nl2br($Text).'<++';
- return($Text);
- }
-
- ?>