Re: [PHP4BETA] Php/Xml

From: Date: Wed, 01 Mar 2000 18:13:42 +0000
Subject: Re: [PHP4BETA] Php/Xml
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-11262@lists.php.net to get a copy of this message
At 12:36 PM -0500 03-01-2000, Vincent Stoessel wrote:
I have a question about using the new xml features.I've been doing some reading about xml (the material can get complicated). What I want to know is this: using php/xml or any other method can I create custom tags like <headline>Dynamically generated headline</headline> that would be the equivelent of echo "<center><h1>" .$mysqlrow["Headline"] ."</h1></center>"; The advantage of the first method is that code is a little easier to read and manipulate in their documents. Am I totally off base here? Please excuse the cross post.
Do you mean "given an XML document, can I apply it as a formatting specification for each row I yank out of a database?", the answer is yes. One way would be to take the XML and convert it to DOM format (This would be PHP4 only) to get a DOM tree. Then for each row of your query, traverse the tree and associate your HTML formatting and/or row values with specific XML elements. -- Paul DuBois, paul@snake.net

« previous php.version4 (#11262) next »