SlideShare una empresa de Scribd logo
1 de 56
Introduction to XML Svetlin Nakov Bulgarian Association of Software Developers www.devbg.org
Contents ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What is XML
What is XML? ,[object Object],[object Object],[object Object],[object Object]
What is XML? (2) ,[object Object],[object Object]
XML - Example <?xml version=&quot;1.0&quot;?> <library name=&quot;.NET Developer's Library&quot;> <book> <title>Programming Microsoft .NET</title> <author>Jeff Prosise</author> <isbn>0-7356-1376-1</isbn> </book> <book> <title>Microsoft .NET for Programmers</title> <author>Fergal Grimes</author> <isbn>1-930110-19-7</isbn> </book> </library>
XML  –  Example <?xml version=&quot;1.0&quot;?> <library  name=&quot;.NET Developer's Library&quot; > <book> <title>Programming Microsoft .NET</title> <author>Jeff Prosise</author> <isbn>0-7356-1376-1</isbn> </book> <book> <title>Microsoft   .NET for Programmers</title> <author>Fergal Grimes</author> <isbn> 1-930110-19-7 </isbn> </book> </library> attribute header part  ( prolog ) element closing tag element value opening tag
XML   and HTML ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Well-Formed Documents ,[object Object],[object Object],[object Object],[object Object],[object Object]
Well-Formed Documents (2) ,[object Object],< xml> <button bug! value=&quot;OK name=&quot;b1&quot;> <animation source=&quot;demo1.avi&quot;>  1 < 2 < 3 </click-button> < / xml >
When to Use   XML? ,[object Object],[object Object],[object Object],[object Object],[object Object]
XML Disadvantages ,[object Object],[object Object],[object Object],[object Object],[object Object]
Namespaces
Namespaces ,[object Object],<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> <country:towns xmlns:country=&quot;urn:nakov-com:country&quot; xmlns:town=&quot;http:// www. nakov.com/town&quot;> <town:town> <town:name> Sofia </town:name> <town:population>1 200 000</town:population> <country:name> Bulgaria </country:name> </town:town> <town:town> <town:name>Plovdiv</town:name> <town:population>700 000</town:population> <country:name>Bulgaria</country:name> </town:town> </country:towns>
Namespaces - Example <?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> <country:towns  xmlns:country=&quot;urn:nakov-com:country&quot; xmlns:town=&quot;http:// www. nakov.com/town&quot;> <town:town> <town:name>Sofia</town:name> <town:population>1 200 000</town:population> <country:name>Bulgaria</country:name> </town:town> <town:town> <town:name>Plovdiv</town:name> <town:population>700 000</town:population> <country:name> Bulgaria </country:name> </town:town> </country:towns> Namespace with prefix  &quot; country &quot;  and  URI  identifier  &quot; urn:nakov-com:country &quot; Tag with name  &quot; name &quot;  from namespace  &quot; country &quot;,  the full name is  &quot; urn:nakov-com:country:name &quot;
Namespaces (2) ,[object Object],<?xml version=&quot;1.0&quot; encoding=&quot;windows-1251&quot;?> <order  xmlns=&quot;http://www.hranitelni-stoki.com/orders&quot; > <item> <name>бира &quot;Загорка&quot;</name> <ammount> 8 </ammount> <measure>бутилка</measure> <price> 3 . 76 </price> </item> <item> <name>кебапчета</name> <ammount>12</ammount> <measure>брой</measure> <price> 4.20 </price> </item> </order>
XML Schemes and Validation
Schemes and Validation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The   DTD Language ,[object Object],[object Object],[object Object],[object Object],[object Object]
The   DTD Language (2) ,[object Object],<!ELEMENT library (book+)> <!ATTLIST library name CDATA #REQUIRED > <!ELEMENT book (title, author, isbn)> <!ELEMENT title (#PCDATA)> <!ELEMENT author (#PCDATA)> <!ELEMENT  isbn  (#PCDATA)>
XSD Schemes ,[object Object],[object Object],[object Object],[object Object],[object Object]
XSD Scheme Example <?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> <xs:schema   xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;> <xs:element name=&quot;library&quot;> <xs:complexType> <xs:sequence> <xs:element ref=&quot;book&quot; maxOccurs=&quot;unbounded&quot;/> </xs:sequence> <xs:attribute name=&quot;name&quot; type=&quot;xs:string&quot;   use=&quot;optional&quot;/> </xs:complexType> </xs:element>   (the example continues)
XSD Scheme Example (2) <xs:element name=&quot;book&quot;> <xs:complexType> <xs:sequence> <xs:element ref=&quot;title&quot;/> <xs:element ref=&quot;author&quot;/> <xs:element ref=&quot;isbn&quot;/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name=&quot;title&quot; type=&quot;xs:string&quot;/> <xs:element name=&quot;author&quot; type=&quot;xs:string&quot;/> <xs:element name=&quot;isbn&quot; type=&quot;xs:string&quot;/> </xs:schema>
XPath
XPath ,[object Object],[object Object],[object Object],[object Object],/library/book[isbn= ' 1-930110-19-7 ' ] /catalog/cd[ @ price < 10.80]
XPath   Expressions ,[object Object],[object Object],[object Object],[object Object],[object Object]
XSL
XSL for Cross - Media Publishing PDF as  digital preprint HTML a s  standard  I nternet  F ormat For Online  P ublishing Author writes in text  processing system using style sheets System saves as/ converts to XML <XML-Document> Catalogue entry MARC-Format Library catalogue XSLT-Stylesheet XSLT-Stylesheet XSLT-Stylesheet
XSL Transformation Language (XSLT)
What is XSLT? ,[object Object],[object Object],[object Object],[object Object]
XSL/XSLT Capabilities  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Browsers Support ,[object Object],[object Object],[object Object],[object Object],[object Object]
Simple XML <?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?> <catalog> <cd> <title> Evergreens </title> <artist></artist> <country>USA</country> <company> USA Music Enterprise </company> <price>1 2 . 0 0</price> <year>198 0 </year>  </cd> . . .  </catalog>  First we have a XML document catalog.xml
Create an XSL Style Sheet <?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?> <xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;> <xsl:template match=&quot;/&quot;> <html> <body> <h2>My CD Collection</h2> <xsl:for-each select=&quot;catalog/cd&quot;> <br/> <xsl:value-of select=&quot;title&quot;/> <xsl:value-of select=&quot;artist&quot;/> </xsl:for-each> </body> </html> </xsl:template> </xsl:stylesheet> Then  create an XSL Style Sheet  ( cdc.xsl )
Link the XSL Style Sheet to the XML Document ,[object Object],[object Object],<?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?> <?xml-stylesheet type=&quot;text/xsl&quot;  href=&quot;cdc.xsl&quot;?> <catalog> ... </catalog>
Output Format Control <xsl:stylesheet xmlns:xsl= . . .> <xsl:output method= &quot; html &quot;   encoding= &quot; UTF-8 &quot;  … /> <xsl:template  match = &quot; / &quot; > <HTML>…</HTML> </xsl:template> </xsl:stylesheet> ,[object Object],[object Object],[object Object]
XSLT Specification ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Template Element ,[object Object],[object Object],[object Object],<xsl:template match=&quot;/&quot;>   … </xsl:template>
Import Element ,[object Object],<stylesheet … >   < import  href=&quot;tables.xsl&quot;/>   < import  href=&quot;features.xsl&quot;>   <template … > … </template>   …  </stylesheet>
The <xsl:value-of> Element ,[object Object],Note: The value of the  select  attribute  is an XPath expression  ... <xsl:value-of select=&quot;catalog/cd/title&quot;/> <xsl:value-of select=&quot;catalog/cd/artist&quot;/> ...
The <xsl:for-each> Element ,[object Object],Note: The value of the  select  attribute  is an XPath expression  ... <h2>My CD Collection</h2> <xsl:for-each select=&quot;catalog/cd&quot;> <br/> <xsl:value-of select=&quot;title&quot;/> <xsl:value-of select=&quot;artist&quot;/> </xsl:for-each> </body> ...
The <xsl:for-each> Element  Filter output ,[object Object],<xsl:for-each select=&quot;catalog/cd[artist='Bob  Dylan ']&quot;>  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
XSLT <xsl:sort> Element ,[object Object],[object Object],Note: The  select   attribute indicates what XML element to sort on <h2>My CD Collection</h2> <xsl:for-each select=&quot;catalog/cd&quot;> <xsl:sort select=&quot;artist&quot;/> <br/> <xsl:value-of select=&quot;title&quot;/> <xsl:value-of select=&quot;artist&quot;/> </xsl:for-each> </body>
Sort Element Properties ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],<xsl:sort select=&quot; product/price &quot; data-type=&quot;number&quot; order=&quot;descending&quot; />
The <xsl:if> Element ,[object Object],Note:  The value of the required test attribute contains the expression to be evaluated <h2>My CD Collection</h2> <xsl:for-each select=&quot;catalog/cd&quot;> <xsl:if test=&quot;price &gt; 10&quot;>   <br/> <xsl:value-of select=&quot;title&quot;/> <xsl:value-of select=&quot;artist&quot;/> </xsl:if> </xsl:for-each> </body>
The <xsl:choose> Element ,[object Object],[object Object],[object Object],<xsl:choose> <xsl:when test=&quot;XPath  expression &quot;>  ... some output ...  </xsl:when> <xsl:otherwise>   ... some output ....  </xsl:otherwise> </xsl:choose>
The  <xsl:apply-templates>   Element ,[object Object],[object Object],Note:  The value of the required  select  attribute is a XPath expression <xsl:template match=&quot;cd&quot;> <p> <xsl:apply-templates select=&quot;title&quot;/> </p> </xsl:template> <xsl:template  match=&quot;title&quot; >  Title:  <xsl:value-of select=&quot;.&quot;/> <br />  </xsl:template>
Variable Element ,[object Object],[object Object],[object Object],[object Object]
Reusing Templates ,[object Object],//   A named template called by call-template <xsl:template  name=&quot;CreateHeader&quot; >   <html:hr/>   <html:h2>***<xsl:apply-templates/>***</html:h2>   <html:hr/> </xsl:template> ... <xsl:template match=&quot;title&quot;>   < xsl:call-template  name=&quot;CreateHeader&quot; /> </xsl:template> <xsl:template match=&quot;head&quot;>   < xsl:call-template  name=”CreateHeader&quot; /> </xsl:template>
Attribute Values ,[object Object],[object Object],<full-name first=&quot;John&quot; second=&quot;Smith&quot;/> ----------------------------------------- <xsl:template match=&quot;full-name&quot;>   <ajr:person>   <xsl:value-of  select=&quot;@first&quot; >    <xsl:value-of  select=&quot;@second&quot; >   </ajr:person>   <ajr:person name=&quot;{@first} {@second}&quot; /> </xsl:template> ----------------------------------------- <ajr:person>John Smith</ajr:person> <ajr:person name=&quot;John Smith&quot;/>
Creating Elements ,[object Object],[object Object],<xsl:template match= &quot; name &quot; > <xsl:element name= &quot; {.}&quot;>   Nice person!   </xsl:element> </xsl:template> <name>Gosho</name Input <Gosho> Nice person! </Gosho> Result
XSLT Live Demo
Introduction to XML ,[object Object]
Exercises ,[object Object],[object Object],[object Object]
Exercises (2) ,[object Object],[object Object],[object Object],[object Object]
Exercises (3) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Más contenido relacionado

La actualidad más candente (20)

XML
XMLXML
XML
 
XML
XMLXML
XML
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Xml
XmlXml
Xml
 
Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xml
 
XML
XMLXML
XML
 
Xml
XmlXml
Xml
 
XML-Extensible Markup Language
XML-Extensible Markup Language XML-Extensible Markup Language
XML-Extensible Markup Language
 
Extensible Markup Language (XML)
Extensible Markup Language (XML)Extensible Markup Language (XML)
Extensible Markup Language (XML)
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Basic xml syntax
Basic xml syntaxBasic xml syntax
Basic xml syntax
 
Xml tutorial
Xml tutorialXml tutorial
Xml tutorial
 
XML, DTD & XSD Overview
XML, DTD & XSD OverviewXML, DTD & XSD Overview
XML, DTD & XSD Overview
 
Intro xml
Intro xmlIntro xml
Intro xml
 
Xml ppt
Xml pptXml ppt
Xml ppt
 
Xml presentation
Xml presentationXml presentation
Xml presentation
 
01 Xml Begin
01 Xml Begin01 Xml Begin
01 Xml Begin
 
uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2
 
XML
XMLXML
XML
 
Basic XML
Basic XMLBasic XML
Basic XML
 

Destacado

Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XMLyht4ever
 
10. XML in DBMS
10. XML in DBMS10. XML in DBMS
10. XML in DBMSkoolkampus
 
Xml Publisher And Reporting To Excel
Xml Publisher And Reporting To ExcelXml Publisher And Reporting To Excel
Xml Publisher And Reporting To ExcelDuncan Davies
 
Webservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and RESTWebservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and RESTPradeep Kumar
 
Xs path navigation on xml schemas made easy
Xs path navigation on xml schemas made easy Xs path navigation on xml schemas made easy
Xs path navigation on xml schemas made easy Adz91 Digital Ads Pvt Ltd
 
IEEE 2014 JAVA DATA MINING PROJECTS Xs path navigation on xml schemas made easy
IEEE 2014 JAVA DATA MINING PROJECTS Xs path navigation on xml schemas made easyIEEE 2014 JAVA DATA MINING PROJECTS Xs path navigation on xml schemas made easy
IEEE 2014 JAVA DATA MINING PROJECTS Xs path navigation on xml schemas made easyIEEEFINALYEARSTUDENTPROJECTS
 
eXtensible Markup Language
eXtensible Markup LanguageeXtensible Markup Language
eXtensible Markup LanguageAditya Raj
 
XPath - XML Path Language
XPath - XML Path LanguageXPath - XML Path Language
XPath - XML Path Languageyht4ever
 
XML.ppt
XML.pptXML.ppt
XML.pptbutest
 
Java API for XML Web Services (JAX-WS)
Java API for XML Web Services (JAX-WS)Java API for XML Web Services (JAX-WS)
Java API for XML Web Services (JAX-WS)Peter R. Egli
 

Destacado (17)

Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Xml
XmlXml
Xml
 
10. XML in DBMS
10. XML in DBMS10. XML in DBMS
10. XML in DBMS
 
Lecture #2 xml
Lecture #2 xmlLecture #2 xml
Lecture #2 xml
 
Xml Publisher And Reporting To Excel
Xml Publisher And Reporting To ExcelXml Publisher And Reporting To Excel
Xml Publisher And Reporting To Excel
 
Webservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and RESTWebservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and REST
 
Xs path navigation on xml schemas made easy
Xs path navigation on xml schemas made easy Xs path navigation on xml schemas made easy
Xs path navigation on xml schemas made easy
 
IEEE 2014 JAVA DATA MINING PROJECTS Xs path navigation on xml schemas made easy
IEEE 2014 JAVA DATA MINING PROJECTS Xs path navigation on xml schemas made easyIEEE 2014 JAVA DATA MINING PROJECTS Xs path navigation on xml schemas made easy
IEEE 2014 JAVA DATA MINING PROJECTS Xs path navigation on xml schemas made easy
 
eXtensible Markup Language
eXtensible Markup LanguageeXtensible Markup Language
eXtensible Markup Language
 
Session 1
Session 1Session 1
Session 1
 
Xpath presentation
Xpath presentationXpath presentation
Xpath presentation
 
XPath - XML Path Language
XPath - XML Path LanguageXPath - XML Path Language
XPath - XML Path Language
 
XML
XMLXML
XML
 
Java XML Parsing
Java XML ParsingJava XML Parsing
Java XML Parsing
 
XML.ppt
XML.pptXML.ppt
XML.ppt
 
Xml dtd
Xml dtdXml dtd
Xml dtd
 
Java API for XML Web Services (JAX-WS)
Java API for XML Web Services (JAX-WS)Java API for XML Web Services (JAX-WS)
Java API for XML Web Services (JAX-WS)
 

Similar a XML INTRODUCTION

Inroduction to XSLT with PHP4
Inroduction to XSLT with PHP4Inroduction to XSLT with PHP4
Inroduction to XSLT with PHP4Stephan Schmidt
 
Intro XML for archivists (2011)
Intro XML for archivists (2011)Intro XML for archivists (2011)
Intro XML for archivists (2011)Jane Stevenson
 
Extensible Stylesheet Language
Extensible Stylesheet LanguageExtensible Stylesheet Language
Extensible Stylesheet LanguageJussi Pohjolainen
 
XML Transformations With PHP
XML Transformations With PHPXML Transformations With PHP
XML Transformations With PHPStephan Schmidt
 
Transforming Xml Data Into Html
Transforming Xml Data Into HtmlTransforming Xml Data Into Html
Transforming Xml Data Into HtmlKarthikeyan Mkr
 
Introduction To Xml
Introduction To XmlIntroduction To Xml
Introduction To Xmlbdebruin
 
3 xml namespaces and xml schema
3   xml namespaces and xml schema3   xml namespaces and xml schema
3 xml namespaces and xml schemagauravashq
 
Architecting Web Services
Architecting Web ServicesArchitecting Web Services
Architecting Web ServicesLorna Mitchell
 
Php Simple Xml
Php Simple XmlPhp Simple Xml
Php Simple Xmlmussawir20
 
Digital + Container List
Digital + Container ListDigital + Container List
Digital + Container Listguest53eac8
 
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 AskRichard Davis
 

Similar a XML INTRODUCTION (20)

Inroduction to XSLT with PHP4
Inroduction to XSLT with PHP4Inroduction to XSLT with PHP4
Inroduction to XSLT with PHP4
 
XMLT
XMLTXMLT
XMLT
 
Intro XML for archivists (2011)
Intro XML for archivists (2011)Intro XML for archivists (2011)
Intro XML for archivists (2011)
 
XML and XSLT
XML and XSLTXML and XSLT
XML and XSLT
 
Xml
XmlXml
Xml
 
About XML
About XMLAbout XML
About XML
 
Extensible Stylesheet Language
Extensible Stylesheet LanguageExtensible Stylesheet Language
Extensible Stylesheet Language
 
Processing XML with Java
Processing XML with JavaProcessing XML with Java
Processing XML with Java
 
XML Transformations With PHP
XML Transformations With PHPXML Transformations With PHP
XML Transformations With PHP
 
Transforming Xml Data Into Html
Transforming Xml Data Into HtmlTransforming Xml Data Into Html
Transforming Xml Data Into Html
 
Introduction To Xml
Introduction To XmlIntroduction To Xml
Introduction To Xml
 
Sax Dom Tutorial
Sax Dom TutorialSax Dom Tutorial
Sax Dom Tutorial
 
3 xml namespaces and xml schema
3   xml namespaces and xml schema3   xml namespaces and xml schema
3 xml namespaces and xml schema
 
Xml
XmlXml
Xml
 
Architecting Web Services
Architecting Web ServicesArchitecting Web Services
Architecting Web Services
 
Xml Schema
Xml SchemaXml Schema
Xml Schema
 
Xml
XmlXml
Xml
 
Php Simple Xml
Php Simple XmlPhp Simple Xml
Php Simple Xml
 
Digital + Container List
Digital + Container ListDigital + Container List
Digital + Container List
 
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
 

Más de BG Java EE Course (20)

Rich faces
Rich facesRich faces
Rich faces
 
JSP Custom Tags
JSP Custom TagsJSP Custom Tags
JSP Custom Tags
 
Java Server Faces (JSF) - advanced
Java Server Faces (JSF) - advancedJava Server Faces (JSF) - advanced
Java Server Faces (JSF) - advanced
 
Java Server Faces (JSF) - Basics
Java Server Faces (JSF) - BasicsJava Server Faces (JSF) - Basics
Java Server Faces (JSF) - Basics
 
JSTL
JSTLJSTL
JSTL
 
Unified Expression Language
Unified Expression LanguageUnified Expression Language
Unified Expression Language
 
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
 
Web Applications and Deployment
Web Applications and DeploymentWeb Applications and Deployment
Web Applications and Deployment
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
CSS
CSSCSS
CSS
 
HTML: Tables and Forms
HTML: Tables and FormsHTML: Tables and Forms
HTML: Tables and Forms
 
HTML Fundamentals
HTML FundamentalsHTML Fundamentals
HTML Fundamentals
 
WWW and HTTP
WWW and HTTPWWW and HTTP
WWW and HTTP
 
JavaScript and jQuery Fundamentals
JavaScript and jQuery FundamentalsJavaScript and jQuery Fundamentals
JavaScript and jQuery Fundamentals
 
Creating Web Sites with HTML and CSS
Creating Web Sites with HTML and CSSCreating Web Sites with HTML and CSS
Creating Web Sites with HTML and CSS
 
Data Access with JDBC
Data Access with JDBCData Access with JDBC
Data Access with JDBC
 
Introduction to-sql
Introduction to-sqlIntroduction to-sql
Introduction to-sql
 
Introduction to-RDBMS-systems
Introduction to-RDBMS-systemsIntroduction to-RDBMS-systems
Introduction to-RDBMS-systems
 
Basic data-structures-v.1.1
Basic data-structures-v.1.1Basic data-structures-v.1.1
Basic data-structures-v.1.1
 
Basic input-output-v.1.1
Basic input-output-v.1.1Basic input-output-v.1.1
Basic input-output-v.1.1
 

Último

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 

Último (20)

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 

XML INTRODUCTION

  • 1. Introduction to XML Svetlin Nakov Bulgarian Association of Software Developers www.devbg.org
  • 2.
  • 4.
  • 5.
  • 6. XML - Example <?xml version=&quot;1.0&quot;?> <library name=&quot;.NET Developer's Library&quot;> <book> <title>Programming Microsoft .NET</title> <author>Jeff Prosise</author> <isbn>0-7356-1376-1</isbn> </book> <book> <title>Microsoft .NET for Programmers</title> <author>Fergal Grimes</author> <isbn>1-930110-19-7</isbn> </book> </library>
  • 7. XML – Example <?xml version=&quot;1.0&quot;?> <library name=&quot;.NET Developer's Library&quot; > <book> <title>Programming Microsoft .NET</title> <author>Jeff Prosise</author> <isbn>0-7356-1376-1</isbn> </book> <book> <title>Microsoft .NET for Programmers</title> <author>Fergal Grimes</author> <isbn> 1-930110-19-7 </isbn> </book> </library> attribute header part ( prolog ) element closing tag element value opening tag
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 14.
  • 15. Namespaces - Example <?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> <country:towns xmlns:country=&quot;urn:nakov-com:country&quot; xmlns:town=&quot;http:// www. nakov.com/town&quot;> <town:town> <town:name>Sofia</town:name> <town:population>1 200 000</town:population> <country:name>Bulgaria</country:name> </town:town> <town:town> <town:name>Plovdiv</town:name> <town:population>700 000</town:population> <country:name> Bulgaria </country:name> </town:town> </country:towns> Namespace with prefix &quot; country &quot; and URI identifier &quot; urn:nakov-com:country &quot; Tag with name &quot; name &quot; from namespace &quot; country &quot;, the full name is &quot; urn:nakov-com:country:name &quot;
  • 16.
  • 17. XML Schemes and Validation
  • 18.
  • 19.
  • 20.
  • 21.
  • 22. XSD Scheme Example <?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> <xs:schema xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;> <xs:element name=&quot;library&quot;> <xs:complexType> <xs:sequence> <xs:element ref=&quot;book&quot; maxOccurs=&quot;unbounded&quot;/> </xs:sequence> <xs:attribute name=&quot;name&quot; type=&quot;xs:string&quot; use=&quot;optional&quot;/> </xs:complexType> </xs:element> (the example continues)
  • 23. XSD Scheme Example (2) <xs:element name=&quot;book&quot;> <xs:complexType> <xs:sequence> <xs:element ref=&quot;title&quot;/> <xs:element ref=&quot;author&quot;/> <xs:element ref=&quot;isbn&quot;/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name=&quot;title&quot; type=&quot;xs:string&quot;/> <xs:element name=&quot;author&quot; type=&quot;xs:string&quot;/> <xs:element name=&quot;isbn&quot; type=&quot;xs:string&quot;/> </xs:schema>
  • 24. XPath
  • 25.
  • 26.
  • 27. XSL
  • 28. XSL for Cross - Media Publishing PDF as digital preprint HTML a s standard I nternet F ormat For Online P ublishing Author writes in text processing system using style sheets System saves as/ converts to XML <XML-Document> Catalogue entry MARC-Format Library catalogue XSLT-Stylesheet XSLT-Stylesheet XSLT-Stylesheet
  • 30.
  • 31.
  • 32.
  • 33. Simple XML <?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?> <catalog> <cd> <title> Evergreens </title> <artist></artist> <country>USA</country> <company> USA Music Enterprise </company> <price>1 2 . 0 0</price> <year>198 0 </year> </cd> . . . </catalog> First we have a XML document catalog.xml
  • 34. Create an XSL Style Sheet <?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?> <xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;> <xsl:template match=&quot;/&quot;> <html> <body> <h2>My CD Collection</h2> <xsl:for-each select=&quot;catalog/cd&quot;> <br/> <xsl:value-of select=&quot;title&quot;/> <xsl:value-of select=&quot;artist&quot;/> </xsl:for-each> </body> </html> </xsl:template> </xsl:stylesheet> Then create an XSL Style Sheet ( cdc.xsl )
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 53.
  • 54.
  • 55.
  • 56.

Notas del editor

  1. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  2. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  3. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  4. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  5. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  6. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  7. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  8. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  9. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  10. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ## XSLT is the most important part of XSL. XSLT is used to transform an XML document into another XML document, or another type of document that is recognized by a browser, like HTML and XHTML. Normally XSLT does this by transforming each XML element into an (X)HTML element. With XSLT you can add/remove elements and attributes to or from the output file. You can also rearrange and sort elements, perform tests and make decisions about which elements to hide and display, and a lot more. A common way to describe the transformation process is to say that XSLT transforms an XML source-tree into an XML result-tree . In the transformation process, XSLT uses XPath to define parts of the source document that should match one or more predefined templates. When a match is found, XSLT will transform the matching part of the source document into the result document.
  11. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  12. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  13. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  14. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  15. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  16. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ## Output Format Control &lt;xsl:output&gt; has a large number of attributes that control the way the result document is produced, including generation of true HTML rather than XHTML output. For an XML document, this feature allows authors fairly explicit control over the contents of the result document XML declaration, the DOCTYPE declaration, use of CDATA sections, and so on. Specifying html for the method causes the XSLT processor to produce conventional HTML as output text instead of XHTML. Specifying text causes the output to consist only of element text content, concatenated together.
  17. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  18. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  19. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  20. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  21. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  22. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  23. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  24. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  25. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  26. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  27. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  28. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  29. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  30. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  31. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  32. (c) 2007 National Academy for Software Development - http://academy.devbg.org All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##