Class: SLiPWriter
- 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, 2002-10-17, $Id: Writer.php,v 1.3 2007/10/06 00:06:30 lux Exp $
- Access: public
SLiPWriter is an XML to SLiP converter based on the XMLDoc and XMLNode
callback functionality.
Usage Example
<?php
$loader->import ('saf.Sloppy');
// load the converter
$loader->import ('saf.XML.SLiP.Writer');
$sloppy = new SloppyDOM ();
// create an instance of our converter
$slip = new SLiPWriter ();
$doc = $sloppy->parse ('<users>
<user type="admin">
<name>Lux</name>
<email>lux@simian.ca</email>
</user>
<user type="suit">
<name>Josh</name>
<email>josh@simian.ca</email>
</user>
</users>');
// bind the converter to the document object
$doc->propagateCallback ('_start', false, $slip);
// output SLiP document (note the ->root-> in there,
// that's so we don't get a little bit of <?xml version="1.0"...
// at the top of our SLiP document)
echo $doc->root->write ();
?>
Return to Top
Properties
$doc
If an RSS document is being created, this will
contain the XMLDoc object.
$error
$client
The XML-RPC client object.
$errno
The error number (faultCode) if an error occurs.
$name
$value
Value of the attribute.
$version
XML version. Default is 1.0
$encoding
$doctype
May contain the entire DOCTYPE declaration tag, including the
< and >.
$root
The root node of the XML document.
$filename
If this object was read in from a file, it may be specified here.
$xquery
If query() has been called, this will contain the XMLDocQuery object.
$content
Content of the node.
$children = array ()
$attributes = array ()
Array of attribute objects.
$comment
Attach a comment to the node, which will appear as an XML comment
tag above the element.
$cdata = false
Notes whether the contents of this node should be displayed as
a <![CDATA[ ... ]]> block.
$number = 0
Contains the number of this node within its parent node. Numbers
only increase when more than one child has the same name.
$parent
$callbackStart = false
The function or method to use as a callback for the start tag
of the current XML node.
$callbackEnd = false
The function or method to use as a callback for the end tag
of the current XML node.
$callbackObject = false
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
Whether or not to propagate callback settings to new child
nodes upon their creation. Defaults to false.
$nodes
$condition
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 ('text', 'empty', 'data')
$parser
$rule = 'required'
$err_line
$err_code
$err_byte
$err_colnum
$attrs = array ()
$type = false
$ns
$parents
$test
$xslt
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
If an RSS document is being created, this will
contain a reference to the root node.
$channel
If an RSS document is being created, this will
contain a reference to the current channel.
Return to Top
Methods
_start ($node, $level = 0)
- Access: public
- Return: string
Callback method. A callback method always takes an
XMLNode object as its first parameter, and the level (depth)
into the XML tree we've gotten to as its second.
Return to Top