Jump to content

Recommended Posts

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.

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.

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.

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.