|
|
|
|
|
|
| |
| <?PHP
/*
What is SapiProcessor?
---------------------------------
SAPIPROCESSOR - is a compact toolkit for processing of documents using XML Sapiens (http://www.xmlsapiens.org). SAPIPROCESSOR takes XML files with data, XML Sapiens scenarios, environment variables as input parameters. SAPIPROCESSOR returnes parsed page or an XML tree for further format processing. So, SAPIPROCESSOR compiles document from separated data, presentation template and XML Sapiens scenarios. In fact, SAPIPROCESSOR is a CMS core.
SAPIPROCESSOR is an open project; other users and developers are encouraged to use it or to help us testing or improving it.
Library: http://sapiprocessor.sourceforge.net/
*/
/**
* An example of how to use XML Sapiens Processor
*
* PHP versions 4
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Processor
* @package SAPIPROCESSOR
* @author Max Baryshnikov <mb@redgraphic.com>
* @author Dmitry Sheiko <sheiko@cmsdevelopment.com>
* @copyright 2004-2005 XML Sapiens Team
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id:$
* @link http://sapiprocessor.sourceforge.net/
* @see nothing
* @since File available since Release 1.0.0
* @deprecated File deprecated in Release 1.0.0
*/
/**
* We are loading XML Sapiens expression functions
*/
include("mvc/view/sapiexpressions.php");
/**
* We are loading XML Sapiens class
*/
include("mvc/view/sapiprocessor.php");
/**
* We are loading our CMS functions
*/
include("mvc/model/cmsapplications.php");
/**
* We are creating environment
*/
$env = array( "name4" => "The value of Name4 variable from environment", "name5" => "It is title attribute of tag A from environment", );
/**
* We are reference DATA and TEMPLATE sources
* Notice: sample.tpl includes a few SAPI-files
*/
$template = 'examples/sample.tpl';
$xmldata = "examples/datasample.xml";
/**
* We are doing XML Sapiens Processor initilazation
* Syntax:
* obj sapi_core(string $DATA_filelink_or_code, string $Template_filelink_or_code[, array Environment_array]);
*/
$sapi = new sapi_core($xmldata, $template, $env);
//$sapi->access_mode="administration";
/**
* We can switch on administrative mode of site
* $sapi->access_mode="administration";
*/
/**
* We are processing XML Sapiens Transformation
*/
$result = $sapi->process();
print $result;
/**
* We are monitoring transformation errors
*/
if($sapi->errors()) {
print "<br /><br />Processing errors:<br /><br />";
while(!$sapi->errors_eol()) {
print ("\tError : " . $sapi->error() . "<br />\n");
print ("\tIn file: " . $sapi->error_file() . "<br />\n");
print ("\tIn string: " . $sapi->error_string() . "<br /><br />\n");
$sapi->next_error();
}
}
?> | | |
|
| Glossword - glossary compiler Categories : Content Management, PHP, MySQL, XML | | | background music script for random notes in a frame Categories : PHP, Content Management, HTML and PHP | | | RSS parser.
Parses RSS into an array. Quick and nasty but does the job.
No checking is done for correct Tags, only correct XML.
PHP4 needed to display result (uses print_r). Categories : PHP, XML, PHP Classes, Rich Site Summary (RSS) | | | File Explorer, browse, upload, download and edit your web site files with only a browser and a HTTP connection. Categories : Complete Programs, Content Management, Filesystem, PHP | | | XML To Array Categories : PHP, PHP Classes, XML, Arrays | | | XMLManipulation Categories : PHP, XML, SimpleXML | | | ezContents is an easy website content management system. You can maintain menus and submenus, add authors and maintain the entire contents of a website. Categories : Content Management, PHP | | | A very basic and fast XML parser Categories : PHP, PHP Classes, XML | | | phpCMS a content-management-system written in php. Categories : Content Management, Apache, Complete Programs, Web Servers, PHP | | | Printer friendly pages from anywhere on a website. Categories : PHP, Strings, Content Management | | | This program implements hot link prevention in php. It is useful for webmasters who do not have access to the server at a level where they can control hot linking can still supply some type of hot link prevention for thier site by using php. Categories : PHP, Filesystem, Graphics, Content Management | | | Simple newsreader script Categories : PHP, XML, Rich Site Summary (RSS) | | | RSS parser using PHP5 and simpleXML Categories : Rich Site Summary (RSS), PHP, XML | | | Amazon.com API, CURL-REST Parser. Obtain data about Amazon products (PHP5 +) Categories : PHP, Ecommerce, XML, Web Services, CURL | | | XML easy parser Categories : PHP, XML | |
|
|
|