[CLUE-Tech] PHP and XML Woes

Jed S. Baer thag at frii.com
Fri Jan 30 21:48:53 MST 2004


On Fri, 30 Jan 2004 08:07:05 -0500
Greg Knaddison <greg at knaddison.com> wrote:

> How about putting the marked up text into it's own file and putting a
> reference to that file as an include in your xml:
> 
> <para>path_to_includes/meeting1.inc</para>
> 
> Then the PHP could take the bit of "normal" text in the XML tag and use
> it in a<?php require($include_file); ?>.
> 
> Maybe you lose whatever benefit there is of having all the information
> in XML

Yes, that's exactly the point. If it turns into an exercise in
implementing the equivalent of a database implemented in the filesystem,
there's no advantage to XML. I'm just as well off at that point putting
the data in MySQL.

The only other workaround I can think of is to use the htmlentities()
function to encode those fragments. But since XML supports CDATA sections,
I'd just as soon use them. Also, using htmlentities() destroys the
human-readable nature of the file. Again, part of the advantage of using
XML is that the data is easily human readable (and fixable in a text
editor, worst-case if things get messed up).

Regrettably, this doesn't seem to be documented in any way that I can
find. <sigh>

jed
-- 
http://s88369986.onlinehome.us/freedomsight/

... it is poor civic hygiene to install technologies that could someday
facilitate a police state. -- Bruce Schneier



More information about the clue-tech mailing list