Re: PHP & XML Parsing

From: Date: Fri, 18 May 2001 20:14:19 +0000
Subject: Re: PHP & XML Parsing
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-53482@lists.php.net to get a copy of this message
The problem is in your link URL, where you pass CGI parameters. When XML sees the & character, it assumes it's a special character thing such as &amp; or &quot;, so it's expecting a semicolon. <link>http://cupe.ca/news/cupenews/showitem.asp?ID=2823&cl=1</link> Just yesterday I discovered a program called XML Spy which you can get on a 30-day eval from www.tucows.com. This was what pointed out the error to me in your file. When I was using XSL last year for the first time, I had a devil of a time figuring out how to get URLs, particularly with query strings attached, through the XML parsers. Try using the %codes in your URLs instead of & and other special characters; that should help, if I remember correctly. (Similarly, building HREF tags using XSL stylesheets seemed pretty awkward, but I'm sure I was missing some crucial tidbit of information.) Pete. "Mike Gifford" <mike@openconcept.on.ca> wrote in message news:3B057708.3090903@openconcept.on.ca... > Hello, > > In looking for a good script to parse XML files I stumbled across the following > tutorial (which looks very good): > > http://www.wirelessdevnet.com/channels/wap/features/xmlcast_php.html > > I have set this script up here: > http://www.airdiv-cupe.org/portal/newsfeed_new_parser.php > > and I keep getting the following error (even after making a number of changes): > XML error: not well-formed at line 16 > > And I'm not sure how to troubleshoot this problem. > > I'm assuming that it is referring to line 16 on the XML file, in this case: > http://cupe.ca/xml/cupenews.rdf > > My parsing definitions are as follows > $itemTitleKey = "^rdf^item^title"; > $itemLinkKey = "^rdf^item^link"; > $itemDescKey = "^rdf^item^description"; > > Any help would be appreciated. > > Mike

« previous php.general (#53482) next »