Re: trouble parsing an XML document

From: Date: Tue, 16 Dec 2003 12:58:22 +0000
Subject: Re: trouble parsing an XML document
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-172797@lists.php.net to get a copy of this message
Alfredo schrieb:
hi, Sven wrote: take a look at http://www.php.net/manual/language.variables.php: "A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores." so, a minus isn't allowed in varnames! hth SVEN I agree with you but let me say the problem: I'm parsing some XML documents, I'm not the writer of them and of DTD, who wrote them used some tags like: <REG-ORIG> This is allowed in XML, but when I initialise varibles I need to use the same name of tags(also respect Case-sensitiveness). This is a big compatibility problem, how can I do? I cannot change all the XML docs and the DTD. bye Alfredo
hi alfredo, maybe you can workaround with arrays? for keys you can use any string. so $xml['REG-ORIG'] is valid in php. hth SVEN

« previous php.general (#172797) next »