472,779 Members | 1,696 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,779 software developers and data experts.

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 8613


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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Matt | last post by:
I want to use XML to store a document's configurations. And I can convert to different file format by using XSL. For example, convert to HTML, PDF, or RTF. But the contents are all stored in single...
1
by: Jason | last post by:
Could anyone please give me a hand converting this script, written for IE to work with netscape? _________________________________ ______________________________________ <!-- var...
2
by: Henrik Skak Pedersen | last post by:
Hi, I am trying to convert a very basic WML document to HTML using the word2HTML.xsl stylesheet. But I get an exception when I am trying to convert it: The code looks like this: ...
9
by: MLibby | last post by:
How do I convert an HTML page into XML? My initial thought is to convert the page to xslt but I'm not sure how to do this. Please provide any source code examples if you have them. Thanks, Mike...
3
by: Chris Davoli | last post by:
I've got a requirement to build a page using MS WORD and then have the page show up on a web site. I know I can do a binary write and open up the WORD document in IE plugin. Don't really want to do...
2
by: csgraham74 | last post by:
Hi, I have a requirement in work that i give a person the ability to create a html document using a richt text editor. What i then want to do is save the HTML doct to my server & insert...
4
by: csgraham74 | last post by:
Hi, Ive posted on this previously but had no response. Basically i need to build some html using a rich text editor. Then i want to actually create an html document from this and save it to my...
8
by: Franck | last post by:
Hi, I'm lookin for an external tool which could convert any type of documents to pdf from server. (with as much functionnalities as possible : schedule, pooling, multi thread, embedding font,...
1
by: eggie5 | last post by:
I want to use element.appendChild(child) on a string of HTML I have: html= '<div> <strong>Text</strong> </div>' However, since it's not an element (ie created with document.createElement)...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.