XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 14th, 2003, 11:03 AM
clyles clyles is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Dallas, TX
Posts: 2 clyles User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to clyles
XSL/XML using Netscape 7

I need HELP!

For a prototype, I created a sample web page using XML, XSL, Tomcat, and Netscape 7.

The idea is to view the transformation of XML and XSL in a Netscape 7 browser....this shouldn't be that difficult.

So, I've created a Servlet that returns XML data where the stylesheet reference looks like this: <?xml version="1.0" ?><?xml-stylesheet type="text/xml" href="http://localhost:8080/appname/main/student.xsl"?>

I believe the important points of the xsl file are: <?xml version="1.0"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/REC-html40">
<xsl:output method="html" />

At this point, Netscape only shows the XML data. It doesn’t seem to know where the XSL file is located. If I take the href value above (URL) and place it in the browser, the XSL page displays as it should.

So, why doesn’t the transformation occur? This has to be a simple change….I hope.

Thanks,
Chris

Reply With Quote
  #2  
Old August 14th, 2003, 11:34 AM
DarrenJ DarrenJ is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 42 DarrenJ User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 21 sec
Reputation Power: 6
Mozilla and Mozilla based browsers are realy picky about mime type that web server is returning to the browser. If mime type isn't right then browser won't display your xml file like you wish.

Read more about that here http://www.mozilla.org/newlayout/xml/#xhtml.

By the way, whay are you using Tomcat for this?

This example is working for me in Mozilla/NS.

Code:
<!-- XML File sort.xml -->
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="sort.xsl"?>
<Root>
	<F Items="123"/>
	<F Items="34"/>
	<F Items="187"/>
	<F Items="905"/>
	<F Items="1050"/>
	<F Items="903"/>
	<F Items="870"/>
	<F Items="515"/>
	<F Items="15"/>
</Root>

<!-- XSL File sort.xsl-->
<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>

<xsl:template match="Root">
	<html><head>
			<title>Sorting</title>
		</head>
		<body>
			<xsl:for-each select="F">
				<xsl:sort select="@Items" data-type="number" order="descending" />
					<xsl:if test="position() < 6">
						<xsl:value-of select="@Items"/><br />
					</xsl:if>
			</xsl:for-each>
		</body>
	</html>
</xsl:template>

</xsl:stylesheet>


I simply open Netscape an go to http://localhost:8080/sort.xml
__________________
Best regards
Darren

Reply With Quote
  #3  
Old August 14th, 2003, 01:33 PM
clyles clyles is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Dallas, TX
Posts: 2 clyles User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to clyles
First off...thanks for replying.

I'll answer your question. The reason for using tomcat, is that I'm trying to simulate a solution using XML. There are two servers in the equation. Server One (Using Tomcat) will request information from Server Two (Using Weblogic). Server Two will respond sending XML. I would like to have Server One take the XML and use an XSL stylesheet to create the proper presentation. **The XML is dynamic in the data being retrieved.

I can't simply have an xml and xsl file sitting conveniently in the same location.


Here is the mime setting I'm using in Tomcat:
<mime-mapping>
<extension>xml</extension>
<mime-type>text/xml</mime-type>
</mime-mapping>



Still not working,
Chris

Reply With Quote
  #4  
Old August 15th, 2003, 09:21 AM
DarrenJ DarrenJ is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 42 DarrenJ User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 21 sec
Reputation Power: 6
I have mime-type as text/xml for both xml and xsl files. You could try that.

Since I'm not a Tomcat expert I'll let others jump in and fix this. Sorry I couldn't help.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > XSL/XML using Netscape 7


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT