Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can I write xml in html file ?

Status
Not open for further replies.

goodgood

Programmer
Feb 15, 2001
13
0
0
IL
Hi
how can I write xml data in html file ?
I have xml with link to xsl
and I want to put the xml in one html file
(that contain some JavaScript).

regards
goodgood.
 
Hi

xml data can be embedded within an html page although I don't know if that's what you want to do.
When embedded its referred to as a data island BUT as far as know this only works with IE.

<xml>
</xml>

However,

Within your xsl file, you can code your Javascript &amp; html as if it's an html file. If you go back a couple of threads you'll see the discussion on Binding XML that Avator helped me out with. here's fragment of my xsl

<xsl:template match=&quot;/&quot;>
<html>
<head>
<script language=&quot;JavaScript&quot;>
function showValue() {.......}
</script>
</head>
<body>
<select id =&quot;combo1&quot; onchange=&quot;showValue();&quot;>
<xsl:for-each select=&quot;recordset&quot;>
<xsl:apply-templates select=&quot;row&quot;/>
</xsl:for-each>
</select>
</body>
</html>
</xsl:template>

The above is inside a xsl file so as you can see I have xsl tags, html tags &amp; Javascript code all in one single file. It still doesn't address the problem of having xml as well in the xsl file but I do recall a discussion on that topic(not necessarily this forum). Let me get back to you.

Hope this helps
caf

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top