[plug] RE: XML

Mark Nold markn at enspace.com
Wed Jul 11 12:46:23 WST 2001



knew i shouldn't of woken up this morning....

<disclaimer missing from previous email>
 I dont use XML to store data in any way shape or form, just to output to be 
read by other apps. I was just trying to offer some advice on a generic PHP + 
XML question.
</disclaimer missing from previous email>

but you do know what they say "Free advice is only worth as much as you pay for 
it".




Anyway, just to dig a deeper hole and probably upset Colin more ;) why can't 
your all powerful function getData() read you XML data files?

The main point of my previous rant was to suggest that you have some 
intermediate and generic way of handling your data in PHP between getting the 
data (from a DB or an XML file) then outputting the data (html, pdf, xls, wap 
or xml). The reason for this is there is no XML variable type in PHP, and it 
certainly makes swapping to XML or from XML data sources and output a lot 
easier... (as Simon is talking about access data from a DB, plus maybe from XML 
since he is writing data from forms)

$dataset = getData($request,"xml");
$dataset = getData($request,"oracle"); // Sometime

$dataset = doSomethingtoDataSet($dataset); // you manipulations...

$xml = createOutput($dataset,"xml");
$html = createOutput($dataset,"html");
$pdf = createOutput($dataset,"pdf");

echo ????





But of course this doesn't quite answer Simon's question on parsing XML, have a 
look at www.phpbuilder.com for some XML + PHP articles, (also see one i 
co-wrote on using the Java Xalan XSLT engine from the Apache XML project with 
PHP and i didnt write the XML bits...) and maybe www.zend.com














Mark Nold
markn at enspace.com
Senior Consultant

Change is inevitable, except from vending machines.




On Wednesday, 11 July 2001 12:09, Colin Muller [SMTP:colin at twobluedots.com.au] 
wrote:
> On Wed, Jul 11, 2001 at 11:57:48AM +0800, Simon Scott wrote:
> > 	Second note to self - for fun one day, make an incorrect sweeping
> > statement about something Colin knows about, and stand back :)
>
> Just try ;-). You all know the feeling - you know and use Linux, but
> the world is constantly barraged by info telling it other ways of
> doing things are better - which is sometimes true, but it's said even
> in those cases where it's not. For Linux above, substitute XML, which
> I use a lot.
>
> And Greg, before you twitch the trigger-finger - I'm not comparing
> Mark to a FUD campaign, okay? Sometimes the barrage comes through
> misunderstandings rather than intent.
>
> Colin
>
>




More information about the plug mailing list