SlideShare a Scribd company logo
Escaping Style And Script DataMohamed Fadel Buffon
Hiding from unsupporting browsersMake them believe that the data is inside a comment.For example :<style type="text/css">	<!--	body	{		background: #eee;		color: #000;	}	--></style>
Hiding from unsupporting browsers (Con’t) With the script element, use a single line ECMAScript comment (//) to hide the end token from browsers .For example :<script type="text/javascript">	<!--	function foo ()	{		bar();	}	//--></script>
In HTML, their contents are defined as CDATA, meaning everything from the start of the contents to the next occurrence of the closing token (</ in this case) is considered character data that isn't parsed as markup.Parsing differences between HTML and XHTML
in XHTML their contents are defined as PCDATA, meaning the contents are parsed as markup.If you wish to include <and& characters in your script or style sheet, you will run into problems.Parsing differences between HTML and XHTML (Con’t)
in XHTML, you must mark up a special CDATAsection.So, use the styling or scripting language to comment out the CDATA section markers.Parsing differences between HTML and XHTML (Con’t)
For example:Parsing differences between HTML and XHTML (Con’t)<style type="text/css">	/*<![CDATA[*/		body		{			background: #eee;		}	/*]]>*/</style> <script type="text/javascript">	//<![CDATA[document.title = "Foo & Bar";	//]]></script>
to write XHTML that can also be handled by common HTML user agents as well as old browsers that don't support the styleand scriptelements.Putting the two together<style type="text/css">	<!--/*--><![CDATA[/*><!--*/		body		{			background: #eee;		}	/*]]>*/--></style> <script type="text/javascript">	<!--//--><![CDATA[//><!--document.title = "Foo & Bar";	//--><!]]></script>
Thank YouContact : walk2remember2010@gmail.com

More Related Content

PPTX
Top FME Recipes: Cook’nup XML
PPT
Paragraph, text break and formatting text in MS Frontpage 2003
PPT
PDF
JavaScript Internationalization I18n for Efficient Software Localization
PPT
Why RDFa?
PPS
Quick Referance to WML
PDF
Designing e-Learning Content for Localization
PPT
Sec16.3: Reordering Integration
Top FME Recipes: Cook’nup XML
Paragraph, text break and formatting text in MS Frontpage 2003
JavaScript Internationalization I18n for Efficient Software Localization
Why RDFa?
Quick Referance to WML
Designing e-Learning Content for Localization
Sec16.3: Reordering Integration

Viewers also liked (20)

PPTX
Translationusing moses1
PDF
Summary of Rule-based Reordering Space in Statistical Machine Translation
PDF
7. ebmt based on st sm
PDF
Towards OpenLogos Hybrid Machine Translation - Anabela Barreiro
PPTX
A statistical approach to machine translation
PPT
Assamese to English Statistical Machine Translation
PPTX
Data Localization and Translation
PDF
Going Global? The ABC of Localization-Friendly Content
PPTX
Translation & Localization
PDF
Statistical machine translation in a few slides
PPTX
Machine Translation: Latest Innovations and their Impact on Commercial Transl...
 
PPTX
TAUS OPEN SOURCE MACHINE TRANSLATION SHOWCASE, Paris, Manuel Herranz, Pangean...
PPTX
WEBINAR: TAUS Outlook 2013
PPTX
TAUS webinar The Big Picture View On The Translation Industry, March 2013
PPTX
Localization and globalization in c#
PPT
Localization framework
PPTX
Machine translation with statistical approach
PPT
Statistical machine translation for indian language copy
PDF
TAUS USER CONFERENCE 2010, The Deep Hybrid machine translation engine
PPTX
C#: Globalization and localization
Translationusing moses1
Summary of Rule-based Reordering Space in Statistical Machine Translation
7. ebmt based on st sm
Towards OpenLogos Hybrid Machine Translation - Anabela Barreiro
A statistical approach to machine translation
Assamese to English Statistical Machine Translation
Data Localization and Translation
Going Global? The ABC of Localization-Friendly Content
Translation & Localization
Statistical machine translation in a few slides
Machine Translation: Latest Innovations and their Impact on Commercial Transl...
 
TAUS OPEN SOURCE MACHINE TRANSLATION SHOWCASE, Paris, Manuel Herranz, Pangean...
WEBINAR: TAUS Outlook 2013
TAUS webinar The Big Picture View On The Translation Industry, March 2013
Localization and globalization in c#
Localization framework
Machine translation with statistical approach
Statistical machine translation for indian language copy
TAUS USER CONFERENCE 2010, The Deep Hybrid machine translation engine
C#: Globalization and localization
Ad

Similar to Escaping style and script data (20)

PPT
PPT
ODP
Prabu html
ODP
PPTX
Class2
PPT
Everything You Always Wanted To Know About XML But Were Afraid To Ask
PPT
PPS
PPT
Control Structures In Php 2
PPT
JavaScript
PPT
XML and XSLT
PPT
Java Script
PPT
Inroduction to XSLT with PHP4
PPTX
Kingston University Multimedia Production - Session 2: Layers of technology
PPT
Transforming Xml Data Into Html
PPT
Html for translators
PPT
Lect_html1
PPT
Web Services Part 1
PPT
HTML Fundamentals
Prabu html
Class2
Everything You Always Wanted To Know About XML But Were Afraid To Ask
Control Structures In Php 2
JavaScript
XML and XSLT
Java Script
Inroduction to XSLT with PHP4
Kingston University Multimedia Production - Session 2: Layers of technology
Transforming Xml Data Into Html
Html for translators
Lect_html1
Web Services Part 1
HTML Fundamentals
Ad

Recently uploaded (20)

PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PPTX
Presentation on HIE in infants and its manifestations
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
A systematic review of self-coping strategies used by university students to ...
PPTX
Pharma ospi slides which help in ospi learning
PDF
01-Introduction-to-Information-Management.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Complications of Minimal Access Surgery at WLH
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Lesson notes of climatology university.
PPTX
Cell Structure & Organelles in detailed.
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Presentation on HIE in infants and its manifestations
Chinmaya Tiranga quiz Grand Finale.pdf
Microbial disease of the cardiovascular and lymphatic systems
VCE English Exam - Section C Student Revision Booklet
2.FourierTransform-ShortQuestionswithAnswers.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
A systematic review of self-coping strategies used by university students to ...
Pharma ospi slides which help in ospi learning
01-Introduction-to-Information-Management.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Microbial diseases, their pathogenesis and prophylaxis
Complications of Minimal Access Surgery at WLH
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Lesson notes of climatology university.
Cell Structure & Organelles in detailed.

Escaping style and script data

  • 1. Escaping Style And Script DataMohamed Fadel Buffon
  • 2. Hiding from unsupporting browsersMake them believe that the data is inside a comment.For example :<style type="text/css"> <!-- body { background: #eee; color: #000; } --></style>
  • 3. Hiding from unsupporting browsers (Con’t) With the script element, use a single line ECMAScript comment (//) to hide the end token from browsers .For example :<script type="text/javascript"> <!-- function foo () { bar(); } //--></script>
  • 4. In HTML, their contents are defined as CDATA, meaning everything from the start of the contents to the next occurrence of the closing token (</ in this case) is considered character data that isn't parsed as markup.Parsing differences between HTML and XHTML
  • 5. in XHTML their contents are defined as PCDATA, meaning the contents are parsed as markup.If you wish to include <and& characters in your script or style sheet, you will run into problems.Parsing differences between HTML and XHTML (Con’t)
  • 6. in XHTML, you must mark up a special CDATAsection.So, use the styling or scripting language to comment out the CDATA section markers.Parsing differences between HTML and XHTML (Con’t)
  • 7. For example:Parsing differences between HTML and XHTML (Con’t)<style type="text/css"> /*<![CDATA[*/ body { background: #eee; } /*]]>*/</style> <script type="text/javascript"> //<![CDATA[document.title = "Foo & Bar"; //]]></script>
  • 8. to write XHTML that can also be handled by common HTML user agents as well as old browsers that don't support the styleand scriptelements.Putting the two together<style type="text/css"> <!--/*--><![CDATA[/*><!--*/ body { background: #eee; } /*]]>*/--></style> <script type="text/javascript"> <!--//--><![CDATA[//><!--document.title = "Foo & Bar"; //--><!]]></script>
  • 9. Thank YouContact : walk2remember2010@gmail.com