cdata example

$this->bogusComment('<![CDATA[' . $cdata);

                return true;
            }
            $cdata .= $tok;
            $tok = $this->scanner->next();
        } while (!$this->scanner->sequenceMatches(']]>'));

        // Consume ]]>         $this->scanner->consume(3);

        $this->events->cdata($cdata);

        return true;
    }

    // ================================================================     // Non-HTML5     // ================================================================
    /** * Handle a processing instruction. * * XML processing instructions are supposed to be ignored in HTML5, * treated as "bogus comments". However, since we're not a user * agent, we allow them. We consume until ?> and then issue a * EventListener::processingInstruction() event. * * @return bool */
$attributes[$attrName] = $xml->value;
                    }
                    $this->tag_open(null, $tagName$attributes);
                    if ($empty)
                    {
                        $this->tag_close(null, $tagName);
                    }
                    break;
                case constant('XMLReader::TEXT'):

                case constant('XMLReader::CDATA'):
                    $this->cdata(null, $xml->value);
                    break;
            }
        }
        if ($error = libxml_get_last_error())
        {
            $this->error_code = $error->code;
            $this->error_string = $error->message;
            $this->current_line = $error->line;
            $this->current_column = $error->column;
            return false;
        }

        
public function node($node)
    {
        // A listing of types is at http://php.net/manual/en/dom.constants.php         switch ($node->nodeType) {
            case XML_ELEMENT_NODE:
                $this->rules->element($node);
                break;
            case XML_TEXT_NODE:
                $this->rules->text($node);
                break;
            case XML_CDATA_SECTION_NODE:
                $this->rules->cdata($node);
                break;
            case XML_PI_NODE:
                $this->rules->processorInstruction($node);
                break;
            case XML_COMMENT_NODE:
                $this->rules->comment($node);
                break;
            // Currently we don't support embedding DTDs.             default:
                //print '<!-- Skipped -->';                 break;
        }
Home | Imprint | This part of the site doesn't use cookies.