[nycphp-talk] Problem with xml_parse_into_struct
Chris Snyder
chris at psydeshow.org
Thu Jan 30 11:14:18 EST 2003
Phil Powell wrote:
>I have various XML files that might contain <> tags inside the element body, for example:
>
><news id="1" shortDescription="Stuff Happened Today">Today on <b>1/29/03</b>, stuff happened</news>
>
>
>
I've been wondering about this, too. I've been parsing RSS newsfeeds
(which sounds like the format you might want to try to get your data in
if you have any control over it-- http://web.resource.org/rss/1.0/ ).
The RSS spec declares that html entities must be escaped, which makes it
easy to parse.
But then I decided to try building templates using XML and ran into
exactly this problem-- I'm not an XML expert, but I wonder two things:
1) Can I wrap blocks of HTML with CDATA tags to cause the parser to
ignore the tags?
2) Should there be a parser function created (as part of PHP) that flags
certain tags as containing unparseable data?
I didn't have time to try 1 yet and 2 is a little out of my league. Is
there another way besides brute-force tag rewriting?
chris.
--
HIP HOP CLOWN MONTH
coming soon to a metropolis near you
http://hiphopclown.org/
More information about the talk
mailing list