Class: XTExpression extends Parser

  • Package: saf.XML
  • Author: John Luxford <lux@simian.ca>
  • Copyright: Copyright (C) 2001-2003, Simian Systems Inc.
  • License: http://www.sitellite.org/index/license Simian Open Software License
  • Version: 1.0, 2003-01-15, $Id: Expression.php,v 1.6 2008/03/09 18:46:06 lux Exp $
  • Access: public

XTExpression (XTE) is the expression syntax to the XT XML-based
template engine.



Properties


$doc

  • Access: public

The XMLDoc object that was last parsed.


$error

  • Access: public

Will contain the error message in the event of a parsing error, or false
otherwise, so that it can be used in an if (error) statement.


$client

  • Access: public

The XML-RPC client object.


$errno

  • Access: public

The error number (faultCode) if an error occurs.


$name


$value

  • Access: public

Value of the attribute.


$version

  • Access: public

XML version. Default is 1.0


$encoding

  • Access: public

The optional encoding type to use when creating the XML parser resource.


$doctype

  • Access: public

May contain the entire DOCTYPE declaration tag, including the
< and >.


$root

  • Access: public

The root node of the XML document.


$filename

  • Access: public

If this object was read in from a file, it may be specified here.


$xquery

  • Access: public

If query() has been called, this will contain the XMLDocQuery object.


$content

  • Access: public

Content of the node.


$children = array ()


$attributes = array ()

  • Access: public

Array of attribute objects.


$comment

  • Access: public

The contents of the current comment tag.


$cdata = false

  • Access: public

Notes whether the contents of this node should be displayed as
a <![CDATA[ ... ]]> block.


$number = 0

  • Access: public

Contains the number of this node within its parent node. Numbers
only increase when more than one child has the same name.


$parent = array ()

  • Access: private

A list of references to the next node in the XMLDoc hierarchy.
Destroyed before returning from parse().


$callbackStart = false

  • Access: public

The function or method to use as a callback for the start tag
of the current XML node.


$callbackEnd = false

  • Access: public

The function or method to use as a callback for the end tag
of the current XML node.


$callbackObject = false

  • Access: public

The object that contains the methods listed in $callbackStart
and $callbackEnd (if they are methods and not ordinary custom or built-in
PHP functions).


$propagateCallback = false

  • Access: public

Whether or not to propagate callback settings to new child
nodes upon their creation. Defaults to false.


$nodes


$condition

  • Access: private

If a condition token is found, this is set to an array containing
the 'operator' and the 'left' node set of the condition.


$rules = array ()


$current


$schema


$tags


$types = array (
        
'path',
        
'string',
        
'php',
    )

  • Access: private

The types of expressions available in XTE. Currently
these are 'path', 'string', and 'php', where a path is a
filesystem-like reference to objects and their properties and
methods, a string is a literal string (with the ability to
embed sub-expressions within them via a ${sub-expr} syntax),
and php expressions are PHP code with a few modifications
for brevity and for avoiding the > character. These
differences are documented elsewhere in this document.


$parser

  • Access: private

The parser created during calls to parse(). Destroyed before returning
from parse().


$rule = 'required'


$err_line

  • Access: public

Will contain the error line in the event of a parsing error.


$err_code

  • Access: public

Will contain the error code in the event of a parsing error.


$err_byte

  • Access: public

Will contain the error byte index in the event of a parsing error.


$err_colnum

  • Access: public

Will contain the error column number in the event of a parsing error.


$attrs = array ()


$type = false


$ns


$parents


$test


$xslt

  • Access: public

This is an XSLT processor resource returned by the
xslt_create () function. Please note: the XSLT processor
is not created until the process method of this class is
called, so as to maintain compatibility with systems that
do not have Sablotron support installed, but are using
EasyText.


$docroot

  • Access: public

If an RSS document is being created, this will
contain a reference to the root node.


$channel

  • Access: public

If an RSS document is being created, this will
contain a reference to the current channel.


$comment_open = false


$handle

  • Access: public

This is the XSLT processor resource returned by the
xslt_create () function.


$register = array (
        
'nothing' => false,
        
'default' => false, // not used

        
'loop' => false,
        
'repeat' => false, // alias of loop

        
'attrs' => false, // depends on the node sent to evaluate()

        
'session' => false,
        
'user' => false, // alias of session

        
'cgi' => false,
        
'request' => false, // alias of cgi

        
'object' => false,
        
'here' => false, // alias of object

        
'result' => false, // from <xt:sql>
        
'block' => false, // from <xt:block>/<xt:show>
    
)

  • Access: private

This is the internal variable register.


$mode = 'normal'


$out = ''


$action = 'none'


$buffer = array ()


$outputMode = 'path'


$defaultMode = 'path'


$previousMode = 'string'

Return to Top



Methods


XTExpression ($object)

  • Access: public

Constructor method. $object is used to set a default
object within the register that takes precedence (as does its
properties and methods, should they share a name with another
register object) over other objects in the register.


setObject (&$obj, $name = 'object')

Sets the specified register entry to the provided object.


register ($name)

Registers the specified name into the register, using a global object of the
same name as the register value.


resetRegister ()

Erases everything from the register.


&getObject ($name = 'object')

  • Return: object

Retrieves the specified object from the register.


setCurrent (&$obj, $name, $index, $total)

Sets the loop register entry to the provided object.


splitAssignment ($string)

  • Return: array

Splits an assignment string by the first space character encountered.


splitStatement ($string)

  • Return: array

Splits a statement into multiple expressions by any semi-colons encountered.


&getPath ($path)

  • Return: mixed

This is the function that interprets path expressions and returns the values
that they refer to.


define ($string, $node, $default_type = 'path')


defineObject ($name, $evalstr)


defineValue ($name, &$value)


repeat ($string, $node, $default_type = 'path')


evaluate ($string, $node, $default_type = 'path', $carry = true)


_innerPath ($token, $name)


_endInnerPath ($token, $name)


_phpOpen ($token, $name)


_stringOpen ($token, $name)


_pathOpen ($token, $name)


_else ($token, $name)


_escape ($token, $name)


_default ($token, $name)

Return to Top

Copyright © 2008 Sitellite CMS Project

Powered by Sitellite 5.0 Content Management System