cvs: pear /XML_CSSML CSSML.php package.xml /XML_CSSML/CSSML error.php /XML_CSSML/Container domxml.php domxml.xsl xslt.php xslt.xsl /XML_CSSML/docs
CSSML.xml example.php

From: Date: Mon, 29 Apr 2002 11:33:09 +0000
Subject: cvs: pear /XML_CSSML CSSML.php package.xml /XML_CSSML/CSSML error.php /XML_CSSML/Container domxml.php domxml.xsl xslt.php xslt.xsl /XML_CSSML/docs
CSSML.xml example.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-3624@lists.php.net to get a copy of this message
dallen Mon Apr 29 07:33:09 2002 EDT Added files: /pear/XML_CSSML CSSML.php package.xml /pear/XML_CSSML/CSSML error.php /pear/XML_CSSML/Container domxml.php domxml.xsl xslt.php xslt.xsl /pear/XML_CSSML/docs CSSML.xml example.php Log: Initial release of the XML_CSSML package, which converts a CSSML xml file into a css file using browser filters and context filters...it supports the domxml_xslt functions as well as the sablotron xslt extension functions

Index: pear/XML_CSSML/CSSML.php +++ pear/XML_CSSML/CSSML.php <?php // {{{ license // +----------------------------------------------------------------------+ // | PHP version 4.0 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2002 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: Dan Allen <dan@mojavelinux.com> | // +----------------------------------------------------------------------+ // $Id: CSSML.php,v 1.1 2002/04/29 11:33:08 dallen Exp $ // }}} // {{{ description // XML_CSSML is a CSSML to CSS xslt parser // }}} // {{{ error codes define('XML_CSSML_OK', 0); define('XML_CSSML_ERROR', -1); define('XML_CSSML_ALREADY_EXISTS', -2); define('XML_CSSML_NOT_LOADED', -3); define('XML_CSSML_INVALID_DATA', -4); define('XML_CSSML_INVALID_DOCUMENT', -5); define('XML_CSSML_INVALID_FILE', -6); // }}} // {{{ includes require_once 'PEAR.php'; require_once 'CSSML/error.php'; // }}} // {{{ functions if (!function_exists('is_a')) { function is_a($in_data, $in_detect) { return (bool) (is_object($in_data) && (get_class($in_data) == strtolower($in_detect) || is_subclass_of($in_data, strtolower($in_detect)))); } } // }}} // {{{ class XML_CSSML /** * The XML_CSSML class provides the xsl functions * to parse a CSSML document into a stylesheet * with the ability to output to a file or return * * @author Dan Allen <dan@mojavelinux.com> * @version Revision: 0.1 * @access public * @package XML_CSSML */ // }}} class XML_CSSML { // {{{ properties /** * domxml object which holds the xml document with the css information * @var object $CSSMLDoc */ var $CSSMLDoc; /** * domxml object which holds the xsl document which parses the cssml document * @var object $stylesheetDoc */ var $stylesheetDoc; /** * Redirection method for the output of the cssml (file, stout) * If redirection is a file, it must be absolute * @var string $outputMethod */ var $output = 'STDOUT'; /** * Code corresponding to the user agent of the browser, * such as is generated with Net_UserAgentDetect * @var string $browser */ var $browser = ''; /** * Filter for the entries in the CSSML * @var string $filter */ var $filter = ''; /** * Comment to be used at the top of the stylesheet output * @var string $comment */ var $comment = ''; /** * Boolean which defines if the CSSML document has been loaded * @var boolean $loaded */ var $loaded = false; // }}} // {{{ constructor /** * Class constructor, prepare the cssml document object from either a string, file or object * * @param mixed $in_cssml Optionally the CSSML data can be passed to the constructor * @return void * @access private */ function XML_CSSML($in_driver, $in_CSSML = null, $in_params = null) { $this = $this->factory($in_driver, $in_CSSML, $in_params); } // }}} // {{{ factory() function &factory($in_driver, $in_CSSML = null, $in_params = null) { $interface_path = 'Container/' . $in_driver . '.php'; $interface_class = 'XML_CSSML_' . $in_driver; @include_once $interface_path; return new $interface_class($in_CSSML, $in_params); } // }}} // {{{ load() /** * Prepare the CSSML document object from either a string, file or object. This * will set the CSSMLDoc class variable which will be parsed by the xsl stylesheet * into a CSS stylesheet * * @param mixed $in_CSSML The CSSML document which contains the information for * generating the CSS document * * @return void * */ function load() { if ($this->loaded) { return PEAR::raiseError(null, XML_CSSML_ALREADY_EXISTS, null, E_USER_WARNING, $this->CSSMLDoc, 'XML_CSSML_Error', true); } } // }}} // {{{ setParams() /** * Set the params (params) that will be used when calling the stylesheet parser. * This pertains particularly to variables such as browser code, image path and * the filter. It works by passing an associative array with any number of the * possible parameters for the stylesheet. If a variable is not set, the default * will be used * * @param array $in_params Associative array of the params * * @return void * */ function setParams($in_params) { if (isset($in_params['browser'])) { $this->browser = $in_params['browser']; } if (isset($in_params['filter'])) { $this->filter = $in_params['filter']; } if (isset($in_params['comment'])) { $this->comment = str_replace(array('/*', '*/'), '', $in_params['comment']); } if (isset($in_params['output'])) { $this->output = $in_params['output']; if ($in_params['output'] != 'STDOUT') { // check to make sure this is a file if (!touch($in_params['output'])) { $this->output = 'STDOUT'; return PEAR::raiseError(null, XML_CSSML_INVALID_FILE, PEAR_ERROR_PRINT, E_USER_NOTICE, '', 'XML_CSSML_Error', true); } } } } // }}} // {{{ process() /** * Run the transformation on the CSSML document using the CSSML xsl stylesheet. If * the output method is to a file, then the function will not return. If the output * is set to STDOUT, the xml string will be returned (really the css document) after * some clean up of entities and domxml bugs have been fixed * * @return css string if output method is STDOUT, else void * @access public */ function process() { if (!$this->loaded) { return PEAR::raiseError(null, XML_CSSML_NOT_LOADED, null, E_USER_WARNING, 'use load() function', 'XML_CSSML_Error', true); } } // }}} // {{{ isError() /** * Tell whether a result code from a XML_CSSML method is an error. * * @param object $in_value object in question * * @access public * @return boolean whether object is an error object */ function isError($in_value) { return is_a($in_value, 'xml_cssml_error'); } // }}} // {{{ errorMessage() /** * Return a textual error message for an XML_CSSML error code. * * @param int $in_value error code * * @access public * @return string error message, or false if not error code */ function errorMessage($in_value) { // make the variable static so that it only has to do the defining on the first call static $errorMessages; // define the varies error messages if (!isset($errorMessages)) { $errorMessages = array( XML_CSSML_OK => 'no error', XML_CSSML_ERROR => 'unknown error', XML_CSSML_ALREADY_EXISTS => 'cssml document already loaded', XML_CSSML_NOT_LOADED => 'cssml document has not been loaded', XML_CSSML_INVALID_DATA => 'invalid cssml data to parse', XML_CSSML_INVALID_DOCUMENT => 'cssml domdocument could not be created', XML_CSSML_INVALID_FILE => 'output file does not exist', ); } // If this is an error object, then grab the corresponding error code if (XML_CSSML::isError($in_value)) { $in_value = $in_value->getCode(); } // return the textual error message corresponding to the code return isset($errorMessages[$in_value]) ? $errorMessages[$in_value] : $errorMessages[XML_CSSML_ERROR]; } // }}} // {{{ reset() /** * Resets the object so it is possible to load another xml document. * * @access public * @return void */ function reset() { $this->CSSMLDoc = null; $this->loaded = false; } // }}} // {{{ _free() /** * Kill the class object to free memory. Not really sure how necessary this is, but xml * documents can be pretty big. This will kill everything, so only use it when you are done * * @access private * @return void */ function _free() { $vars = get_class_vars('XML_CSSML'); foreach($vars as $var => $value) { $this->$var = null; } } // }}} } ?> Index: pear/XML_CSSML/package.xml +++ pear/XML_CSSML/package.xml <?xml version="1.0" encoding="ISO-8859-1" ?> <package> <name>XML_CSSML</name> <summary>The PEAR::XML_CSSML package provides methods for creating cascading style sheets (CSS) from an XML standard called CSSML.</summary> <maintainer> <user>dallen</user> <name>Daniel Allen</name> <email>dallen@php.net</email> </maintainer> <release> <version>1.0</version> <date>2002-04-29</date> <notes> This is the initial independent release of the XML_CSSML package. It includes support for both the domxml_xslt functions and the sablotron xslt extension. The main file includes a factory function, which calls the relevant container object depending on the extension the user wishes to use. It can either create an output css file or it can return the string. It has support for browser specific styles using the codes of Net_UserAgent_Detect as well as a filter to extract only applicable styles. There is an example file in the docs/ to better understand the usage. </notes> </release> <filelist> <dir name="/" baseinstalldir="XML_CSSML"> <file role="php">CSSML.php</file> <dir name="CSSML"> <file role="php">error.php</file> </dir> <dir name="Container"> <file role="php">domxml.php</file> <file role="xsl">domxml.xsl</file> <file role="php">xslt.php</file> <file role="xsl">xslt.xsl</file> </dir> <dir name="docs"> <file role="xml">CSSML.xml</file> <file role="php">example.php</file> </dir> </dir> </filelist> </package> Index: pear/XML_CSSML/CSSML/error.php +++ pear/XML_CSSML/CSSML/error.php <?php // {{{ license // +----------------------------------------------------------------------+ // | PHP version 4.0 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2002 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: Dan Allen <dan@mojavelinux.com> | // +----------------------------------------------------------------------+ // $Id: error.php,v 1.1 2002/04/29 11:33:08 dallen Exp $ // }}} // {{{ description // XML_CSSML is a CSSML to CSS xslt parser // }}} // {{{ class XML_CSSML_Error /** * XML_CSSML_Error Class for Error Handling of CSSML * @access public */ // }}} class XML_CSSML_Error extends PEAR_Error { // {{{ properties /** * Message in front of the error message * @var string $error_message_prefix */ var $error_message_prefix = 'XML_CSSML Error: '; // }}} // {{{ constructor /** * Creates a XML_CSSML error object, extending the PEAR_Error class * * @param int $code the xpath error code * @param int $mode (optional) the reaction either return, die or trigger/callback * @param int $level (optional) intensity of the error (PHP error code) * @param mixed $debuginfo (optional) information that can inform user as to nature of error * * @access private */ function XML_CSSML_Error($code = XML_CSSML_ERROR, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE, $debuginfo = null) { if (is_int($code)) { $this->PEAR_Error(XML_CSSML::errorMessage($code), $code, $mode, $level, $debuginfo); } else { $this->PEAR_Error("Invalid error code: $code", XML_CSSML_ERROR, $mode, $level, $debuginfo); } } // }}} } ?> Index: pear/XML_CSSML/Container/domxml.php +++ pear/XML_CSSML/Container/domxml.php <?php // {{{ license // +----------------------------------------------------------------------+ // | PHP version 4.0 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2002 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: Dan Allen <dan@mojavelinux.com> | // +----------------------------------------------------------------------+ // $Id: domxml.php,v 1.1 2002/04/29 11:33:09 dallen Exp $ // }}} // {{{ description // XML_CSSML is a CSSML to CSS xslt parser // }}} // {{{ class XML_CSSML_domxml /** * The XML_CSSML_domxml is a container class which * provides the libxslt xsl functions to parse a CSSML * document into a stylesheet with the ability to output * to a file or return * * @author Dan Allen <dan@mojavelinux.com> * @version Revision: 0.1 * @access public * @package XML_CSSML */ // }}} class XML_CSSML_domxml extends XML_CSSML { // {{{ constructor function XML_CSSML_domxml($in_CSSML = null, $in_params = null) { $this->loaded = false; if (!is_null($in_CSSML)) { $this->load($in_CSSML); } if (!is_null($in_params)) { $this->setParams($in_params); } $this->stylesheetDoc = domxml_xslt_stylesheet_file(dirname(__FILE__) . '/domxml.xsl'); } // }}} // {{{ process() function process() { if (parent::isError($process = parent::process())) { return $process; } // Prepare the params for passing to the stylesheet $params = array( 'filter' => $this->filter, 'browser' => $this->browser, 'comment' => $this->comment, 'output' => $this->output, ); // Run the transformation and return the result (empty if stream is file) $result = $this->stylesheetDoc->process($this->CSSMLDoc, $params); // If stream is STDOUT then create string and return if ($this->output == 'STDOUT') { $resultData = $result->document_element(); $output = $resultData->get_content(); } parent::_free(); return isset($output) ? $output : true; } // }}} // {{{ load() function load($in_CSSML) { if (parent::isError($load = parent::load())) { return $load; } // If the CSSML data is already a DOM object (can tell by checking for root) if (get_class($in_CSSML) == 'DomDocument') { $this->CSSMLDoc = $in_CSSML; } // If this is a data file, then make it an DOM object with the file function elseif (file_exists($in_CSSML)) { $this->CSSMLDoc = domxml_open_file($in_CSSML); } // If we were given a string, then make it a DOM object with the string function elseif (is_string($in_CSSML)) { $this->CSSMLDoc = domxml_open_mem($in_CSSML); } // We need to die here because we have no data or it cannot be xml else { return PEAR::raiseError(null, XML_CSSML_INVALID_DATA, null, E_USER_WARNING, "Request data: $in_CSSML", 'XML_CSSML_Error', true); } if (!is_object($this->CSSMLDoc) || get_class($this->CSSMLDoc) != 'DomDocument') { return PEAR::raiseError(null, XML_CSSML_INVALID_DOCUMENT, null, E_USER_WARNING, "Request data: $in_CSSML", 'XML_CSSML_Error', true); } $this->loaded = true; } // }}} } ?> Index: pear/XML_CSSML/Container/domxml.xsl +++ pear/XML_CSSML/Container/domxml.xsl <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:saxon="http://icl.com/saxon" xmlns:func="http://exslt.org/functions" xmlns:str="http://exslt.org/strings" xmlns:cssml="http://pear.php.net/cssml/1.0" extension-element-prefixes="func saxon" exclude-result-prefixes="func saxon str cssml"> <xsl:output method="xml" indent="no"/> <!-- default parameters --> <xsl:param name="output">STDOUT</xsl:param> <xsl:param name="filter"></xsl:param> <xsl:param name="browser">ie</xsl:param> <xsl:param name="comment"></xsl:param> <xsl:template match="/"> <xsl:choose> <xsl:when test="$output = 'STDOUT'"> <output> <xsl:if test="$comment"><xsl:value-of select="concat('/* ', $comment, ' */&#010;')"/></xsl:if> <xsl:apply-templates select="cssml:CSSML/style"/> </output> </xsl:when> <xsl:otherwise> <saxon:output file="{$output}" omit-xml-declaration="yes" indent="no"> <xsl:if test="$comment"><xsl:value-of select="concat('/* ', $comment, ' */&#010;')"/></xsl:if> <xsl:apply-templates select="cssml:CSSML/style"/> </saxon:output> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="style"> <xsl:if test="str:isIncluded(@filterInclude, $filter) = 'true' and str:isIncluded(@browserInclude, $browser) = 'true'"> <xsl:for-each select="selector"> <!-- we have to differentiate here since domxml_dumpmem messes up formatting --> <xsl:choose> <xsl:when test="$output = 'STDOUT'"> <xsl:value-of select="."/> </xsl:when> <xsl:otherwise> <xsl:value-of disable-output-escaping="yes" select="."/> </xsl:otherwise> </xsl:choose> <xsl:choose> <xsl:when test="@class"> <xsl:value-of select="concat('.', @class)"/> </xsl:when> <xsl:when test="@id"> <xsl:value-of select="concat('#', @id)"/> </xsl:when> </xsl:choose> <xsl:if test="@pseudoclass"> <xsl:value-of select="concat(':', @pseudoclass)"/> </xsl:if> <xsl:if test="position() != last()"> <xsl:value-of select="', '"/> </xsl:if> </xsl:for-each> <xsl:value-of select="' {&#010;'"/> <xsl:for-each select="declaration"> <xsl:if test="str:isIncluded(@browserInclude, $browser) = 'true'"> <xsl:value-of select="concat(' ', @property, ': ', text(), ';&#010;')"/> </xsl:if> </xsl:for-each> <xsl:value-of select="'}&#010;'"/> </xsl:if> </xsl:template> <func:function name="str:isIncluded"> <xsl:param name="include-list"/> <xsl:param name="subject"/> <func:result> <xsl:choose> <!-- if the subject is empty, then just don't filter --> <xsl:when test="not($subject)"> <xsl:value-of select="true()"/> </xsl:when> <!-- if there is no include list, use default 'all' and return true --> <xsl:when test="not(normalize-space($include-list))"> <xsl:value-of select="true()"/> </xsl:when> <!-- if the include list exists and begins with a not, the subject must not be present --> <xsl:when test="starts-with($include-list,'not(')"> <xsl:choose> <!-- if the subject is in this include list, then return false --> <xsl:when test="contains(concat(' ',substring-after(substring-before($include-list,')'),'not('),' '),concat(' ',$subject,' '))"> <xsl:value-of select="false()"/> </xsl:when> <!-- if the subject was not in the include list, assume included and return true --> <xsl:otherwise> <xsl:value-of select="true()"/> </xsl:otherwise> </xsl:choose> </xsl:when> <!-- if the include list exists and it is a postive list, the subject must be included --> <xsl:otherwise> <xsl:choose> <!-- if the subject is present, return true --> <xsl:when test="contains(concat(' ',$include-list,' '),concat(' ',$subject,' '))"> <xsl:value-of select="true()"/> </xsl:when> <!-- subject is not present, return false --> <xsl:otherwise> <xsl:value-of select="false()"/> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </func:result> </func:function> </xsl:stylesheet> Index: pear/XML_CSSML/Container/xslt.php +++ pear/XML_CSSML/Container/xslt.php <?php // {{{ license // +----------------------------------------------------------------------+ // | PHP version 4.0 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2002 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: Dan Allen <dan@mojavelinux.com> | // +----------------------------------------------------------------------+ // $Id: xslt.php,v 1.1 2002/04/29 11:33:09 dallen Exp $ // }}} // {{{ description // XML_CSSML is a CSSML to CSS xslt parser // }}} // {{{ class XML_CSSML_xslt /** * The XML_CSSML_xslt is a container class which * provides the sablotron xsl functions to parse a CSSML * document into a stylesheet with the ability to output * to a file or return * * @author Dan Allen <dan@mojavelinux.com> * @version Revision: 0.1 * @access public * @package XML_CSSML */ // }}} class XML_CSSML_xslt extends XML_CSSML { // {{{ properties /** * The sabltron extension can use xml strings as arguments for the * processor, but must do so when calling xslt_process. This variable * holds those parameters. * @var array $arguments */ var $arguments = array(); // }}} // {{{ constructor function XML_CSSML_xslt($in_CSSML = null, $in_params = null) { $this->loaded = false; if (!is_null($in_CSSML)) { $this->load($in_CSSML); } if (!is_null($in_params)) { $this->setParams($in_params); } $this->stylesheetDoc = dirname(__FILE__) . '/xslt.xsl'; } // }}} // {{{ process() // I need some error checking in here function process() { if (parent::isError($process = parent::process())) { return $process; } // Prepare the params for passing to the stylesheet $params = array( 'filter' => $this->filter, 'browser' => $this->browser, 'comment' => $this->comment, ); $xh = xslt_create(); $result = xslt_process($xh, $this->CSSMLDoc, $this->stylesheetDoc, null, $this->arguments, $params); if ($this->output != 'STDOUT') { $fp = fopen($this->output, 'w'); fwrite($fp, $result); fclose($fp); $result = true; } parent::_free(); return $result; } // }}} // {{{ load() // I need some more error checking in here function load($in_CSSML) { if (parent::isError($load = parent::load())) { return $load; } if (file_exists($in_CSSML)) { $this->CSSMLDoc = $in_CSSML; } elseif (is_string($in_CSSML)) { $this->CSSMLDoc = 'arg:/_xml'; $this->arguments = array('/_xml' => $in_CSSML); } else { return PEAR::raiseError(null, XML_CSSML_INVALID_DATA, null, E_USER_WARNING, "Request data: $in_CSSML", 'XML_CSSML_Error', true); } $this->loaded = true; } // }}} } ?> Index: pear/XML_CSSML/Container/xslt.xsl +++ pear/XML_CSSML/Container/xslt.xsl <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:saxon="http://icl.com/saxon" xmlns:func="http://www.exslt.org/functions" xmlns:str="http://exslt.org/strings" xmlns:cssml="http://pear.php.net/cssml/1.0" extension-element-prefixes="func saxon" exclude-result-prefixes="func saxon str cssml"> <func:script implements-prefix="str" language="javascript"><![CDATA[ function isIncluded(haystack, needle) { // if the needle is empty, return true if (!needle) { return true; } // if the haystack is a node, get the value if (typeof(haystack) == "object") { haystack = haystack.item(0); if (typeof(haystack) == 'undefined') { return true; } if (haystack.nodeType == haystack.ATTRIBUTE_NODE) { haystack = haystack.value; } else if (haystack.nodeType == haystack.ELEMENT_NODE) { haystack = haystack.nodeValue; } } // if the haystack is empty, return true if (!haystack) { return true; } var needleRegExp = new RegExp("\\b"+needle+"\\b"); if (haystack.match(/^not\((.*?)\)$/)) { if (RegExp.$1.match(needleRegExp)) { return false; } else { return true; } } else if (haystack.match(needleRegExp)) { return true; } else { return false; } } ]]> <xsl:fallback> <xsl:text>Javascript is not configured properly with Sablotron</xsl:text> </xsl:fallback> </func:script> <xsl:output method="text" indent="no" /> <!-- default parameters --> <xsl:param name="filter"></xsl:param> <xsl:param name="browser">ie</xsl:param> <xsl:param name="comment"></xsl:param> <xsl:template match="/"> <xsl:if test="$comment"><xsl:value-of select="concat('/* ', $comment, ' */&#010;')"/></xsl:if> <xsl:apply-templates select="cssml:CSSML/style"/> </xsl:template> <xsl:template match="style"> <xsl:if test="str:isIncluded(@filterInclude, $filter) = 'true' and str:isIncluded(@browserInclude, $browser) = 'true'"> <xsl:for-each select="selector"> <!-- we have to differentiate here since domxml_dumpmem messes up formatting --> <xsl:value-of disable-output-escaping="yes" select="."/> <xsl:choose> <xsl:when test="@class"> <xsl:value-of select="concat('.', @class)"/> </xsl:when> <xsl:when test="@id"> <xsl:value-of select="concat('#', @id)"/> </xsl:when> </xsl:choose> <xsl:if test="@pseudoclass"> <xsl:value-of select="concat(':', @pseudoclass)"/> </xsl:if> <xsl:if test="position() != last()"> <xsl:value-of select="', '"/> </xsl:if> </xsl:for-each> <xsl:value-of select="' {&#010;'"/> <xsl:for-each select="declaration"> <xsl:if test="str:isIncluded(@browserInclude, $browser) = 'true'"> <xsl:value-of select="concat(' ', @property, ': ', text(), ';&#010;')"/> </xsl:if> </xsl:for-each> <xsl:value-of select="'}&#010;'"/> </xsl:if> </xsl:template> </xsl:stylesheet> Index: pear/XML_CSSML/docs/CSSML.xml +++ pear/XML_CSSML/docs/CSSML.xml <?xml version="1.0" encoding="UTF-8"?> <!-- CSSML --> <!-- Example Browser codes are as follows Mozilla/Netscape 6 -> gecko Internet Explorer -> ie Netscape 4 -> ns4 --> <cssml:CSSML xmlns:cssml="http://pear.php.net/cssml/1.0"> <style filterInclude="frontend admin"> <selector>body</selector> <declaration property="color">{f_commonTextColor}</declaration> <declaration property="background-color">{f_backgroundColor}</declaration> <declaration property="font-size">{f_fontSize}</declaration> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="background-image">{f_backgroundImage}</declaration> <declaration property="background-attachment">scroll</declaration> <declaration property="margin">10px 10px 40px 10px</declaration> </style> <style filterInclude="frontend"> <selector class="nav">body</selector> <declaration property="background-color">{f_menuBGColor}</declaration> <declaration property="background-image">none</declaration> </style> <style browserInclude="ns4" filterInclude="frontend admin"> <!-- This style here will cascade into all div elements, carrying the font family and size... BUT, just for ns4...this trick should work for all div elements, so it replaces the need of adding it redundantly --> <selector>div</selector> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="font-size">{f_fontSize}</declaration> </style> <style filterInclude="frontend admin"> <selector>h1</selector> <declaration property="font-size">{f_h1fontSize}</declaration> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="color">{f_commonTextColor}</declaration> </style> <style filterInclude="frontend admin"> <selector>h2</selector> <declaration property="font-size">{f_h2fontSize}</declaration> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="color">{f_commonTextColor}</declaration> </style> <style filterInclude="frontend admin"> <selector>h3</selector> <declaration property="font-size">{f_h3fontSize}</declaration> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="color">{f_commonTextColor}</declaration> </style> <style filterInclude="frontend admin"> <selector>p</selector> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="color">{f_commonTextColor}</declaration> </style> <style filterInclude="frontend admin"> <selector pseudoclass="link">a</selector> <declaration property="color">{f_linkColor}</declaration> <declaration property="text-decoration">{f_linkDecoration}</declaration> <declaration property="cursor" browserInclude="ie">hand</declaration> <declaration property="cursor" browserInclude="not(ie)">pointer</declaration> </style> <style filterInclude="frontend admin"> <selector pseudoclass="visited">a</selector> <declaration property="color">{f_linkVisitedColor}</declaration> <declaration property="text-decoration">{f_linkDecoration}</declaration> </style> <style filterInclude="frontend admin"> <selector pseudoclass="active">a</selector> <declaration property="color">{f_linkActiveColor}</declaration> <declaration property="text-decoration">{f_linkDecoration}</declaration> </style> <style browserInclude="not(ns4)" filterInclude="frontend admin"> <selector pseudoclass="hover">a</selector> <declaration property="color">{f_linkHoverColor}</declaration> <declaration property="text-decoration">{f_linkHoverDecoration}</declaration> </style> <style browserExclude="not(gecko)" filterInclude="frontend admin"> <selector pseudoclass="focus">a</selector> <declaration property="-moz-outline">0</declaration> </style> <style filterInclude="frontend"> <selector class="navlink" pseudoclass="link">a</selector> <declaration property="color">{f_menuLinkColor}</declaration> <declaration property="text-decoration">{f_menuLinkDecoration}</declaration> <declaration property="background-color" browserInclude="not(ns4)">{f_menuLinkBGColor}</declaration> <declaration property="display" browserInclude="not(ns4)">block</declaration> <declaration property="width" browserInclude="ie">100%</declaration> <declaration property="padding-left" browserInclude="not(ns4)">2px</declaration> <declaration property="border-top" browserInclude="not(ns4)">{f_menuLinkBorderType} {f_menuLinkBorderWidth} {f_menuLinkBorderLight}</declaration> <declaration property="border-left" browserInclude="not(ns4)">{f_menuLinkBorderType} {f_menuLinkBorderWidth} {f_menuLinkBorderLight}</declaration> <declaration property="border-right" browserInclude="not(ns4)">{f_menuLinkBorderType} {f_menuLinkBorderWidth} {f_menuLinkBorderDark}</declaration> <declaration property="border-bottom" browserInclude="not(ns4)">{f_menuLinkBorderType} {f_menuLinkBorderWidth} {f_menuLinkBorderDark}</declaration> </style> <style filterInclude="frontend"> <selector class="navlink" pseudoclass="visited">a</selector> <declaration property="color">{f_menuLinkColor}</declaration> <declaration property="text-decoration">{f_menuLinkDecoration}</declaration> <declaration property="display" browserInclude="ie">block</declaration> <declaration property="width" browserInclude="ie">100%</declaration> <declaration property="padding-left" browserInclude="ie">2px</declaration> <declaration property="background-color" browserInclude="ie">{f_menuLinkBGColor}</declaration> <declaration property="border-top" browserInclude="ie">{f_menuLinkBorderType} {f_menuLinkBorderWidth} {f_menuLinkBorderLight}</declaration> <declaration property="border-left" browserInclude="ie">{f_menuLinkBorderType} {f_menuLinkBorderWidth} {f_menuLinkBorderLight}</declaration> <declaration property="border-right" browserInclude="ie">{f_menuLinkBorderType} {f_menuLinkBorderWidth} {f_menuLinkBorderDark}</declaration> <declaration property="border-bottom" browserInclude="ie">{f_menuLinkBorderType} {f_menuLinkBorderWidth} {f_menuLinkBorderDark}</declaration> </style> <style filterInclude="frontend"> <selector class="navlink" pseudoclass="active">a</selector> <declaration property="color">{f_menuLinkColor}</declaration> <declaration property="text-decoration">{f_menuLinkDecoration}</declaration> </style> <style browserInclude="not(ns4)" filterInclude="frontend"> <selector class="navlink" pseudoclass="hover">a</selector> <declaration property="color">{f_menuLinkHoverColor}</declaration> <declaration property="text-decoration">{f_menuLinkHoverDecoration}</declaration> <declaration property="border-top">{f_menuLinkBorderType} {f_menuLinkBorderWidth} {f_menuLinkBorderDark}</declaration> <declaration property="border-right">{f_menuLinkBorderType} {f_menuLinkBorderWidth} {f_menuLinkBorderLight}</declaration> <declaration property="border-bottom">{f_menuLinkBorderType} {f_menuLinkBorderWidth} {f_menuLinkBorderLight}</declaration> <declaration property="border-left">{f_menuLinkBorderType} {f_menuLinkBorderWidth} {f_menuLinkBorderDark}</declaration> </style> <style filterInclude="admin"> <selector pseudoclass="link" class="headerLink1">a</selector> <selector pseudoclass="visited" class="headerLink1">a</selector> <selector pseudoclass="active" class="headerLink1">a</selector> <selector pseudoclass="hover" class="headerLink1">a</selector> <declaration property="color">{f_tableHeaderTextColor1}</declaration> </style> <style filterInclude="admin"> <selector pseudoclass="link" class="headerLink2">a</selector> <selector pseudoclass="visited" class="headerLink2">a</selector> <selector pseudoclass="active" class="headerLink2">a</selector> <selector pseudoclass="hover" class="headerLink2">a</selector> <declaration property="color">{f_tableHeaderTextColor2}</declaration> </style> <style filterInclude="admin"> <selector pseudoclass="link" class="headerLink3">a</selector> <selector pseudoclass="visited" class="headerLink3">a</selector> <selector pseudoclass="active" class="headerLink3">a</selector> <selector pseudoclass="hover" class="headerLink3">a</selector> <declaration property="color">{f_tableHeaderTextColor3}</declaration> </style> <style browserInclude="not(ns4)" filterInclude="admin"> <selector pseudoclass="hover" class="navigationArrow">a</selector> <declaration property="background-color">#E9E9E9</declaration> </style> <style browserInclude="gecko" filterInclude="frontend admin"> <selector>textarea</selector> <selector>input[type="text"]</selector> <selector>input[type="password"]</selector> <selector>input[type="checkbox"]</selector> <selector>input[type="radio"]</selector> <declaration property="background-color">{f_tableHeaderBGColor3}</declaration> <declaration property="color">{f_tableHeaderTextColor3}</declaration> <declaration property="border">1px inset #666666</declaration> <declaration property="padding">1px 1px 0 1px</declaration> </style> <style browserInclude="gecko" filterInclude="frontend admin"> <selector pseudoclass="focus">textarea</selector> <selector pseudoclass="focus">input[type="text"]</selector> <selector pseudoclass="focus">input[type="password"]</selector> <selector pseudoclass="focus">input[type="checkbox"]</selector> <selector pseudoclass="focus">input[type="radio"]</selector> <declaration property="background-color">{f_tableHeaderBGColor1}</declaration> <declaration property="color">{f_tableHeaderTextColor1}</declaration> </style> <style browserInclude="gecko" filterInclude="frontend admin"> <selector>input[type="button"]</selector> <selector>input[type="file"] > input[type="button"]</selector> <selector>input[type="submit"]</selector> <selector>input[type="reset"]</selector> <declaration property="background">{f_tableHeaderBGColor1}</declaration> <declaration property="color">{f_tableHeaderTextColor1}</declaration> <declaration property="border-top">1px solid {f_tableHeaderBGColor3}</declaration> <declaration property="border-left">1px solid {f_tableHeaderBGColor3}</declaration> <declaration property="border-bottom">1px solid #000000</declaration> <declaration property="border-right">1px solid #000000</declaration> <declaration property="font-weight">700</declaration> <declaration property="cursor">pointer</declaration> </style> <style browserInclude="gecko" filterInclude="frontend admin"> <selector pseudoclass="hover">input[type="button"]</selector> <selector pseudoclass="hover">input[type="submit"]</selector> <selector pseudoclass="hover">input[type="reset"]</selector> <declaration property="background">{f_tableHeaderTextColor1}</declaration> <declaration property="color">{f_tableHeaderBGColor1}</declaration> </style> <style browserInclude="gecko" filterInclude="frontend admin"> <selector>select</selector> <declaration property="background-color">{f_tableHeaderBGColor3}</declaration> <declaration property="color">{f_tableHeaderTextColor3}</declaration> <declaration property="border">1px inset #666666</declaration> </style> <style browserInclude="gecko" filterInclude="frontend admin"> <selector pseudoclass="focus">select</selector> <declaration property="background-color">{f_tableHeaderBGColor1}</declaration> <declaration property="color">{f_tableHeaderTextColor1}</declaration> </style> <!-- not sure we need this one --> <style filterInclude="frontend admin"> <selector>td</selector> <declaration property="font-size">{f_fontSize}</declaration> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="color">{f_commonTextColor}</declaration> </style> <style browserInclude="ns4" filterInclude="frontend admin"> <!-- this is for stupid ns4 when it gets confused --> <selector class="standardText">span</selector> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="color">{f_commonTextColor}</declaration> </style> <style filterInclude="admin"> <selector class="pagetitle">div</selector> <declaration property="text-align">center</declaration> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="font-size">{f_h3fontSize}</declaration> <declaration property="font-weight">700</declaration> <declaration property="margin">0px 0px 5px 0px</declaration> <declaration property="padding" browserInclude="not(ns4)">0px 2px 2px 2px</declaration> </style> <style filterInclude="frontend"> <selector class="pagetitle">div</selector> <declaration property="text-align">center</declaration> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="font-size">{f_h1fontSize}</declaration> <declaration property="font-weight">bold</declaration> <declaration property="margin">15px 0px 15px 0px</declaration> <declaration property="font-style">italic</declaration> </style> <style browserInclude="ns4" filterInclude="frontend"> <selector class="pagetitle">div</selector> <declaration property="margin">0px 0px 0px 0px</declaration> </style> <style filterInclude="admin"> <selector class="list-box">div</selector> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="margin-left" browserInclude="not(ns4)">10px</declaration> </style> <style filterInclude="frontend admin"> <selector class="list-header">div</selector> <declaration property="padding">3pt 0pt 3pt 0pt</declaration> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="font-weight">bold</declaration> <declaration property="text-decoration" browserInclude="ns4">none</declaration> </style> <style filterInclude="frontend admin"> <selector class="list-element">div</selector> <declaration property="margin" browserInclude="not(ns4)">7px 0px 0px 10px</declaration> <declaration property="padding" browserInclude="not(ns4)">0px 0px 7px 15px</declaration> <declaration property="padding" browserInclude="ns4">1px 0px 1px 15px</declaration> <declaration property="background-image">{f_bulletImage}</declaration> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="text-decoration" browserInclude="ns4">none</declaration> <declaration property="background-repeat">no-repeat</declaration> <declaration property="background-position">left top</declaration> </style> <style filterInclude="frontend"> <selector class="list-element-numbered">div</selector> <declaration property="margin" browserInclude="not(ns4)">0px 0px 0px 10px</declaration> <declaration property="margin-left" browserInclude="ns4">13px</declaration> <declaration property="padding">7px 0px 7px 15px</declaration> <declaration property="text-decoration" browserInclude="ns4">none</declaration> <declaration property="font-family">{f_fontFamily}</declaration> </style> <style filterInclude="frontend"> <selector class="index-block">div</selector> <declaration property="padding-left">2%</declaration> <declaration property="width" browserInclude="not(ns4)">96%</declaration> <declaration property="font-family">{f_fontFamily}</declaration> </style> <style filterInclude="frontend"> <selector class="index-header">p</selector> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="font-weight">bold</declaration> <declaration property="font-size">12px</declaration> <declaration property="color">{f_menuHeaderColor}</declaration> <declaration property="padding">0</declaration> <declaration property="margin">0</declaration> <declaration property="width">100%</declaration> </style> <style filterInclude="frontend"> <selector class="index-item">p</selector> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="font-size">10px</declaration> <declaration property="padding">3px 0px 3px 0px</declaration> <declaration property="margin">0px</declaration> <declaration property="width">100%</declaration> </style> <style filterInclude="admin"> <selector>hr</selector> <declaration property="width" browserInclude="not(ns4)">100%</declaration> <declaration property="margin" browserInclude="gecko">-5px 0 -4px 0</declaration> <declaration property="margin" browserInclude="not(gecko)">-2px 0 -2px 0</declaration> <declaration property="background-color">{f_hrBarBGColor}</declaration> <declaration property="height" browserInclude="not(ns4)">4px</declaration> <declaration property="border" browserInclude="not(ns4)">1px solid #000000</declaration> </style> <style filterInclude="frontend"> <selector class="index-divider">hr</selector> <declaration property="width" browserInclude="not(ns4)">100%</declaration> <declaration property="margin" browserInclude="gecko">-5px 0 -4px 0</declaration> <declaration property="margin" browserInclude="not(gecko)">-2px 0 -2px 0</declaration> <declaration property="background-color">#000000</declaration> <declaration property="border" browserInclude="not(ns4)">2px solid {f_menuHeaderColor}</declaration> </style> <style filterInclude="frontend"> <selector class="copyright">div</selector> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="color">{f_menuLinkColor}</declaration> <declaration property="text-align">center</declaration> <declaration property="width">100%</declaration> <declaration property="font-size">10px</declaration> <declaration property="font-style">italic</declaration> <declaration property="margin-top">10px</declaration> </style> <style filterInclude="frontend"> <selector class="break">p</selector> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="page-break-after">always</declaration> </style> <style filterInclude="admin"> <selector class="firstletter" pseudoclass="first-letter">p</selector> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="font-size">{f_h2fontSize}</declaration> <declaration property="color">{f_dropLetterColor}</declaration> <declaration property="font-weight">bold</declaration> <declaration property="padding">0px</declaration> <declaration property="margin">0px</declaration> </style> <style filterInclude="frontend admin"> <selector class="contentCell"/> <declaration property="background-color">{f_backgroundColor}</declaration> <declaration property="color">{f_commonTextColor}</declaration> <declaration property="font-family">{f_fontFamily}</declaration> </style> <style filterInclude="frontend admin"> <selector class="header"/> <selector class="headerCell1"/> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="font-weight">bold</declaration> <declaration property="color">{f_tableHeaderTextColor1}</declaration> <declaration property="background-color">{f_tableHeaderBGColor1}</declaration> <declaration property="text-align">center</declaration> </style> <style filterInclude="frontend admin"> <selector class="header2"/> <selector class="headerCell2"/> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="font-weight">bold</declaration> <declaration property="color">{f_tableHeaderTextColor2}</declaration> <declaration property="background-color">{f_tableHeaderBGColor2}</declaration> <declaration property="text-align">center</declaration> </style> <style filterInclude="frontend admin"> <selector class="header3"/> <selector class="headerCell3"/> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="font-weight">bold</declaration> <declaration property="color">{f_tableHeaderTextColor3}</declaration> <declaration property="background-color">{f_tableHeaderBGColor3}</declaration> <declaration property="text-align">center</declaration> </style> <!-- fix header2 and header3 to be left align to support old code --> <style filterInclude="frontend admin"> <selector class="header2"/> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="text-align">left</declaration> </style> <style filterInclude="frontend admin"> <selector class="header3"/> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="text-align">left</declaration> </style> <!-- end fix --> <style filterInclude="frontend admin"> <selector class="tableSettings"/> <declaration property="background-color">{f_tableBGColor}</declaration> <declaration property="font-family">{f_fontFamily}</declaration> </style> <style filterInclude="frontend admin"> <selector class="center"/> <declaration property="text-align">center</declaration> </style> <style filterInclude="frontend admin"> <selector class="left"/> <declaration property="text-align">left</declaration> </style> <style filterInclude="frontend admin"> <selector class="right"/> <declaration property="text-align">right</declaration> </style> <style filterInclude="admin"> <selector class="menu"/> <declaration property="font-size">{f_menuFontSize}</declaration> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="color">{f_commonTextColor}</declaration> <declaration property="background-color">{f_tableHeaderBGColor3}</declaration> </style> <style filterInclude="admin"> <selector class="menutitle"/> <declaration property="font-size">{f_menuFontSize}</declaration> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="background-color">{f_tableHeaderBGColor1}</declaration> <declaration property="text-align">center</declaration> <declaration property="white-space">nowrap</declaration> </style> <style filterInclude="admin"> <selector class="menuheader"/> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="color">{f_tableHeaderTextColor1}</declaration> <declaration property="font-weight">bold</declaration> </style> <style browserInclude="not(ns4)" filterInclude="admin"> <selector class="menuborder">table</selector> <declaration property="border">solid {f_menuBorderWidth} {f_menuBorderColor}</declaration> </style> <style filterInclude="frontend admin"> <!-- This style is for use in a row when no results are returned --> <selector class="none"/> <declaration property="color">{f_commonTextColor}</declaration> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="font-style">oblique</declaration> <declaration property="font-weight">bold</declaration> <declaration property="text-align">center</declaration> </style> <style filterInclude="frontend admin"> <!-- what is this all about? maybe we need span with error color? --> <selector class="error"/> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="color">{f_errorTextColor}</declaration> </style> <style filterInclude="frontend admin"> <!-- This style has been deprecated --> <selector class="error">p</selector> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="margin">5px 0px 5px 0px</declaration> <declaration property="text-align">left</declaration> <declaration property="width">80%</declaration> <declaration property="border">1px solid {f_tableHeaderBGColor2}</declaration> <declaration property="padding">2px</declaration> <declaration property="font-weight">bold</declaration> <declaration property="background-color">{f_tableBGColor}</declaration> </style> <style filterInclude="frontend"> <selector class="blankmessage">p</selector> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="height">20px</declaration> <declaration property="margin">0</declaration> <declaration property="padding">0</declaration> </style> <style filterInclude="admin"> <selector class="blankmessage">p</selector> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="margin" browserInclude="not(ns4)">5px 0px 5px 0px</declaration> <declaration property="padding" browserInclude="not(ns4)">2px</declaration> <declaration property="margin-bottom" browserInclude="ns4">0px</declaration> <declaration property="padding" browserInclude="ns4">0px</declaration> <declaration property="text-align">left</declaration> <declaration property="width">99%</declaration> <declaration property="border">{f_menuBorderWidth} solid {f_backgroundColor}</declaration> <declaration property="border-color" browserInclude="gecko">transparent</declaration> <declaration property="font-weight">700</declaration> </style> <style filterInclude="frontend admin"> <!-- This style is under tight scrutiny until we convert all p.error to p.message/blankmessage --> <selector class="message">p</selector> <selector class="message">table</selector> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="color">{f_errorTextColor}</declaration> <declaration property="margin" browserInclude="not(ns4)">5px 0px 5px 0px</declaration> <declaration property="padding" browserInclude="not(ns4)">2px</declaration> <declaration property="margin-bottom" browserInclude="ns4">0px</declaration> <declaration property="padding" browserInclude="ns4">0px</declaration> <declaration property="text-align">left</declaration> <declaration property="width">99%</declaration> <declaration property="font-weight">700</declaration> <!-- make these last two f_backgroundColor if in live area --> <declaration property="border">{f_menuBorderWidth} solid {f_menuBorderColor}</declaration> <declaration property="background-color">{f_tableBGColor}</declaration> </style> <style browserInclude="not(ns4)" filterInclude="frontend admin"> <selector>form</selector> <declaration property="margin">0px</declaration> <declaration property="padding">0px</declaration> </style> <style filterInclude="admin"> <!-- used in place of <hr/>, still experimental --> <selector class="linebreak">div</selector> <declaration property="border-top">1px solid {f_tableHeaderBGColor1}</declaration> </style> <style filterInclude="admin"> <selector id="help"/> <declaration property="cursor">help</declaration> </style> <style filterInclude="admin"> <selector class="logoutbutton">div</selector> <declaration property="font-family">{f_fontFamily}</declaration> <declaration property="position" browserInclude="ie">absolute</declaration> <declaration property="position" browserInclude="gecko">fixed</declaration> <declaration property="z-index">2</declaration> <declaration property="width" browserInclude="not(ns4)">100%</declaration> <declaration property="margin">0</declaration> <declaration property="padding">0</declaration> <declaration property="right">0</declaration> <declaration property="top">-1px</declaration> <declaration property="text-align">right</declaration> <declaration property="font-weight">bold</declaration> <declaration property="font-style">italic</declaration> </style> </cssml:CSSML> Index: pear/XML_CSSML/docs/example.php +++ pear/XML_CSSML/docs/example.php <?php require_once '../CSSML.php'; error_reporting(E_ALL); $cssml = '<cssml:CSSML xmlns:cssml="http://pear.php.net/cssml/1.0"> <style filterInclude="admin"> <selector>p</selector> <declaration property="color">text</declaration> </style> </cssml:CSSML>'; $cssml = new XML_CSSML('xslt', $cssml, array('filter' => 'admin', 'comment' => 'hello there!', 'output' => 'STDOUT')); //print_r($cssml); echo $cssml->process(); ?>
« previous php.pear.cvs (#3624) next »