RE: Not loading XML to HTML page

 
I'm afraid your question has nothing to do with XML Schema, so you are
asking in the wrong place.

Rather than writing a server-side JSP script that generates HTML which
contains client side Javascript to fetch the XML from the server, why not do
all the work on the server, using XSLT for example?

Michael Kay
http://www.saxonica.com/
 


> -----Original Message-----
> From: xmlschema-dev-request@w3.org 
> [mailto:xmlschema-dev-request@w3.org] On Behalf Of Tomcat User6
> Sent: 25 July 2008 22:51
> To: xmlschema-dev@w3.orgY
> Subject: Not loading XML to HTML page
> 
> 
> I have a XML page which i needs to load at HTML.
> 
> XML looks like this....
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <page>
> 	<head>
> 		<title><![CDATA[My Dishwasher]]></title>
> 		<meta name="keywords" content="GenericKindR, 
> Fully, Integrated, Console, "
> />
> 		<meta name="description" content="GenericKindR 
> cleans up all the competition." />
> 	</head>
> 	<body>
> 		<h1 id="header1"><![CDATA[6 Cycle | 23 7/8 in. 
> Width | Fully Integrated Console | Standard-Depth | Flat, 
> Smooth Doors | GeneritectR Series II | KSdishwasher1764548]]></h1>
> 		
> 		<p id="prodDescript"><![CDATA[This is some 
> generic GenericKindR Fully Integrated Console Dishwasher 
> product description copy. We are using the product name and 
> SKU as a search keyword to maximize search results. This 
> product will knock your socks off with its cleaning power. 
> GenericKindR GeneritectR Series Fully Integrated Console 
> Dishwasher cleans all the competition.]]></p>
> 		<p id="prodDescrBullets"> 
> 			<ul>
> 				<li><![CDATA[. GenericKindR 
> GeneritectR KSdishwasher1764548 Dishwasher Bullet Point 1]]></li>
> 				<li><![CDATA[. GenericKindR 
> GeneritectR KSdishwasher1764548 Dishwasher Bullet Point 2]]></li>
> 			</ul>
> 		</p>
> 		<p id="SKU">KSfridge1764547</p>
> 		<p id="price">$1999.00</p>
> 				<menu>
> 			<button> 
> data/standmixers/KSstandmixer1764549 Standmixers </button>
> 			<button> 
> data/refrigerators/KSfridge1764547 Refrigerators </button>
> 			<button> data/home/GKHome.xml Home </button>
> 		</menu>
> 		<pageType>TIER_ONE</pageType>
> 	</body>
> </page>
> 
> 
> 
> I written a java script to write all this code into html. But 
> don't know, wht is happening.
> 
> I AM TOTALLY NEW TO THIS.
> 
> Here is my script...
> 
> <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
>     pageEncoding="ISO-8859-1"%>
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
> <html>
> <head>
> <script type="text/javascript">
> var xmlhttp;
> 
> function loadXMLDoc(url)
> {
> xmlhttp=null;
> if (window.XMLHttpRequest)
>   {// code for IE7, Firefox, Mozilla, etc.
>   xmlhttp=new XMLHttpRequest();
>   }
> else if (window.ActiveXObject)
>   {// code for IE5, IE6
>   xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
>   }
> if (xmlhttp!=null)
>   {
>   xmlhttp.onreadystatechange=onResponse;
>   xmlhttp.open("GET",url,true);
>   xmlhttp.send(null);
>   }
> else
>   {
>   alert("Your browser does not support XMLHTTP.");
>   }
> }
> 
> function onResponse()
> {
> if(xmlhttp.readyState!=4) return;
> if(xmlhttp.status!=200)
>   {
>   alert("Problem retrieving XML data");
>   return;
>   }
> }
> 
> </script>
> </head>
> 
> <body>
> <div id="copy">
> <button onclick="loadXMLDoc('catalog.xml')">Get  
> info</button> </div> </body> </html>
> 
> 
> But don't know how to get data for page,head,title,body,h1,p, 
> header,meta etc...
> 
> Please help me out with this.
> 
> Thank You,,
> 
> 
> 
> --
> View this message in context: 
> http://www.nabble.com/Not-loading-XML-to-HTML-page-tp18660178p
> 18660178.html
> Sent from the w3.org - xmlschema-dev mailing list archive at 
> Nabble.com.
> 
> 
> 

Received on Sunday, 27 July 2008 22:34:23 UTC