PHP Classes
elePHPant
Icontem

File: sptpl_GlobalFunc.php

Recommend this page to a friend!
  Classes of Andrioli Darvin  >  SpoolTemplate  >  sptpl_GlobalFunc.php  >  Download  
File: sptpl_GlobalFunc.php
Role: Auxiliary script
Content type: text/plain
Description: Global functions
Class: SpoolTemplate
Database report generation based on templates
Author: By
Last change: Minor fixes
Date: 8 years ago
Size: 3,112 bytes
 

Contents

Class file image Download
<?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/rilascio_2_1_1/sptpl_GlobalFunc.php,v 1.1 2008/03/10 15:03:10 darvin Exp $
 */
/*
 * +-------------------------------------------------------------------------+
 * | Sptpl |
 * +-------------------------------------------------------------------------+
 * | Copyright (c) 2003-2008 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>--&gt;'.nl2br($child->node_value()).'&lt;--';
    // echo '<br>++&gt;'.nl2br(preg_replace("/^[ ]*\n/","=",$pippo)).'&lt;++';
   
$preg_out=preg_replace("/^[ ]*\n/","",$child->node_value());
   
$Text.=rtrim($preg_out);
    }
 
$child = $child->next_sibling();
  }
// echo '<br>++&gt;'.nl2br($Text).'&lt;++';
return($Text);
}

?>