SlideShare una empresa de Scribd logo
1 de 9
Escaping Style And Script Data Mohamed Fadel Buffon
Hiding from unsupporting browsers Make 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 You Contact : walk2remember2010@gmail.com

Más contenido relacionado

Destacado

Localization and globalization in c#
Localization and globalization in c#Localization and globalization in c#
Localization and globalization in c#
PaYal Umraliya
 
Machine translation with statistical approach
Machine translation with statistical approachMachine translation with statistical approach
Machine translation with statistical approach
vini89
 

Destacado (20)

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

Similar a Escaping style and script data

Kingston University Multimedia Production - Session 2: Layers of technology
Kingston University Multimedia Production - Session 2: Layers of technologyKingston University Multimedia Production - Session 2: Layers of technology
Kingston University Multimedia Production - Session 2: Layers of technology
petter
 
Web Services Part 1
Web Services Part 1Web Services Part 1
Web Services Part 1
patinijava
 

Similar a Escaping style and script data (20)

Intr To Html & Xhtml
Intr To Html & XhtmlIntr To Html & Xhtml
Intr To Html & Xhtml
 
HTML
HTMLHTML
HTML
 
About XML
About XMLAbout XML
About XML
 
Prabu html
Prabu htmlPrabu html
Prabu html
 
Tags in html
Tags in htmlTags in html
Tags in html
 
Class2
Class2Class2
Class2
 
Everything You Always Wanted To Know About XML But Were Afraid To Ask
Everything You Always Wanted To Know About XML But Were Afraid To AskEverything You Always Wanted To Know About XML But Were Afraid To Ask
Everything You Always Wanted To Know About XML But Were Afraid To Ask
 
Xml
XmlXml
Xml
 
Web Designing
Web DesigningWeb Designing
Web Designing
 
Control Structures In Php 2
Control Structures In Php 2Control Structures In Php 2
Control Structures In Php 2
 
JavaScript
JavaScriptJavaScript
JavaScript
 
XML and XSLT
XML and XSLTXML and XSLT
XML and XSLT
 
Java Script
Java ScriptJava Script
Java Script
 
Inroduction to XSLT with PHP4
Inroduction to XSLT with PHP4Inroduction to XSLT with PHP4
Inroduction to XSLT with PHP4
 
Kingston University Multimedia Production - Session 2: Layers of technology
Kingston University Multimedia Production - Session 2: Layers of technologyKingston University Multimedia Production - Session 2: Layers of technology
Kingston University Multimedia Production - Session 2: Layers of technology
 
Transforming Xml Data Into Html
Transforming Xml Data Into HtmlTransforming Xml Data Into Html
Transforming Xml Data Into Html
 
Html for translators
Html for translatorsHtml for translators
Html for translators
 
Lect_html1
Lect_html1Lect_html1
Lect_html1
 
Web Services Part 1
Web Services Part 1Web Services Part 1
Web Services Part 1
 
HTML Fundamentals
HTML FundamentalsHTML Fundamentals
HTML Fundamentals
 

Último

Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Último (20)

Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 

Escaping style and script data

  • 1. Escaping Style And Script Data Mohamed Fadel Buffon
  • 2. Hiding from unsupporting browsers Make 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 You Contact : walk2remember2010@gmail.com