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:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old September 24th, 2001, 05:42 AM
BJohnson BJohnson is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: Madrid, Spain
Posts: 4 BJohnson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
XML and Netscape 6

Hello,

I am trying to do some XML development using Netscape 6.01 A for
Solaris 7 as the browser. Basically, its not working. The XML page
is simple, so I am not using a DTD, just a style sheet to display the page.

I have tried several different xml pages and get the same result.
Below is an example I used that is straight from the devshed
example list:

example.xml:
<?xml version="1.0"?>
<?xml:stylesheet type="text/xsl" href="example_stylesheet.xsl"?>

<me>
<name>John Doe</name>
<address>94, Main Street, Nowheresville 16463, XY</address>
<tel>738 2838</tel>
<email>johndoe@black.hole.com</email>
<url>URL</url>
</me>

and here is the example_stylesheet.xsl:
<?xml version="1.0"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">

<html>
<head></head>
<body>
<h1>Contact information for <b><xsl:value-of select="me/name" /></b></h1>

<h2>Mailing address:</h2> <xsl:value-of select="me/address" />

<h2>Phone:</h2> <xsl:value-of select="me/tel" />

<h2>Email address:</h2> <xsl:value-of select="me/email" />

<h2>Web site URL:</h2> <xsl:value-of select="me/url" />

</body>
</html>
</xsl:template>
</xsl:stylesheet>




When I load the example.xml page in netscape, I get the following
output:
John Doe 94, Main Street, Nowheresville 16463, XY 738 2838 URL URL

All on one line. Basically what it did is extract all of the data and print it.
It doesnt matter if I put the reference to the stylesheet or not, I get the same
output.

From reading the Netscape 6 description, its supposed to be able to
handle XML. Is there some sort of special configuration option, or is
Netscape 6 just as bad the older versions??

Brady

Reply With Quote
  #2  
Old December 20th, 2001, 04:58 PM
caf caf is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 3 caf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Netscape and xsl

After playing around a bit, using an example from mozzilla.org that worked correctly, I found that when adding HTML you need the following tag:

<xslutput method="html" />


A working stylesheet (Netscape 6.2 & Internet Explorer 6) follows:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:strip-space elements="foo"/>

<!-- FileName: MATCH01 -->
<!-- Document: URL -->
<!-- DocVersion: 19991116 -->
<!-- Section: 2.5 -->
<!-- Creator: David Marston -->
<!-- Purpose: Test for //name match pattern. -->
<!-- set the output properties -->
<xslutput method="html" />

<xsl:template match="doc">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="foo/bar//baz">
<FONT COLOR="blue"><xsl:value-of select="@att1"/></FONT>
<xsl:apply-templates/>
</xsl:template>

</xsl:stylesheet>

The corresponding xml is: <?xml version="1.0"?>
<?xml-stylesheet href="select.xsl" type="text/xsl"?>
<doc>
<foo att1="c">
<bar att1="b">
<foo att1="a">
<baz att1="right"/>
</foo>
</bar>
<foo att1="a">
<baz att1="wrong"/>
</foo>
</foo>
</doc>

Reply With Quote
  #3  
Old January 14th, 2002, 08:44 AM
caf caf is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 3 caf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Wink

by the way the Smilie is not supposed to be there it is supposed to be : (colon) immediatly followed by "o" but I didn't turn smilies off

Well I there is another problem ... the transformation works fine if it the files are loaded from the filesystem. When I load them from the Apache webserver only the xml text displays (as described above).

Last edited by caf : January 25th, 2002 at 05:14 PM.

Reply With Quote
  #4  
Old January 28th, 2002, 02:02 PM
lectos lectos is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 10 lectos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
<?xml:stylesheet type="text/xsl" href="example_stylesheet.xsl"?>

is invalid in XSLT but it's valid in XSL. That's why it works in IE but not Mozilla/NS.

Try this syntax instead and it will fix your problem:

<?xml-stylesheet type="text/xsl" href="example_stylesheet.xsl"?>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > XML and Netscape 6


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 6 hosted by Hostway