Raymond Irving wrote:
If I remove the \r from the file using preg_replace() then it shows up just fine. I was just wondering if there was a way to suppress the \r in the xml output. Another thing that I've observed while looking at your code is that it only works best for dynamic web pages. It appears that it would not work well when using page caching or page templates. I really think having a function that generates xhtml (html compatible) output, would really eliminate all these workarounds that we will have to do in order to get the page to render inside popular web browsers. A lot of developers produce xhtml web pages that are html 4 compatible, so that they can be rendered in browsers that only supports html rendering. This is something that I think the PHP DOM should be able to support with ease.
If you want to send the same page for everybody than use html 4.01 (or html 5 when it is ready) and the saveHTML() function.
The only reason I don't do that is because I wish html would go away, so I generally send valid xhtml (header and all) and only provide the html as a fall back for inferior browsers.
With respect to templating systems, I don't use them but if you have a DOMDocument orientated template system, I don't see why it couldn't do the same thing - as far as the DOM used to generate xhtml (via saveXML()) or html (via saveHTML()) - the only difference is the DTD and the fact that xhtml sometimes uses namespaced attributes (which may get stripped with saveHTML() anyway)
That's the beauty IMHO of DOMDocument - virtually identical data in the DOM can produce valid html or xhtml - as long as you aren't using xhtml only extensions (like MathML).
So it should work beautifully with a templating system, as long as the templating system is built for DOMDocument consumption.
I think there are a few. How well they work with caching I don't know. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php