xml for data holding

  • Thread starter Bill Cunningham
  • Start date
B

Bill Cunningham

I know you can write an xml page that holds data and use XSL or CSS to
format the XML page. But can you just hold data in an xml page and your XSL
be in another page say html or xhtml?

Bill
 
M

Martin SChukrazy

umm you could hold the xsl data in a seperate html page, but then
programmatically you could extract the xsl
contents and apply the transformation on your xml.

Martin
 
B

Bill Cunningham

Martin SChukrazy said:
umm you could hold the xsl data in a seperate html page, but then
programmatically you could extract the xsl
contents and apply the transformation on your xml.

Martin
What about writing a page like this..
<html xmlns="www.w3.org/1999/xhtml">
to begin an xhtml page then...
<script language="xml">
xml data
</script>
</html>
I think this technique is called xml islands. I'm not sure how it would be
formatted for browsers with XSL.

Bill
 
P

Patrick TJ McPhee

% I know you can write an xml page that holds data and use XSL or CSS to
% format the XML page. But can you just hold data in an xml page and your XSL
% be in another page say html or xhtml?

You could use the so-called `simplified syntax' to embed xslt in an xhtml
page, then use the document() function to retrieve data from your other
xml document. This would look something like

<html xmlns='http://www.w3.org/1999/xhtml'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
xsl:version='1.0'>
<body>
<xsl:for-each select='document("something-or-other.xml")//par'>
<p><xsl:value-of select='.'/></p>
</xsl:for-each>
</body>
</html>

However, this syntax doesn't seem to be supported by Mozilla. I'm not
sure about IE or other browsers, but if you do the transformation on
the server side, you should be able to find a tool which supports it
(libxslt does). Anyway, you can use the document function in
a normal style sheet and `something-or-other.xml' will be resolved
against the style sheet's base url, which might be what you want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top