PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of MC Breit   XML Form Up   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example of use..
Class: XML Form Up
Parse and reformat XML documents
Author: By
Last change:
Date: 18 years ago
Size: 1,531 bytes
 

Contents

Class file image Download
<?php
include('xml_form_up.php');
//For a better view on internet browsers..
header('Content-Type: text/plain');
//Make a new instance..
$xml_fu = new xml_form_up();
$xml_fu->set_option(XML_OPTION_CASE_FOLDING, FALSE);
$xml_fu->set_option(XML_OPTION_SKIP_WHITE, TRUE);
//Get the code parsed..
$data = <<<XML
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html><head><title>XML_Forum_Up Test</title><style type="text/css">body {padding:10px;font-family:sans-serif;}</style></head><body><h1>XML_Form_Up Test</h1><p>This is a test on the xml_form_up class.</p><!-- This is a comment line.. --><h2>Any stuff here, like the lorem ipsum..</h2><p>Praesent ac urna ut lectus iaculis condimentum. Morbi mauris est, luctus quis, viverra sit amet, malesuada at, nulla. Proin dictum pulvinar purus. Donec aliquet, odio eget rutrum vulputate, risus ipsum dictum neque, ac commodo arcu tellus et lectus. Suspendisse eget eros. Pellentesque tincidunt rutrum neque. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Praesent lacus nunc, bibendum non, lacinia a, pharetra at, sem. In hac habitasse platea dictumst. Integer sollicitudin, erat vel iaculis ultricies, ipsum sapien auctor orci, eget accumsan libero orci in leo.</p><?php echo "Hello World!";?></body></html>
XML;
$xml_fu->parse($data, TRUE);
//Fetch the result and free the parser..
print($xml_fu->result);
$xml_fu->free();
?>