Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: Using PHP to parse specific XML tag content? >Thread Next - Re: Using PHP to parse specific XML tag content? Re: Using PHP to parse specific XML tag content?To: NULL Date: 12/4/2008 2:42:00 PM Hi, I have quite different approach. Since PHP is only the engine to produce HTML from XML data, then all processing of XML I do with XSLT. PHP is only a kind of manager (gets the name of XML file, sends content-type, selects proper xsl file). Here is the code: <?php header() ; $xsl = "MyForm.xsl" ; $command = "xsltproc " . $xsl . " " . $_GET[XML_File] ; $last_line = system( $command ) ; ?> Of course you have to have xsltproc installed, but I assume you have it. This way enables you to test your XML --> HTML transformation in testing environment. For example: bash# xsltproc MyForm.xsl TestData.xml That is the end of the story if you want only to display the data from XML file. If not, and you want HTML to be a FORM to post the data back to the server then you need to parse it in the PHP, but this part is easy isn't it? Cheers - Marcin | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
