logo of XML Sapiens
SapiProcessor

What is SapiProcessor?

SAPIPROCESSOR - is a compact toolkit for processing of documents using XML Sapiens. 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.

How to use SAPIPROCESSOR

To perform parsing on document, it's template (http://www.xmlsapiens.org) and XML file with XML Sapiens scripts should be prepared. Template contains links to user interfaces scripts, common content blocks (SDC), object administrative masks.

Data and template shold be passed to class constructor
$sapi = sapi_core(string $DATA_filelink_or_code, string $Template_filelink_or_code[, array Environment_array]);

Now perform parsing. Get compiled document as a result
$result = $sapi->process();

Switch to administrative mode:
$sapi->access_mode="administration";

Example 1

SAPIPROCESSOR Example 1

Distributive package

sample.php - start file
mvc / model / cmsapplications.php - CMS functions' library
mvc / view / sapiprocessor.php - Class of XML Sapiens processor
mvc / view / sapiexpressions.php - Functions of XML Sapiens expressions
examples / sample.tpl - document template
examples / datasample.xml - data file
examples / sdcsample1.xml - sample of common data block (SDC)
examples / ddcsample1.xml - sample of simple algorithm of an UI-form (DDC)
examples / admin_interfaces.xml - samples administrative interfaces of data (QC)

xslt_sample.php - XML Sapiens/XSL transformation sample

examples / xslt_sample.xml - sample of source XML
examples / xslt_sample.xsl - sample of stylesheet
examples / xslt_ddcsample.xml - sample of simple algorithm of an UI-form XML-enhancement (DDC)
(See http://sapiprocessor.sourceforge.net/about/,
http://xmlsapiens.org/news/2005/03/01/855/)

SAPIPROCESSOR class functions

sapi_core

XML Sapiens processor class constructor

Desciption

object sapi_core(string DATA, string Template[, array Environment])

Parameters:
DATA - XML DATA code or filename of XML-data file
Template - template code or filename
Environment - Array of system variables
process

Run XML Sapiens transformation

Desciption

string process(void)

errors

Amount of XML Sapiens processing errors

Desciption

int errors(void)

errors_eol

Trigger of end of errors list

Desciption

bool errors_eol(void)

error

Content of XML Sapiens processing error

Desciption

string error(void)

error_file

Filename of XML Sapiens processing error

Desciption

string error_file(void)

error_string

Number of string with error

Desciption

int error_string(void)

next_error

Move error's pointer forward

Desciption

bool next_error(void)

previous_error

Move error's pointer back

Desciption

bool previous_error(void)

© 2004-2007 RG Lab. All Rights Reserved. RG Lab liability, trademark, document use and software licensing rules apply. Your interactions with this site are in accordance with our public and Member privacy statements.