XML/XSLT Aravinda.J
Contents Introduction to XML XML in web application Java Parsers  XSLT XSLT:FO Examples Usage of XML,XSLT,XSLT:FO in EDI
XML What is XML? XML stands for E X tensible  M arkup  L anguage  XML is a  markup language  much like HTML  XML was designed to  describe data   XML tags are not predefined. You must  define your own tags   XML uses a  Document Type Definition  (DTD) or an  XML Schema  to describe the data  XML was designed to store, carry, and exchange data. XML was not designed to display data.
The main difference between  XML and HTML XML is not a replacement for HTML. XML and HTML were designed with different goals: XML was designed to describe data and to focus on what data is. HTML was designed to display data and to focus on how data looks.
The following example is a note to Tove from Jani, stored as XML: <?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?>  <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note>
How can XML be Used? It is important to understand that XML was designed to store, carry, and exchange data. XML was not designed to display data. With XML, your data is stored outside your HTML. With XML, data can be exchanged between incompatible systems.
XML and B2B With XML, financial information can be exchanged over the Internet. XML can be used to Share Data XML can be used to Store Data XML is the mother of WAP and WML. The Wireless Markup Language (WML), used to markup Internet applications for handheld devices like mobile phones, is written in XML.
XML Syntax The syntax rules of XML are very simple and very strict. The rules are very easy to learn, and very easy to use. The first line in the document - the XML declaration - defines the XML version and the character encoding used in the document. In this case the document conforms to the 1.0 specification of XML and uses the ISO-8859-1 (Latin-1/West European) character set.  The next line describes the root element of the document (like it was saying: &quot;this document is a note&quot;):
XML SYNTAX All XML elements must have a closing tag XML tags are case sensitive All XML elements must be properly nested All XML documents must have a root element Attribute values must always be quoted
DISPLAYING XML CONTENT THROUGH XSL/JAVA/CSS XSL stands for e X tensible  S tylesheet  L anguage. The World Wide Web Consortium (W3C) started to develop XSL because there was a need for an XML based Stylesheet Language.  XML does not use predefined tags (we can use any tags we like) and the meanings of these tags are  not well understood . The <table> could mean an HTML table or a piece of furniture, and a browser  does not know how to display it . There must be something in addition to the XML document that describes how the document should be displayed; and that is XSL!
XSLT Demonstration XML Doc XML Processor (xsltproc) XSLT Stylesheet PDF XML HTML
XSL - More Than a Style Sheet Language XSLT is a language for transforming XML documents  Think of XSL as a set of languages that can  transform  XML into XHTML,  filter and sort  XML data,  define parts  of an XML document,  format  XML data based on the data value, like displaying negative numbers in red, and  output  XML data to different media, like screens, paper, or voice.  XPath is a language for defining parts of an XML document  XSL-FO is a language for formatting XML documents
WORKING OF XSLT XSLT Uses XPath XSLT uses XPath to define the matching patterns for transformations. If you want to study XPath first, please read our  XPath Tutorial . How does it Work? In the transformation process, XSLT uses XPath to define parts of the source document that  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. The parts of the source document that do not match a template will end up unmodified in the result document.
Examples: cdcatalog.xml cdcatalog.xsl
Elements in XSLT apply-imports   apply-templates   call-template   choose   decimal-format   for-each   if   otherwise   value-of
Inherited XPath Functions   count()  –Returns the no of nodes substring()  -------- substring(string,start,length)  name()   Position()   Concat()   contains()   Starts-with()   String()   String-length()
Processing of XML through Java Rerquirements Set classpath to Xalan.jar/Xerces.jar parser. Import javax.xml.transform.*; Import javax.xml.parsers.*; Import org.w3c.dom.traversal.*; import org.w3c.dom.*;
Processing ways DOM  A DOM parser reads an entire document. It then makes the tree for the entire document available to program code for reading and updating  SAX   Reading a document one piece at a time. It process the document on event based.
XML Transformation JAXP support transformation of xml and xslt in to a response tree.
Using CSS: Cascading Style Sheet (CSS) is a relatively simple tool that allows the developer to assign styles to HTML elements. CSS duplicates formatting built into HTML. It provides web developers with access to a large variety of formatting properties such as margins, line-height, word spacing and much more. CSS is easy to learn and style sheets can be included directly in xml documents or can be saved as standalone text files.
Using CSS <LINK HREF=”MyStylesheet.css” REL=”stylesheet” type=”text/css”> cd{ display: block; font-size:24pt; padding:20pt; font-wieght: bold; color: blue; Text-align: center; }
title{ display:inline; font-size:14pt; padding:20pt; font-weight:bold; color:red; } artist{ display:block; text-align:center; font-size:14pt; padding:20pt; font-weight:bold; color:green; }
XSL:FO Introduction XSL-FO is an XML based markup language describing the formatting of XML data for output to screen, paper or other media. XSL-FO stands for Extensible Stylesheet Language Formatting Objects  XSL-FO is a W3C Recommendation
XSL-FO Documents XSL-FO documents are XML files with output information. They contain information about the output layout and output contents. XSL-FO documents are stored in files with a *.fo or a *.fob extension. It is also quite normal to see XSL-FO documents stored with the *.xml extension, because this makes them more accessible to XML editors.
Structure of XSL:FO <?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?> <fo:root xmlns:fo=&quot;http://www.w3.org/1999/XSL/Format&quot;><fo:layout-master-set>  <fo:simple-page-master master-name=&quot;A4&quot;> <!-- Page template goes here -->  </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference=&quot;A4&quot;>  <!-- Page content goes here --></fo:page-sequence> </fo:root>
Examples: Invoice.xml invoice.xsl Invoice.fo
THANK YOU ..

More Related Content

PPTX
Android terminologies
PPTX
Event Handling in java
PDF
javascript objects
PPT
XSLT.ppt
PDF
Web Services (SOAP, WSDL, UDDI)
PPTX
Statements and Conditions in PHP
PPTX
Unit iv
PPTX
JSON: The Basics
Android terminologies
Event Handling in java
javascript objects
XSLT.ppt
Web Services (SOAP, WSDL, UDDI)
Statements and Conditions in PHP
Unit iv
JSON: The Basics

What's hot (20)

PPTX
Operators php
PDF
JavaScript - Chapter 10 - Strings and Arrays
PPT
Javascript
PDF
JavaScript - Chapter 6 - Basic Functions
PPTX
Lab #2: Introduction to Javascript
PPTX
Javascript validating form
PPTX
PPTX
Regular Expression
PPT
XML Schema
PPT
Javascript
PPTX
Context free grammar
PPTX
Java Beans
PDF
XML and XML Applications - Lecture 04 - Web Information Systems (WE-DINF-11912)
PPTX
Dart ppt
PPT
Introduction to Javascript
PPTX
Turing machine
PPT
Web Application Introduction
PPT
JavaScript Functions
PPSX
Javascript variables and datatypes
Operators php
JavaScript - Chapter 10 - Strings and Arrays
Javascript
JavaScript - Chapter 6 - Basic Functions
Lab #2: Introduction to Javascript
Javascript validating form
Regular Expression
XML Schema
Javascript
Context free grammar
Java Beans
XML and XML Applications - Lecture 04 - Web Information Systems (WE-DINF-11912)
Dart ppt
Introduction to Javascript
Turing machine
Web Application Introduction
JavaScript Functions
Javascript variables and datatypes
Ad

Viewers also liked (20)

PPTX
PPTX
XSLT
PPTX
An Introduction to the DOM
PPT
Document Object Model
PDF
eXtensible Markup Language APIs in Java 1.6 - Simple and efficient XML parsin...
PPT
XML and XPath details
PPTX
Xml processors
PPT
Understanding XML DOM
PPT
XML SAX PARSING
PPT
Learning XSLT
PPT
PPT
PPT
XPath - XML Path Language
PPTX
Overview of XSL, XPath and XSL-FO
PPTX
Document Object Model
PDF
XSLT and XPath - without the pain!
PPTX
Xml dom
PPT
Java XML Parsing
PPT
DOM ( Document Object Model )
XSLT
An Introduction to the DOM
Document Object Model
eXtensible Markup Language APIs in Java 1.6 - Simple and efficient XML parsin...
XML and XPath details
Xml processors
Understanding XML DOM
XML SAX PARSING
Learning XSLT
XPath - XML Path Language
Overview of XSL, XPath and XSL-FO
Document Object Model
XSLT and XPath - without the pain!
Xml dom
Java XML Parsing
DOM ( Document Object Model )
Ad

Similar to XML/XSLT (20)

PPTX
Introduction to XSLT
PPS
eXtensible Markup Language
PPT
uptu web technology unit 2 Xml2
PPT
5 xsl (formatting xml documents)
PPT
working with internet technologies using XML
PPT
Intro XML for archivists (2011)
PPT
Xml description
PPTX
Xml schema
PPTX
PPTX
PPTX
xml.pptx
DOCX
Xml material
DOCX
Xml material
DOCX
Xml material
PDF
Module 5 XML Notes.pdf
PPTX
Xml programming language myassignmenthelp.net
PPTX
Sgml and xml
Introduction to XSLT
eXtensible Markup Language
uptu web technology unit 2 Xml2
5 xsl (formatting xml documents)
working with internet technologies using XML
Intro XML for archivists (2011)
Xml description
Xml schema
xml.pptx
Xml material
Xml material
Xml material
Module 5 XML Notes.pdf
Xml programming language myassignmenthelp.net
Sgml and xml

More from thinkahead.net (13)

PPT
Catalog maintenance and epo services at ta
PPT
Think ahead presentation on bpo 2010
PPT
Entrepreneur 2b or not 2 b indo german
PPT
Formulating web and social media marketing strategy for india
PPT
Smart Card Technology
PPT
Microsoft Silverlight
PPT
Do I really need Iinternet Marketing Budget ?
PPT
Catalogue Maintenance & Editorial Process Outsourcing
PPT
CLOUD COMPUTING
PPT
Blu-ray Disc
PPT
PPT
Ruby on Rails
PPT
Firewall
Catalog maintenance and epo services at ta
Think ahead presentation on bpo 2010
Entrepreneur 2b or not 2 b indo german
Formulating web and social media marketing strategy for india
Smart Card Technology
Microsoft Silverlight
Do I really need Iinternet Marketing Budget ?
Catalogue Maintenance & Editorial Process Outsourcing
CLOUD COMPUTING
Blu-ray Disc
Ruby on Rails
Firewall

Recently uploaded (20)

PDF
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
PPTX
Training Program for knowledge in solar cell and solar industry
PPTX
SGT Report The Beast Plan and Cyberphysical Systems of Control
PDF
Advancing precision in air quality forecasting through machine learning integ...
PDF
4 layer Arch & Reference Arch of IoT.pdf
PDF
INTERSPEECH 2025 「Recent Advances and Future Directions in Voice Conversion」
PDF
Aug23rd - Mulesoft Community Workshop - Hyd, India.pdf
PDF
Statistics on Ai - sourced from AIPRM.pdf
PPTX
Internet of Everything -Basic concepts details
PPTX
Module 1 Introduction to Web Programming .pptx
PPTX
Configure Apache Mutual Authentication
PPT
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
PPTX
MuleSoft-Compete-Deck for midddleware integrations
PDF
Transform-Your-Factory-with-AI-Driven-Quality-Engineering.pdf
PDF
Improvisation in detection of pomegranate leaf disease using transfer learni...
PDF
“A New Era of 3D Sensing: Transforming Industries and Creating Opportunities,...
PDF
Lung cancer patients survival prediction using outlier detection and optimize...
PDF
Auditboard EB SOX Playbook 2023 edition.
PDF
Comparative analysis of machine learning models for fake news detection in so...
PDF
Data Virtualization in Action: Scaling APIs and Apps with FME
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
Training Program for knowledge in solar cell and solar industry
SGT Report The Beast Plan and Cyberphysical Systems of Control
Advancing precision in air quality forecasting through machine learning integ...
4 layer Arch & Reference Arch of IoT.pdf
INTERSPEECH 2025 「Recent Advances and Future Directions in Voice Conversion」
Aug23rd - Mulesoft Community Workshop - Hyd, India.pdf
Statistics on Ai - sourced from AIPRM.pdf
Internet of Everything -Basic concepts details
Module 1 Introduction to Web Programming .pptx
Configure Apache Mutual Authentication
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
MuleSoft-Compete-Deck for midddleware integrations
Transform-Your-Factory-with-AI-Driven-Quality-Engineering.pdf
Improvisation in detection of pomegranate leaf disease using transfer learni...
“A New Era of 3D Sensing: Transforming Industries and Creating Opportunities,...
Lung cancer patients survival prediction using outlier detection and optimize...
Auditboard EB SOX Playbook 2023 edition.
Comparative analysis of machine learning models for fake news detection in so...
Data Virtualization in Action: Scaling APIs and Apps with FME

XML/XSLT

  • 1. XML/XSLT Aravinda.J
  • 2. Contents Introduction to XML XML in web application Java Parsers XSLT XSLT:FO Examples Usage of XML,XSLT,XSLT:FO in EDI
  • 3. XML What is XML? XML stands for E X tensible M arkup L anguage XML is a markup language much like HTML XML was designed to describe data XML tags are not predefined. You must define your own tags XML uses a Document Type Definition (DTD) or an XML Schema to describe the data XML was designed to store, carry, and exchange data. XML was not designed to display data.
  • 4. The main difference between XML and HTML XML is not a replacement for HTML. XML and HTML were designed with different goals: XML was designed to describe data and to focus on what data is. HTML was designed to display data and to focus on how data looks.
  • 5. The following example is a note to Tove from Jani, stored as XML: <?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?> <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note>
  • 6. How can XML be Used? It is important to understand that XML was designed to store, carry, and exchange data. XML was not designed to display data. With XML, your data is stored outside your HTML. With XML, data can be exchanged between incompatible systems.
  • 7. XML and B2B With XML, financial information can be exchanged over the Internet. XML can be used to Share Data XML can be used to Store Data XML is the mother of WAP and WML. The Wireless Markup Language (WML), used to markup Internet applications for handheld devices like mobile phones, is written in XML.
  • 8. XML Syntax The syntax rules of XML are very simple and very strict. The rules are very easy to learn, and very easy to use. The first line in the document - the XML declaration - defines the XML version and the character encoding used in the document. In this case the document conforms to the 1.0 specification of XML and uses the ISO-8859-1 (Latin-1/West European) character set. The next line describes the root element of the document (like it was saying: &quot;this document is a note&quot;):
  • 9. XML SYNTAX All XML elements must have a closing tag XML tags are case sensitive All XML elements must be properly nested All XML documents must have a root element Attribute values must always be quoted
  • 10. DISPLAYING XML CONTENT THROUGH XSL/JAVA/CSS XSL stands for e X tensible S tylesheet L anguage. The World Wide Web Consortium (W3C) started to develop XSL because there was a need for an XML based Stylesheet Language. XML does not use predefined tags (we can use any tags we like) and the meanings of these tags are not well understood . The <table> could mean an HTML table or a piece of furniture, and a browser does not know how to display it . There must be something in addition to the XML document that describes how the document should be displayed; and that is XSL!
  • 11. XSLT Demonstration XML Doc XML Processor (xsltproc) XSLT Stylesheet PDF XML HTML
  • 12. XSL - More Than a Style Sheet Language XSLT is a language for transforming XML documents Think of XSL as a set of languages that can transform XML into XHTML, filter and sort XML data, define parts of an XML document, format XML data based on the data value, like displaying negative numbers in red, and output XML data to different media, like screens, paper, or voice.  XPath is a language for defining parts of an XML document XSL-FO is a language for formatting XML documents
  • 13. WORKING OF XSLT XSLT Uses XPath XSLT uses XPath to define the matching patterns for transformations. If you want to study XPath first, please read our XPath Tutorial . How does it Work? In the transformation process, XSLT uses XPath to define parts of the source document that 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. The parts of the source document that do not match a template will end up unmodified in the result document.
  • 15. Elements in XSLT apply-imports apply-templates call-template choose decimal-format for-each if otherwise value-of
  • 16. Inherited XPath Functions count() –Returns the no of nodes substring() -------- substring(string,start,length) name() Position() Concat() contains() Starts-with() String() String-length()
  • 17. Processing of XML through Java Rerquirements Set classpath to Xalan.jar/Xerces.jar parser. Import javax.xml.transform.*; Import javax.xml.parsers.*; Import org.w3c.dom.traversal.*; import org.w3c.dom.*;
  • 18. Processing ways DOM  A DOM parser reads an entire document. It then makes the tree for the entire document available to program code for reading and updating SAX  Reading a document one piece at a time. It process the document on event based.
  • 19. XML Transformation JAXP support transformation of xml and xslt in to a response tree.
  • 20. Using CSS: Cascading Style Sheet (CSS) is a relatively simple tool that allows the developer to assign styles to HTML elements. CSS duplicates formatting built into HTML. It provides web developers with access to a large variety of formatting properties such as margins, line-height, word spacing and much more. CSS is easy to learn and style sheets can be included directly in xml documents or can be saved as standalone text files.
  • 21. Using CSS <LINK HREF=”MyStylesheet.css” REL=”stylesheet” type=”text/css”> cd{ display: block; font-size:24pt; padding:20pt; font-wieght: bold; color: blue; Text-align: center; }
  • 22. title{ display:inline; font-size:14pt; padding:20pt; font-weight:bold; color:red; } artist{ display:block; text-align:center; font-size:14pt; padding:20pt; font-weight:bold; color:green; }
  • 23. XSL:FO Introduction XSL-FO is an XML based markup language describing the formatting of XML data for output to screen, paper or other media. XSL-FO stands for Extensible Stylesheet Language Formatting Objects XSL-FO is a W3C Recommendation
  • 24. XSL-FO Documents XSL-FO documents are XML files with output information. They contain information about the output layout and output contents. XSL-FO documents are stored in files with a *.fo or a *.fob extension. It is also quite normal to see XSL-FO documents stored with the *.xml extension, because this makes them more accessible to XML editors.
  • 25. Structure of XSL:FO <?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?> <fo:root xmlns:fo=&quot;http://www.w3.org/1999/XSL/Format&quot;><fo:layout-master-set> <fo:simple-page-master master-name=&quot;A4&quot;> <!-- Page template goes here --> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference=&quot;A4&quot;> <!-- Page content goes here --></fo:page-sequence> </fo:root>