Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-11-2002, 04:29 PM   PM User | #1
Skyzyx
Regular Coder

 
Skyzyx's Avatar
 
Join Date: Aug 2002
Location: Silicon Valley, CA
Posts: 980
Thanks: 0
Thanked 0 Times in 0 Posts
Skyzyx is on a distinguished road
XML and CSS

Using the various XML import scripts I've found here, along with a few other references, I've managed to get my importXML.htm page to work (read http://www.codingforums.com/showthre...&threadid=4548).

The new issue at hand is that when I save XML data to a JavaScript variable, I can't seem to get CSS style sheets to apply.

For example:
Code:
document.write('<table><tr><td style="font-size:8pt;color:#FF0000">'+myJsVariableOfXmlData+'</td></tr></table>');
This doesn't seem to work. I've heard of XSL, but don't really know how it works. Could somebody give me an example of how to do the above task with XSL?
__________________

Creator of SimplePie and Tarzan AWS, co-founder of WarpShare, co-built the Y! Messenger website, usability-focused, and an INFJ personality.
Skyzyx is offline   Reply With Quote
Old 09-14-2002, 01:56 AM   PM User | #2
Skyzyx
Regular Coder

 
Skyzyx's Avatar
 
Join Date: Aug 2002
Location: Silicon Valley, CA
Posts: 980
Thanks: 0
Thanked 0 Times in 0 Posts
Skyzyx is on a distinguished road
Nevermind... I've learned XSL, and it's awesome! I am having problems though with Gecko. Although it works just fine with IE, if I design a XSL file for use with an XML file, if I include JavaScript in that XSL file, document.write() doesn't seem to work at all under Mozilla/Netscape. Is this on purpose, or is this a bug?
__________________

Creator of SimplePie and Tarzan AWS, co-founder of WarpShare, co-built the Y! Messenger website, usability-focused, and an INFJ personality.
Skyzyx is offline   Reply With Quote
Old 09-14-2002, 07:41 PM   PM User | #3
Alex Vincent
Moderator


 
Join Date: May 2002
Location: Hayward, CA
Posts: 1,427
Thanks: 1
Thanked 19 Times in 17 Posts
Alex Vincent is on a distinguished road
More than likely it's intentional. document.write is a DOM Level 1 HTML method, meaning it's supposed to work with HTML documents. It's also supposed to work with XHTML documents served as text/html or application/xhtml+xml (mime types from the server).

document.write is also a risky idea, compared with the Document Object Model's Core techniques.
__________________
"The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
June 30, 2001
author, Verbosio prototype XML Editor
author, JavaScript Developer's Dictionary
https://alexvincent.us/blog
Alex Vincent is offline   Reply With Quote
Old 10-04-2002, 07:03 AM   PM User | #4
Skyzyx
Regular Coder

 
Skyzyx's Avatar
 
Join Date: Aug 2002
Location: Silicon Valley, CA
Posts: 980
Thanks: 0
Thanked 0 Times in 0 Posts
Skyzyx is on a distinguished road
Actually, I contacted Mozilla.org, and yes, it is a bug expected to be fixed by the release of 1.2/1.0.2. Until then, I'll have to use DOM techniques instead of XSL for certain data.
__________________

Creator of SimplePie and Tarzan AWS, co-founder of WarpShare, co-built the Y! Messenger website, usability-focused, and an INFJ personality.
Skyzyx is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:06 AM.


Advertisement
Log in to turn off these ads.