* @license PHP License * @package wb * @subpackage Markup */ WBClass::load('WBMarkup_Handler_Xml2Xinha'); /** * Markup Scanner Handler: Xml2Xinha * * Convert Wombat XML data to Xinha-HTML with Wombat attributes * * @version 0.2.0 * @package wb * @subpackage Markup */ class WBMarkup_Handler_Xinha2Xml extends WBMarkup_Handler_Xml2Xinha { /** * handler on start element * * @param string $ns The used namespace, if set. otherwise null * @param string $tag the tag itself * @param array $attributes the attributes of the found element * @param bool $isEmpty true if it is a start- and closing-Element (e.g.
) * @return bool usually true, false to stop the scanner */ public function onStartElement($ns, $tag, $attributes, $isEmpty) { if (empty($ns) && isset($attributes['wb:dialog'])) { $ns = 'wb'; $tag = $attributes['wb:dialog']; } return parent::onStartElement($ns, $tag, $attributes, $isEmpty); } /** * convert node * * transform namespaced tags to HTML * * @todo convert empty namespace (standard HTML) to known WB namespace, if possible * @param string $ns * @param string $tag * @param array $node */ protected function convert($ns, $tag, &$node) { $con = $this->getConverter($ns, $tag); if (!$con) { return ''; } return $con->toXml($node); } } ?>