HGeneAnthony Posted May 31, 2007 Share Posted May 31, 2007 What I'd like to do is use xml in my php file for use with my css. I noticed php can read from xml files to get data but can I use xml in my php file like how xhtml uses xml. As in can I use xml with css for presentation rather than as data entry. If you know what I mean. Quote Link to comment https://forums.phpfreaks.com/topic/53774-how-can-i-use-cssxml-inside-my-php-file-for-formatting/ Share on other sites More sharing options...
obsidian Posted May 31, 2007 Share Posted May 31, 2007 I think you need to take a step back and get a grasp on the levels and interaction of the different languages you're talking about. PHP is completely server-side. XHMTL, XML and CSS are all client side (browser) scripts. So, what PHP does with XHTML or XML has absolutely nothing to do with the interaction of CSS with the markup. Most likely, an XSL page is what you're after for your XML styling. If you would like, though here is a good article on styling XML for you to read. Hope that helps. Quote Link to comment https://forums.phpfreaks.com/topic/53774-how-can-i-use-cssxml-inside-my-php-file-for-formatting/#findComment-265821 Share on other sites More sharing options...
HGeneAnthony Posted May 31, 2007 Author Share Posted May 31, 2007 I'm not looking for the php interpreter to handle the xml. The php interpreter handles the script and returns pure HTML (I'm aware of this). What I would like to do is have the returned html returned like xhtml so I can use xml elements with the style sheet. Under Firefox this works but under IE 7 the style sheet isn't being applied to the xml elements so I wonder if the document needs to use an .xml extension or an .xhtml extension for IE 7 to acknowledge the xml elements. Quote Link to comment https://forums.phpfreaks.com/topic/53774-how-can-i-use-cssxml-inside-my-php-file-for-formatting/#findComment-265835 Share on other sites More sharing options...
obsidian Posted June 1, 2007 Share Posted June 1, 2007 XHTML is simply a doctype difference, not a difference in file type or extension. If you're wanting to include XML elements (at least their content) within your (X)HTML pages, you need to have a free standing XML file that your PHP can parse and then spit out to your page in valid (X)HTML. Mixing the markup types is not an option. If you have an XHTML page, then it has a doctype to tell the browser how to render the page, so XML tags will not be recognized nor properly parsed. On the other hand, if you declare and XML doctype, there are (X)HTML elements that will not be displayed appropriately, either. Mixing the two just can't happen as you're indicating. Quote Link to comment https://forums.phpfreaks.com/topic/53774-how-can-i-use-cssxml-inside-my-php-file-for-formatting/#findComment-266198 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.