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

Before you post, read our: Rules & Posting Guidelines

Closed Thread
 
Thread Tools Rating: Thread Rating: 2 votes, 4.00 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-19-2004, 04:23 PM   PM User | #16
ReadMe.txt
Regular Coder

 
Join Date: Jun 2002
Location: Sheffield, UK
Posts: 552
Thanks: 0
Thanked 0 Times in 0 Posts
ReadMe.txt is an unknown quantity at this point
so which browsers will actually render XHTML documents served as text/xml, application/xml and/or application/xhtml+xml?
__________________
"To be successful in IT you don't need to know everything - just where to find it in under 30 seconds"

(Me Me Me Me Me Me Me Me Me)
ReadMe.txt is offline  
Old 06-19-2004, 07:00 PM   PM User | #17
gsnedders
Senior Coder

 
gsnedders's Avatar
 
Join Date: Jan 2004
Posts: 2,340
Thanks: 1
Thanked 7 Times in 7 Posts
gsnedders will become famous soon enough
Safari, and I think FireFox and Opera 7 will as well.
__________________
Geoffrey Sneddon
gsnedders is offline  
Old 06-19-2004, 08:03 PM   PM User | #18
jkd
Senior Coder

 
jkd's Avatar
 
Join Date: May 2002
Location: metro DC
Posts: 3,163
Thanks: 1
Thanked 18 Times in 18 Posts
jkd will become famous soon enough
Opera only started supporting the <script> tag in 7.5 when served as application/xhtml+xml and the like. Commands like document.write() don't work in Gecko either, when it is served as an XML mime-type, because the root document is XMLDocument and not HTMLDocument. I don't know anything about how Safari handles an XML mime-type, other than it does.
__________________
jasonkarldavis.com
jkd is offline  
Old 06-19-2004, 08:06 PM   PM User | #19
Tails
Regular Coder

 
Join Date: Nov 2002
Posts: 672
Thanks: 1
Thanked 1 Time in 1 Post
Tails is an unknown quantity at this point
What does it mean to be "served as"? I've never heard of a server treating XHTML any different than HTML. Does this new file type mean anything when rendering? Is XHTML supposed to have it's own unique file extension if we want to distinguish it from the ordinary htm files? Was it a mistake that I used an XHTML 1.1 DTD on my pages instead of XHTML 1.0 Strict? What's going on with this?
Tails is offline  
Old 06-19-2004, 08:48 PM   PM User | #20
gsnedders
Senior Coder

 
gsnedders's Avatar
 
Join Date: Jan 2004
Posts: 2,340
Thanks: 1
Thanked 7 Times in 7 Posts
gsnedders will become famous soon enough
XHTML 1.1 must be served as application/xhtml+xml, however, XHTML 1.0 can be served as text/html. As for the extension, you can use .xhtml, however I would advice against it, and use .html
__________________
Geoffrey Sneddon
gsnedders is offline  
Old 06-20-2004, 03:46 AM   PM User | #21
J&J
New Coder

 
Join Date: Sep 2003
Location: your temp folder
Posts: 89
Thanks: 0
Thanked 0 Times in 0 Posts
J&J is an unknown quantity at this point
Cool try unicode to ward off spam

Personally, I use unicode to display my email address & prevent spam. Web pages display it correctly, but spambots don't understand it. If you don't know how to convert it to unicode -- here's a website that does it for you, free:

http://andrew.hedges.name/experiments/obfuscator/


Just enter your email address on the left, & the unicode version will be shown on the right.
__________________
~ J&J ~
"Sometimes I feel like I'm rearranging deck chairs on the Titanic."


Work | Family | Community
J&J is offline  
Old 06-20-2004, 05:29 AM   PM User | #22
Tails
Regular Coder

 
Join Date: Nov 2002
Posts: 672
Thanks: 1
Thanked 1 Time in 1 Post
Tails is an unknown quantity at this point
Quote:
Originally Posted by J&J
Personally, I use unicode to display my email address & prevent spam. Web pages display it correctly, but spambots don't understand it. If you don't know how to convert it to unicode -- here's a website that does it for you, free:

http://andrew.hedges.name/experiments/obfuscator/


Just enter your email address on the left, & the unicode version will be shown on the right.
So that's what unicode is? I thought it was ASCII (when the numbers are converted to hex, they match the numbers a hex editor will display for ascii text). I've always used only #64 to encode the @ sign since it's the most important part. Without that, the rest is insignifigant to the rest of the contant that may appear on the page. It's a nice link though.
Tails is offline  
Old 08-04-2004, 12:44 AM   PM User | #23
AaronW
Senior Coder

 
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 1,223
Thanks: 0
Thanked 0 Times in 0 Posts
AaronW is an unknown quantity at this point
Isn't it highly likely that someone will write a spambot that looks for @ and its unicode equivelant? Wouldn't seem like something terribly hard to do...

I think it'd be clever to just encode the surrounding parts of the @. What're the odds of one looking for &xxx;@&xxx;&xxx;&xxx; ?

I just don't show my email anywhere and force visitors to use my contact <form> :P Those spammers will clue in eventually I betcha.
__________________
offtone.com | offtonedesign.com
AaronW is offline  
Old 08-30-2004, 03:29 PM   PM User | #24
ReadMe.txt
Regular Coder

 
Join Date: Jun 2002
Location: Sheffield, UK
Posts: 552
Thanks: 0
Thanked 0 Times in 0 Posts
ReadMe.txt is an unknown quantity at this point
Opera seems to ignore the CDATA dec when it's ecnased in /* */ CSS comments, anybody know what a good fix would be?
__________________
"To be successful in IT you don't need to know everything - just where to find it in under 30 seconds"

(Me Me Me Me Me Me Me Me Me)
ReadMe.txt is offline  
Old 08-30-2004, 07:47 PM   PM User | #25
brothercake
Senior Coder


 
Join Date: Jun 2002
Location: near Oswestry
Posts: 4,508
Thanks: 0
Thanked 0 Times in 0 Posts
brothercake is an unknown quantity at this point
Quote:
Originally Posted by ReadMe.txt
Opera seems to ignore the CDATA dec when it's ecnased in /* */ CSS comments, anybody know what a good fix would be?
A fix would be not to do it - a commented CDATA section is a contradiction: a non-XML-aware browser doesn't understand CDATA, so it serves no purpose, and an XML-aware browser should require the /* */ to be inside the CDATA section.

There's no correct way to do that trick. Just put the styles in an external file.
__________________
"Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark
brothercake is offline  
Old 08-30-2004, 08:19 PM   PM User | #26
liorean
The thread killer


 
Join Date: Feb 2003
Location: Umeå, Sweden
Posts: 5,575
Thanks: 0
Thanked 84 Times in 75 Posts
liorean will become famous soon enoughliorean will become famous soon enough
Quote:
Originally Posted by brothercake
A fix would be not to do it - a commented CDATA section is a contradiction: a non-XML-aware browser doesn't understand CDATA, so it serves no purpose, and an XML-aware browser should require the /* */ to be inside the CDATA section.
What? XML parsing precedes XML "rendering" (for lack of a better word for it) precedes parsing of any embedded content in another language, such as CSS or JavaScript. Thus, there would be no such requirement. Let's illustrate it:

Source
Code:
<head>
<style attributes>
selector {
     property : value; /* <![CDATA[ <a & comment> ]]> */
    }
</style>
</head>
XML Parsing
Code:
01. Start Element head
02. Text "\u000a"
03. Start Element style
04. Attributes attributes
05. Text "selector {\u000a    property : value; /* "
06. Start CDATA
07. Text " <a & comment> "
08. End CDATA
09. Text " */\u000a    }\u000a"
10. End Element style
11. Text "\u000a"
12. End Element head
XML "rendering"
Code:
Element head
> Text "\u000a"
> Element style
> > Attributes attributes
> > Text "selector {\u000a    property : value; /*  <a & comment>  */\u000a    }\u000a"
> Text "\u000a"
Which means that the content sent to the CSS parser will be as follows:
Code:
selector {
    property : value; /*  <a & comment>  */
    }
__________________
liorean <[lio@wg]>
Articles: RegEx evolt wsabstract , Named Arguments
Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

Last edited by liorean; 08-30-2004 at 08:22 PM..
liorean is offline  
Old 08-31-2004, 03:30 PM   PM User | #27
ReadMe.txt
Regular Coder

 
Join Date: Jun 2002
Location: Sheffield, UK
Posts: 552
Thanks: 0
Thanked 0 Times in 0 Posts
ReadMe.txt is an unknown quantity at this point
Quote:
Originally Posted by brothercake
A fix would be not to do it - a commented CDATA section is a contradiction: a non-XML-aware browser doesn't understand CDATA, so it serves no purpose, and an XML-aware browser should require the /* */ to be inside the CDATA section.

There's no correct way to do that trick. Just put the styles in an external file.
well i needed it to be inline to hide from NS4, so since i was using an accept sniffer to server up different doctypes i served up uncommented cdata blocks with the xml mimetype and regualr old style html comments for the old doctype.
__________________
"To be successful in IT you don't need to know everything - just where to find it in under 30 seconds"

(Me Me Me Me Me Me Me Me Me)
ReadMe.txt is offline  
Old 06-04-2005, 11:37 PM   PM User | #28
devosc
New Coder

 
Join Date: Jun 2005
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
devosc is an unknown quantity at this point
A current observation using CDATA as opposed to <!-- is that babelfish (the page translator) currently seems to only recognize the latter.
devosc is offline  
Old 06-05-2005, 10:01 PM   PM User | #29
Tails
Regular Coder

 
Join Date: Nov 2002
Posts: 672
Thanks: 1
Thanked 1 Time in 1 Post
Tails is an unknown quantity at this point
For validation, this has never let me down:

Code:
<script type="text/javascript">
//<!CDATA[

/*For loops and other things using the less than and greater than sign won't throw you errors now */

//]]>
But for pure XHTML (served as application/xhtml+xml), would it be more preferable for the script type to be application/x-javascript instead?
Tails is offline  
Old 06-06-2005, 01:48 AM   PM User | #30
brothercake
Senior Coder


 
Join Date: Jun 2002
Location: near Oswestry
Posts: 4,508
Thanks: 0
Thanked 0 Times in 0 Posts
brothercake is an unknown quantity at this point
Quote:
Originally Posted by Tails
But for pure XHTML (served as application/xhtml+xml), would it be more preferable for the script type to be application/x-javascript instead?
Surely "text/ecmascript" is technically most correct?
__________________
"Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark
brothercake is offline  
Closed Thread

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 01:37 PM.


Advertisement
Log in to turn off these ads.