Re: [PHP] custom tags
Eric Emminger wrote: Hi George, How about this? parse the html as xml and replace the component tags with whatever php/html code output that result to a file include the file from previous step Eric On Tue, 6 Jul 2004 15:56:26 -0500, George Lantz [EMAIL PROTECTED] wrote: I am looking for a way to parse custom html tags. I would like to then replace those tags with php/html code. Here is an example of the html file to be parsed. Notice the component, they are the custom tags I wish to replace with code. I only need help in parsing the tags and storing in a variable or array so I can work with the attributes. The component tag will be the only tag I will need to work with. html head titletest/title /head body component name=menu layout=horizontal / component name=titlebar / /body /html This is what I was thinking, although if someone has better idea that is fine. I was thinking of storing these in a multi-dimensional array. An example might be $components[0][name][layout]. Is there code out there already that does this? Or you could simply use a regexp to extract those from the code, and then later on using the 'e' flag, replace them with PHP code. - Tul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] custom tags
Eric Emminger wrote: Hi George, How about this? parse the html as xml and replace the component tags with whatever php/html code output that result to a file include the file from previous step There's actually a PEAR package which can help you with this as well: http://pear.php.net/package/XML_HTMLSax I love being a lazy programmer :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] custom tags
I am looking for a way to parse custom html tags. I would like to then replace those tags with php/html code. Here is an example of the html file to be parsed. Notice the component, they are the custom tags I wish to replace with code. I only need help in parsing the tags and storing in a variable or array so I can work with the attributes. The component tag will be the only tag I will need to work with. html head titletest/title /head body component name=menu layout=horizontal / component name=titlebar / /body /html This is what I was thinking, although if someone has better idea that is fine. I was thinking of storing these in a multi-dimensional array. An example might be $components[0][name][layout]. Is there code out there already that does this?
Re: [PHP] custom tags
Hi George, How about this? parse the html as xml and replace the component tags with whatever php/html code output that result to a file include the file from previous step Eric On Tue, 6 Jul 2004 15:56:26 -0500, George Lantz [EMAIL PROTECTED] wrote: I am looking for a way to parse custom html tags. I would like to then replace those tags with php/html code. Here is an example of the html file to be parsed. Notice the component, they are the custom tags I wish to replace with code. I only need help in parsing the tags and storing in a variable or array so I can work with the attributes. The component tag will be the only tag I will need to work with. html head titletest/title /head body component name=menu layout=horizontal / component name=titlebar / /body /html This is what I was thinking, although if someone has better idea that is fine. I was thinking of storing these in a multi-dimensional array. An example might be $components[0][name][layout]. Is there code out there already that does this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] custom tags
Eric Emminger wrote: Hi George, How about this? parse the html as xml and replace the component tags with whatever php/html code output that result to a file include the file from previous step That's a good suggestions but problems arise because HTML does not have to be well formed. There is however a HTML parser module in perl which does a fairly good job even with badly written HTML. Eric On Tue, 6 Jul 2004 15:56:26 -0500, George Lantz [EMAIL PROTECTED] wrote: I am looking for a way to parse custom html tags. I would like to then replace those tags with php/html code. Here is an example of the html file to be parsed. Notice the component, they are the custom tags I wish to replace with code. I only need help in parsing the tags and storing in a variable or array so I can work with the attributes. The component tag will be the only tag I will need to work with. -- Raditha Dissanayake. - http://www.raditha.com/megaupload/upload.php Sneak past the PHP file upload limits. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php