DHTML Forum  

Go Back   DHTML Forum > dhtmlcentral.com > Off-topic
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02.02.2004, 15:10
Syedur Syedur is offline
Erfahrener Benutzer
 
Join Date: 12.05.2001
Location: USA
Posts: 347
Default

Okay, I got a simple question about XHTML validation. If I code something on a webpage and it has no error on XHTML 1.0 on tags and everything else but it will throw errors because of the contents that may contain special characters like... '/"/&/</>/%/ those XHTML requires you to do it with * and such, right? But, what if the content is dynamic and it is being generated via something else; server side and such. what do I do then?

Some pages will be XHTML 1.0 validated; some won't.

Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 02.02.2004, 15:56
Abhi Abhi is offline
Erfahrener Benutzer
 
Join Date: 13.07.2001
Location: India
Posts: 1.626
Default

That is a prob w/ xhtml. & (& nbsp is such a pain..

You could you a function to change the commonly used characters into their long forms and then send the output to the client...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 02.02.2004, 16:09
Syedur Syedur is offline
Erfahrener Benutzer
 
Join Date: 12.05.2001
Location: USA
Posts: 347
Default

<blockquote id="quote"><span class="smalltext" id="quote">quote:<hr id="quote">Originally posted by Abhi

That is a prob w/ xhtml. & (& nbsp is such a pain..

You could you a function to change the commonly used characters into their long forms and then send the output to the client...
<hr id="quote"></blockquote id="quote"></span id="quote">

do you have one for PHP? or anyone else?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 02.02.2004, 18:59
Abhi Abhi is offline
Erfahrener Benutzer
 
Join Date: 13.07.2001
Location: India
Posts: 1.626
Default

something like this:

<%
function format(str) {
return String( str ).split('&').join('*');
}


while( !rs.eof ) {
Response.Write( format( rs("sLog").value ) );
rs.movenext();
}
%>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 02.02.2004, 19:03
Abhi Abhi is offline
Erfahrener Benutzer
 
Join Date: 13.07.2001
Location: India
Posts: 1.626
Default

ok the space in the join is a & nbsp;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 02.02.2004, 22:13
Tim Scarfe Tim Scarfe is offline
Erfahrener Benutzer
 
Join Date: 14.05.2001
Location: United Kingdom
Posts: 1.015
Default

You could just use HTML.

--
Regards,
Tim Scarfe <tim@developer-x.com>
http://www.developer-x.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7  
Old 03.02.2004, 10:35
Chris Chris is offline
Erfahrener Benutzer
 
Join Date: 26.10.2001
Location: United Kingdom
Posts: 1.898
Default

bingo.

[url="http://chrispoole.com"]Chris[/url:7k9fhkxvdz]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8  
Old 03.02.2004, 15:17
hzr hzr is offline
Erfahrener Benutzer
 
Join Date: 16.07.2001
Location: Sweden
Posts: 1.110
Default

<blockquote id="quote"><span class="smalltext" id="quote">quote:<hr id="quote">You could just use HTML.<hr id="quote"></blockquote id="quote"></span id="quote">
How would that help? If I understand Syedur right, he's having problems with '&' and '<' which has to be encoded as e.g. &amp; and &lt; repectively. But this has to be done in HTML too.

<font face="Courier New">--
David</font id="Courier New">
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9  
Old 04.02.2004, 01:29
Syedur Syedur is offline
Erfahrener Benutzer
 
Join Date: 12.05.2001
Location: USA
Posts: 347
Default

Agreed with David!

I am not trying to change anything but trying to extract some &, " and ' quotes into long format HTML. So, when the page is being valid by XHTML 1.0 validation.

Abhi, thanks but your script isn't working...
maybe I just need some direction on using it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10  
Old 04.02.2004, 02:59
Abhi Abhi is offline
Erfahrener Benutzer
 
Join Date: 13.07.2001
Location: India
Posts: 1.626
Default

It should this does,

var txt = "abhi & me";

function format( s ) {
return String( s ).split('&').join('*'); // you'll see a space in the join argument, thats is an &nbs p;
}

format( txt );
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Forum Jump

All times are GMT +2. The time now is 03:50.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.