473,395 Members | 1,692 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

xml, xsl, css ... in netscape

Hi, all.
i try to use xsl to show xml in IE6+ and NN7+

i got:

index.htm

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<link rel="stylesheet" href="./css/style.css">

<script language="JavaScript">
function init(){

//here is checking of browser -> type is IE or
NN
var docXML = initXML(type);
var docXSL = initXML(type);

if (type == "NN"){
var count = 0;
docXML.onload = transform;
docXML.load(test.xml);
docXSL.onload = transform;
docXSL.load(test.xsl);

}
else if (type == "IE"){
docXML.async = false;
docXML.load(test.xml);
docXSL.async = false;
docXSL.load(test.xsl);
document.write(docXML.transformNode(docXSL));
}

function transform(){
count++;
if (count == 2){
var xsltProcessor = new XSLTProcessor();
var outdoc = initXML(type);
xsltProcessor.transformDocument(docXML,
docXSL, outdoc, null);
document.write(outdoc.documentElement.innerHTML);
}
}
}

</script>
</head>
<body bgcolor="#EFEFEF">
<script language="JavaScript"> init(); </script>
</body>
</html>

test.xsl:

<?xml version="1.0" encoding="ISO-8859-2"?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="root">
<html>
<head />
<body bgcolor="#EFEFEF">

<table bordercolor="#ffffff" cellspacing="0" width="98%"
bordercolorlight="#6b5c35" border="1" cellpadding="0">
<tr>
<td align="center" class="captionXSL"> TEST </td>
</tr>
</table>
...
</body>
</html>
</xsl:template>
</xsl:transform>

style.css

..captionXSL {
font: 12px Arial;
font-weight: bold;
}

in IE it all works OK.
styles define in style.css are used in transformation of XML with XSL in
HTML

but in NN
there is no styles. It shows all needed data but it didn't read and apply
styles.

i hope you will help me.

thanks

Jul 20 '05 #1
8 1459
mali djuro wrote:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<link rel="stylesheet" href="./css/style.css">

<script language="JavaScript">
function init(){

//here is checking of browser -> type is IE or
NN
var docXML = initXML(type);
var docXSL = initXML(type);

if (type == "NN"){
var count = 0;
docXML.onload = transform;
docXML.load(test.xml);
docXSL.onload = transform;
docXSL.load(test.xsl);

}
else if (type == "IE"){
docXML.async = false;
docXML.load(test.xml);
docXSL.async = false;
docXSL.load(test.xsl);
document.write(docXML.transformNode(docXSL));
}

function transform(){
count++;
if (count == 2){
var xsltProcessor = new XSLTProcessor();
var outdoc = initXML(type);
xsltProcessor.transformDocument(docXML,
docXSL, outdoc, null);
document.write(outdoc.documentElement.innerHTML);


But should it work at all? You are replacing current page's content with
completely different one, which doesn't have link to css.
PS. Why not using <?xml-stylesheet PI?
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Jul 20 '05 #2

"Oleg Tkachenko" <oleg@NO_SPAM_PLEASEtkachenko.com> wrote in message
news:eV*************@TK2MSFTNGP12.phx.gbl...
mali djuro wrote:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<link rel="stylesheet" href="./css/style.css">

<script language="JavaScript">
function init(){

//here is checking of browser -> type is IE or NN
var docXML = initXML(type);
var docXSL = initXML(type);

if (type == "NN"){
var count = 0;
docXML.onload = transform;
docXML.load(test.xml);
docXSL.onload = transform;
docXSL.load(test.xsl);

}
else if (type == "IE"){
docXML.async = false;
docXML.load(test.xml);
docXSL.async = false;
docXSL.load(test.xsl);
document.write(docXML.transformNode(docXSL)); }

function transform(){
count++;
if (count == 2){
var xsltProcessor = new XSLTProcessor(); var outdoc = initXML(type);
xsltProcessor.transformDocument(docXML, docXSL, outdoc, null);
document.write(outdoc.documentElement.innerHTML);

But should it work at all? You are replacing current page's content with
completely different one, which doesn't have link to css.
It works, under IE6, and in NN7 it doesn't shows styles.
but when i remove <html>,<head> and <body> tags from test.xsl
in NN7 there is no data, it is just blank page with word undefined in upper
left corner.
PS. Why not using <?xml-stylesheet PI?
i try to avoid it, because i made xml generator with no possibility to set
PI.
and now i would like to use it here if it is possible.
thanks
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Jul 20 '05 #3
mali djuro wrote:
It works, under IE6, and in NN7 it doesn't shows styles.
but when i remove <html>,<head> and <body> tags from test.xsl
in NN7 there is no data, it is just blank page with word undefined in upper
left corner.

What if you insert <link rel="stylesheet" href="./css/style.css"> into
test.xsl? I mean if you new generated HTML doesn't contain a link to CSS, so
why styles should work?
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Jul 20 '05 #4

"Oleg Tkachenko" <oleg@NO_SPAM_PLEASEtkachenko.com> wrote in message
news:O4**************@TK2MSFTNGP12.phx.gbl...
mali djuro wrote:
It works, under IE6, and in NN7 it doesn't shows styles.
but when i remove <html>,<head> and <body> tags from test.xsl
in NN7 there is no data, it is just blank page with word undefined in upper left corner.
What if you insert <link rel="stylesheet" href="./css/style.css"> into
test.xsl? I mean if you new generated HTML doesn't contain a link to CSS, so why styles should work?
i am confused too. only reasonbly explanation is that with transformation i
got
just element, not a whole document. and it pass in IE.

--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Jul 20 '05 #5
mali djuro wrote:
i am confused too. only reasonbly explanation is that with transformation i
got
just element, not a whole document. and it pass in IE.


Well, actually I wanted to say that generated HTML document doesn't have any
link to CSS, right? So this looks to me like your problem. Have you tried to
add link to XSL:

<xsl:template match="root">
<html>
<head>
<link rel="stylesheet" href="./css/style.css">
</head>
<body bgcolor="#EFEFEF">
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Jul 20 '05 #6

"Oleg Tkachenko" <oleg@NO_SPAM_PLEASEtkachenko.com> wrote in message
news:OZ**************@tk2msftngp13.phx.gbl...
mali djuro wrote:
i am confused too. only reasonbly explanation is that with transformation i got
just element, not a whole document. and it pass in IE.
Well, actually I wanted to say that generated HTML document doesn't have

any link to CSS, right? So this looks to me like your problem. Have you tried to add link to XSL:

<xsl:template match="root">
<html>
<head>
<link rel="stylesheet" href="./css/style.css">
</head>
<body bgcolor="#EFEFEF">
yes, i tried it,
but in this case, even in IE,
styles are not applied

--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Jul 20 '05 #7
mali djuro wrote:
<xsl:template match="root">
<html>
<head>
<link rel="stylesheet" href="./css/style.css">
</head>
<body bgcolor="#EFEFEF">

yes, i tried it,
but in this case, even in IE,
styles are not applied


Hmmm, chances are that ./css/style.css is not resolved properly in that case -
can you try with absolute URL like <link rel="stylesheet"
href="http://foo.com/css/style.css"> ?

--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Jul 20 '05 #8

"Oleg Tkachenko" <oleg@NO_SPAM_PLEASEtkachenko.com> wrote in message
news:eL**************@TK2MSFTNGP12.phx.gbl...
mali djuro wrote:
<xsl:template match="root">
<html>
<head>
<link rel="stylesheet" href="./css/style.css">
</head>
<body bgcolor="#EFEFEF">

yes, i tried it,
but in this case, even in IE,
styles are not applied


Hmmm, chances are that ./css/style.css is not resolved properly in that

case - can you try with absolute URL like <link rel="stylesheet"
href="http://foo.com/css/style.css"> ?

hi,
i found out how to applied styles in NN. i used a little bit of everithing
and mixed and now it works. but i still have problems.
it is not problem that stops program or breaks it, but it borders me.
when i make transformations, and if i call some javascript functions inside
it, for example i have function to generate navigation menu in pages, and
when i call it, menu is written but NN never stops loading page. when i stop
loading and view sourcd page, i found out that code of menu is written
behind </html> tag.
if you have some experience in this or now how to solve it, plesae help.

thanks.

here is xsl file with that function

test.xsl:

....
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<link rel="stylesheet" href="./css/menu.css" />

<script language="JavaScript"
src="./menu/menu.js"></script>
</head>

<body bgcolor="#EFEFEF">

<script language="JavaScript">
make_menu();
</script>

.....
page source is:

...
</table>
</body>
</html>
<a id="e0_0o" class="oout" href="main.htm" style="position:
absolute; top: 11px; left: 10px; width: 149px; height: 24px; visibility:
hidden; z-index: 0;" onclick="return A_MENUS[0].onclick(0);"
onmouseout="A_MENUS[0].onmouseout(0);"
onmouseover="A_MENUS[0].onmouseover(0);"
onmousedown="A_MENUS[0].onmousedown(0);"><div id="e0_0i"
class="iout">main</div></a>
<a id="e0_1o" class="oout" href="" style="position: absolute; top:
11px; left: 159p
.....
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Jul 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sims | last post by:
Hi, if i use... // php $info = getenv("HTTP_USER_AGENT"); // I noticed that Mozzila and Netscape <6(?) both use the same Agent. // so i was thinking of if...
1
by: mark.reichman | last post by:
First off.. Thanks to Grant Wagner for help in a previous thread related to this one. I am at a total loss... I have multiple fields in a form with the same name. Lets call the fields with the...
9
by: rez | last post by:
I find it rather frustrating that Netscape 4.x is "no longer supported:" http://help.netscape.com/products/client/communicator/reflib.html Same seems true with IE. How am I ever supposed to...
2
by: SabMan | last post by:
I understand that document.layers is no longer supported in Netscape 7.1 but I am not sure on how to fix the code so that it will work with Netscape 7.1. I understand that document.all is no...
26
by: Roger Desparois | last post by:
Hi, I need help : I found the simplest and most precise way to open and close submenu layers. it works perfectly with IE, but for some odd reason NS won't recognize it. Can anyone tell me why...
6
by: qqq | last post by:
I'm a relative newbie... I'd like my site to support Netscape browsers. For a page I set 'TargetSchema' to 'IE 3.02/Netscape 3'. When I insert label or textbox web controls on the page, they...
10
by: News | last post by:
I have a page up trying to learn how to ID a browser and other info. http://wyght.com/warren/testPos.html here is the code <script type = "text/javascript"> var space = ", "; var name...
4
by: Nathan Sokalski | last post by:
I was testing out a page of mine that displays the information from Page.Request.Browser. It works exactly as I expected in Internet Explorer and Netscape 4.75 (I didn't expect much in Netscape...
7
by: Joe | last post by:
I've been playing around with atlas for hte past couple days and its very impressive. However the standard browser here is Netscape, specifically: Netscape 7.02 Mozilla/5.0 (Windows; U; Windows NT...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.