Convert XML to HTML Document

C

Closer

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
 
M

Martin Honnen

Closer said:
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.
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top