File: xml-test-data.php

Recommend this page to a friend!
  Classes of D Moore  >  XML to Sensible Array  >  xml-test-data.php  >  Download  
File: xml-test-data.php
Role: Application script
Content type: text/plain
Description: Test data
Class: XML to Sensible Array
Parse XML documents into associative arrays
Author: By
Last change:
Date: 12 years ago
Size: 3,978 bytes
 

 

Contents

Class file image Download
<?php
global $xmlbasic, $xml1, $xmltiny, $xmlphoto;

$xmlbasic = <<<EOD
<?xml version="1.0" encoding="UTF-8"?>
<outer>
    <inone>
        <desc>I am some description</desc>
    </inone>
    <intwo>
        <desc>I am another description</desc>
    </intwo>
</outer>

EOD;

$xmltiny = <<<EOD
<?xml version="1.0" encoding="UTF-8"?>
<outer foo="">
    <desc id="dfdf">I am some description</desc>
    <hoo midi="Chlorians">
        Seriously!!!
        <font>big!</font>
        What is this text doing here, floating about?
        Really - I've never seen the like of it?
    </hoo>
    <lingus hong="fi" />
</outer>
EOD;

$xml1 =<<<EOD
<?xml version="1.0" encoding="UTF-8"?>
<channel id="bbc1" source="BBC" date="12/04/2008">
  <programme>
<desc>Start your day with all the latest news, sport, business and weather from the BBC's Breakfast team.</desc>
<title>Breakfast</title>
<end>1000</end>
<infourl>http://www.bbc.co.uk/cgi-perl/whatson/prog_parse.cgi?FILENAME=20080412/20080412_0600_4223_13918_240</infourl>
<start monkey="proboscis">0600</start>
  </programme>

<sock>
    <desc>Stinky sock!</desc>
    <age>6 years old</age>
</sock>

<sock>
    <desc>Lady sock</desc>
    <age>2 months old</age>
</sock>

<simplesingle>
    <insingle>This is just something in single</insingle>
    <moreinsingle>fim</moreinsingle>
    <moreinsingle>goo</moreinsingle>
</simplesingle>

  <programme id="testID" type="ForTheBlind">
<desc>James Martin hosts the mouth-watering food show, and cooks with top chefs Jason Atherton and Lawrence Keogh. Also featuring helpings of Rick Stein and Keith Floyd, plus another omelette challenge.</desc>
<title>Saturday Kitchen</title>
<end>1130</end>
<infourl>http://www.bbc.co.uk/cgi-perl/whatson/prog_parse.cgi?FILENAME=20080412/20080412_1000_4223_13960_90</infourl>
<start>1000</start>
  </programme>

  <programme>
<desc>Jean Christophe Novelli heads to Enfield to meet two young professionals who are too exhausted after a long day at the office to bother with the kitchen. Can Jean Christophe change their minds?</desc>
<title>Take on the Takeaway</title>
<end>1200</end>
<infourl>http://www.bbc.co.uk/cgi-perl/whatson/prog_parse.cgi?FILENAME=20080412/20080412_1130_4223_13959_30</infourl>
<start>1130</start>
  </programme>

</channel>
EOD;

$xmlphoto = <<<EOD
<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
<photosets>
    <photoset id="72157594149979680" primary="156553525" secret="75296a02b3" server="48" farm="1" photos="4">
        <title>Macho Burgers!</title>
        <description>Goodly burgers from a gentler day</description>
    </photoset>
    <photoset id="72057594140072100" primary="149781761" secret="30dd5f6bd0" server="44" farm="1" photos="6">
        <title>Wayland UltraLounge</title>
        <description />
    </photoset>
    <photoset id="72057594139405463" primary="149352011" secret="1cb6765ffe" server="51" farm="1" photos="12">
        <title>Tapas,Boxers,Dance</title>
        <description />
    </photoset>
    <photoset id="72057594130405244" primary="143637719" secret="8ceaefffb0" server="47" farm="1" photos="5">
        <title>MoustacheMay06</title>

        <description>The month of moustaches</description>
    </photoset>
    <photoset id="1616821" primary="75357000" secret="82eb6709c3" server="42" farm="1" photos="15">
        <title>ChristmasParty</title>
        <description>Buddytown Office Christmas Party at the City Council Headquarters</description>
    </photoset>
    <photoset id="874113" primary="39744154" secret="f6fab5caf8" server="27" farm="1" photos="12">

        <title>OfficeLomos</title>
        <description>Some experimental phots taken by my camera at random via automatic interval signals sent from my laptop.Then experimented with creating some fake lomo texture</description>
    </photoset>
    <photoset id="864204" primary="39252049" secret="6fdf6490f8" server="22" farm="1" photos="20">
        <title>BuddytownSkate</title>
        <description>the buddytown/ cody's birthday party blowout</description>
    </photoset>

</photosets>
</rsp>
EOD;

?>


For more information send a message to info at phpclasses dot org.