LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   embedded XML (https://www.linuxquestions.org/questions/programming-9/embedded-xml-921134/)

hydraMax 12-29-2011 07:04 PM

embedded XML
 
I read that it was possible to embed XML in an HTML document with a tag set like so:

Code:

<xml src="test.xml"></xml>
I thought this was the coolest thing, because then I could define content in separate XML documents (articles, etc.), embed them, and then attach CSS to them (which I read was also possible).

But then I get the disappointing news that this only works in Internet Explorer. (?!) And the recommended workaround is to use JavaScript to do the same thing. (reference) However, the idea of having this kind of content dependent on and provided by JavaScript is utterly lame.

Is that just "the way it is"? Or is there something I'm overlooking here?

jhwilliams 12-30-2011 04:09 PM

There is no <xml> tag in the HTML or XHTML specifications. It may be that Internet Explorer decided to implement one. But granted that most of your audience is unlikely to be using Internet Explorer, it might not be of much relevance.

Styling XML into HTML via XSLT is possible, but it almost surely overkill for most simple practical applications. PHP provides simplistic methods to include content stubs. Have you looked at that?

dugan 12-30-2011 05:40 PM

Quote:

Originally Posted by jhwilliams (Post 4562089)
Styling XML into HTML via XSLT is possible, but it almost surely overkill for most simple practical applications. PHP provides simplistic methods to include content stubs. Have you looked at that?

And if you want to do your HTML generation client-side, it would be much better to use a Javascript templating framework such as jquery-templates, Mustache, or Google closure templates.

I can guarantee you that the embedded-xml/XSLT thing you're talking about is never done.


All times are GMT -5. The time now is 05:09 AM.