468,556 Members | 2,382 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,556 developers. It's quick & easy.

Convert XML to HTML Document

I am new to XML and XSL, could someone please help?

I have my XML and XSL files and can view the XML file with the
stylesheet in my browser. Everything is fine.

What I want to do is to convert this to an HTML document and when the
user looks at the source they see HTML instead of XML (which is the
current source and extention). I want to accomplish this on the
client side, I tried using the following in an HTML file but again the
user will not see the desired source.
<body>
<script type = "text/javascript">

//Load XML
var xml = new ActiveXObject("Microsoft.XMLDOM")
xml.async = false
xml.load("note.xml")

//Load XSL
var xsl = new ActiveXObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load("convert.xsl")

//Transform
document.write(xml.transformNode(xsl))
</script>

</body>

In the end I would like to use the XML and XSL files to create a
single HTML file that I can via e-mail instead of having multiple
attachments.

Is this possible?

Thanks,

Will
Jul 20 '05 #1
1 8451


Closer wrote:
I have my XML and XSL files and can view the XML file with the
stylesheet in my browser. Everything is fine.

What I want to do is to convert this to an HTML document and when the
user looks at the source they see HTML instead of XML (which is the
current source and extention). I want to accomplish this on the
client side, I tried using the following in an HTML file but again the
user will not see the desired source.
<body>
<script type = "text/javascript">

//Load XML
var xml = new ActiveXObject("Microsoft.XMLDOM")
xml.async = false
xml.load("note.xml")

//Load XSL
var xsl = new ActiveXObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load("convert.xsl")

//Transform
document.write(xml.transformNode(xsl))
</script>

</body>

In the end I would like to use the XML and XSL files to create a
single HTML file that I can via e-mail instead of having multiple
attachments.

Is this possible?


If you want to have the browser user only see HTML then transform the
XML on the server and send the HTML result to the browser.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jason | last post: by
2 posts views Thread by Henrik Skak Pedersen | last post: by
9 posts views Thread by MLibby | last post: by
3 posts views Thread by Chris Davoli | last post: by
2 posts views Thread by csgraham74 | last post: by
4 posts views Thread by csgraham74 | last post: by
8 posts views Thread by Franck | last post: by
1 post views Thread by eggie5 | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.