| 
	
 | 
 Posted by ReGenesis0 on 09/07/06 13:55 
Tony Marston wrote: 
 
> The tools for manipulating XML are supposed to be better in PHP 5 than PHP 
> 4, but the whole pointof XML is *not* to be manipulated, simply written by 
> one process and read by another process. It is used to exchange data between 
> different processes, not to provide a storage mechanism as a replacement to 
> an SQL database. 
 
See, I'd be a crumudgen and say- "The point of XML is to store your 
date IN and XML string in a field in a sql database.  Certain key 
values like a date and ID will remain as seperate db-fields, but for 
the MSOT part, it's a lump of xml code." 
The advantage here, if you want to change the type of date you're 
storing, or if the type just varies a lot, (say if you have 16 
different types of content_types all with different sub-fields you want 
to sore in the same database) You dont' have to go back and re-work 
your databse queries.  It's a standard query.  "Go and get the xml code 
nugget, chuck it bodily at a xsl sheet.  The XSL stylesheet will treat 
it appropriately based on the content_type attribute in the base tag." 
 
Searchability/queryabnility goes all the hell udner this system, but 
flexability and expandability goes way, way up.  It's inappropriate for 
some applications, but very appropriae for many others. 
But, this presupposes the ability to manipulate complicated nested xml 
files, (largely from a form handling standpoint.) 
 
(Storing XML in a text field sounds back-assward, but I've seen this 
basis system in action on a proprietary internal system, it works very, 
very well, and I WANT that level of flexability.) 
 
Some meditation on the issues involved has me thinkign that basically 
what I need is a simpler way of manipulating things in memory. 
 
I'd been avoiding simpleXML in favor od DOM-based solutions on the 
premsie that DOM is the better/'correct' way of doign things, but the 
more I look, it seems like the itneroperability of dom/simpleXML simly 
BEGS for me to manipulate thing in simplexml, and then just conver them 
back for xsl interpretation. 
(I'd been thinking of simple XML as a seperate 'dumbed-down' 
implemantation, but it starting to look more sideways of DOM, liek 
theyr'e seperate tools meant to be used together for their strengths.) 
 
IS SimpleXML what I'm looking for?  (Basically, I'm giving you an 
opportunity to say something bad about it.) 
 
-Derik
 
  
Navigation:
[Reply to this message] 
 |