SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Developing Applications Using JAXP


Pre-assessment Questions
    1. ______________ allow integration of applications developed in different
       languages and running on different platforms.
       a. JSP applications
       b. Web services
       c. Servlet applications
       d. XML applications

    2. ______________ is responsible for providing the software components that are
       published as Web services.
       a. Service registry
       b. Service client
       c. Service provider
       d. Service broker



 ©NIIT                   XML and Web Services               Lesson 1B / Slide 1 of 23
Developing Applications Using JAXP


Pre-assessment Questions (Contd.)
    3. Web services are published to ______________.
       a. Service registry
       b. Service broker
       c. Service client
       d. Service provider

    4. ___________ protocol enables communication between the Web services and
       its clients.
       a. SOAP
       b. WSDL
       c. UDDI
       d. XML




 ©NIIT                  XML and Web Services            Lesson 1B / Slide 2 of 23
Developing Applications Using JAXP


Pre-assessment Questions (Contd.)

    5. ___________ standard describes a Web service that is published in a service
       registry.
       a. SOAP
       b. WSDL
       c. UDDI
       d. XML




 ©NIIT                   XML and Web Services              Lesson 1B / Slide 3 of 23
Developing Applications Using JAXP


Solutions to Pre-assessment
Questions (Contd.)

    1.   b. Web services
    2.   c. Service provider
    3.   a. Service registry
    4.   a. SOAP
    5.   b. WSDL




 ©NIIT                     XML and Web Services   Lesson 1B / Slide 4 of 23
Developing Applications Using JAXP


Objectives
    In this lesson, you will learn about:


         •   Document-Oriented JAXP APIs
         •   Creating applications using SAX, DOM, and XSLT API




 ©NIIT                    XML and Web Services             Lesson 1B / Slide 5 of 23
Developing Applications Using JAXP


JAXP APIs

    •    JAXP is a collection of APIs that you can use in your Java applications to
         process and translate XML documents. JAXP consists of three APIs:


          •   Simple API for XML (SAX): Allows you to use a SAX parser to process the
              XML documents serially.
          •   Document Object Model (DOM): Allows you to use a DOM parser to
              process the XML documents in an object-oriented manner.
          •   XML Stylesheet Language for Transformation (XSLT): Allows you to
              transform XML documents in other formats, such as HyperText Markup
              Language (HTML).




 ©NIIT                      XML and Web Services                Lesson 1B / Slide 6 of 23
Developing Applications Using JAXP


Using SAX API
    •    The working of SAX includes:


          •   SAX uses various classes and interfaces that are defined in the SAX API to
              process XML document in the form of a stream of data.
          •   The SAX parser also notifies your application each time it recognizes any
              syntax constructs in the XML document. The following figure shows the
              working of the SAX:




 ©NIIT                      XML and Web Services               Lesson 1B / Slide 7 of 23
Developing Applications Using JAXP


Using SAX API (Contd.)
    •    SAX API Packages are:

          •   org.xml.sax
          •   org.xml.sax.ext
          •   org.xml.sax.helpers
          •   javax.xml.parsers


    •    The steps to parse an XML document are:


          •   Import the required packages
          •   Extend the DefaultHandler Interface
          •   Parse the XML Document
          •   Override the call back methods



 ©NIIT                     XML and Web Services     Lesson 1B / Slide 8 of 23
Developing Applications Using JAXP


Demonstration-Parsing XML
  Document Using SAX API
    •    Problem Statement


         •   ABC Books has implemented a Web service that allows them to
             perform online trading of books. Information of books is
             exchanged between the organization and their clients as XML
             documents. Larry Williams, manager of ABC Books, needs to
             process these XML documents before sending them to the
             clients. Larry instructs Don Allen, the software engineer to
             develop a Java application that will process the XML documents.
             Don Allen decides to process the XML documents using SAX API.




 ©NIIT                 XML and Web Services           Lesson 1B / Slide 9 of 23
Developing Applications Using JAXP


Demonstration-Parsing XML
  Document Using SAX API(Contd.)
    •    Solution

         1.   Create an XML document that needs to be parsed.
         2.   Develop the Java class to parse the XML document and display
              its contents.
         3.   Compile and run the application.




 ©NIIT                  XML and Web Services         Lesson 1B / Slide 10 of 23
Developing Applications Using JAXP

Using DOM API
    •    The working of DOM includes:


         •   DOM uses various classes and interfaces that are defined in the DOM
             API to process XML document in the form a tree structure, known as
             DOM tree.
         •   DOM tree consists of nodes, where each node represents a component
             of the XML document. Different types of nodes supported by DOM API
             are:


             •    Element node
             •    Text node
             •    Attribute node




 ©NIIT                  XML and Web Services            Lesson 1B / Slide 11 of 23
Developing Applications Using JAXP

Using DOM API (Contd.)
    •    The following figure shows the working of DOM API:




 ©NIIT                   XML and Web Services            Lesson 1B / Slide 12 of 23
Developing Applications Using JAXP

Using DOM API (Contd.)
    •    DOM API Packages are:

         •   org.w3c.dom
         •   javax.xml.parsers


    •    The steps to parse and display XML document using DOM are:


         •   Import the DOM API related classes
         •   Parse the XML document
         •   Identify the various types of DOM nodes




 ©NIIT                  XML and Web Services            Lesson 1B / Slide 13 of 23
Developing Applications Using JAXP

Demonstration-Parsing XML
  Document Using DOM API
    •    Problem Statement


         •   New Tech Books has implemented a Web service that allows
             online trading of books. Information of books is exchanged
             between the organization and their clients as XML documents.
             Ronald Billing, manager of New Tech Books instructs Jerry
             Smith, the software engineer to develop a Java application that
             can parse the XML documents and display the elements of the
             XML document and their contents. Jerry Smith decides to parse
             the XML documents using DOM API.




 ©NIIT                 XML and Web Services          Lesson 1B / Slide 14 of 23
Developing Applications Using JAXP

Demonstration-Parsing XML
  Document Using DOM API (Contd.)
    •    Solution

         1.   Write Java code that imports the various DOM related classes. In
              addition, the code should also identify the various types of
              nodes present in the XML file.
         2.   Compile and run the DOM application.




 ©NIIT                  XML and Web Services          Lesson 1B / Slide 15 of 23
Developing Applications Using JAXP

Using XSLT API

    •    Working of XSLT: To transform an XML document into other format such as
         HTML. XSLT API needs three components:


         •   An instance of the TransformerFactory
         •   An instance of the Transformer
         •   The predefined transformation instructions




 ©NIIT                  XML and Web Services              Lesson 1B / Slide 16 of 23
Developing Applications Using JAXP

Using XSLT API (Contd.)
    •    The following figure shows the working of the XSLT API:




 ©NIIT                   XML and Web Services             Lesson 1B / Slide 17 of 23
Developing Applications Using JAXP

Using XSLT API (Contd.)
    •    The various packages of XSLT API are:

         •   javax.xml.transform
         •   javax.xml.transform.dom
         •   javax.xml.transform.sax
         •   javax.xml.transform.stream


    •    The steps to transforming an XML document are:


         •   Create a Stylesheet
         •   Create a Java class to transform an XML document




 ©NIIT                   XML and Web Services             Lesson 1B / Slide 18 of 23
Developing Applications Using JAXP

Demonstration-Parsing XML
  Document Using XSLT API
    •    Problem Statement


         •   New Tech Books has a Web service that allows online trading of
             books. Information of books is exchanged between the
             organization and their clients as XML documents. Tom Wilkins,
             manager of New Tech Books, needs to view these XML files in
             the HTML format. Tom instructs Jerry Smith, the software
             engineer to develop a Java application that can transform the
             XML documents in the HTML format. Jerry Smith decides to
             transform the XML documents using XSLT API.




 ©NIIT                 XML and Web Services         Lesson 1B / Slide 19 of 23
Developing Applications Using JAXP

Demonstration-Parsing XML
  Document Using XSLT API (Contd.)
    •    Solution

         •   Create an XSL file for the corresponding XML file.
         •   Writing the Java code that imports the various transformation
             related classes.
         •   Compile and run the XSLT application.




 ©NIIT                 XML and Web Services          Lesson 1B / Slide 20 of 23
Developing Applications Using JAXP


Summary
    In this lesson, you learned that:
         • JAXP is the Java API for processing XML documents.
         • JAXP API consists of three APIs
               • The SAX API
               • The DOM API
               • The XSLT API
         • You use the SAX and DOM APIs to parse various XML documents.
         • You use the XSLT API to transform various input source documents into
               different types of output result documents, such as HTML, XHTML, and
               WML.




 ©NIIT                   XML and Web Services             Lesson 1B / Slide 21 of 23
Developing Applications Using JAXP


Summary (Contd.)
    •    Various packages that JAXP provides to parse and transform XML documents
         are:
         • org.xml.sax
         • org.xml.sax.ext
         • org.xml.sax.helpers
         • javax.xml.parser
         • org.w3c.dom
         • javax.xml.transform
         • javax.xml.transform.dom
         • javax.xml.transform.sax
         • javax.xml.transform.stream




 ©NIIT                  XML and Web Services            Lesson 1B / Slide 22 of 23
Developing Applications Using JAXP


Summary (Contd.)
    •    Various types of interfaces that the SAX parser uses to parse an XML
         document are:
         • ContentHandler
         • ErrorHandler
         • DTDHandler
         • EntityHandler




 ©NIIT                   XML and Web Services              Lesson 1B / Slide 23 of 23

Weitere ähnliche Inhalte

Was ist angesagt?

LDAP Synchronization Connector presentation at LDAPCon 2009
LDAP Synchronization Connector presentation at LDAPCon 2009LDAP Synchronization Connector presentation at LDAPCon 2009
LDAP Synchronization Connector presentation at LDAPCon 2009Jonathan Clarke
 
The lazy administrator, how to make your life easier by using tdi to automate...
The lazy administrator, how to make your life easier by using tdi to automate...The lazy administrator, how to make your life easier by using tdi to automate...
The lazy administrator, how to make your life easier by using tdi to automate...Klaus Bild
 
Java web services using JAX-WS
Java web services using JAX-WSJava web services using JAX-WS
Java web services using JAX-WSIndicThreads
 
A sane approach to microservices
A sane approach to microservicesA sane approach to microservices
A sane approach to microservicesToby Matejovsky
 
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...Paul Withers
 
AJAX the Great: The Origin and Development of the Dynamic Web (2007)
AJAX the Great: The Origin and Development of the Dynamic Web (2007)AJAX the Great: The Origin and Development of the Dynamic Web (2007)
AJAX the Great: The Origin and Development of the Dynamic Web (2007)Fran Fabrizio
 
Data exchange between flex and java script, 2007
Data exchange between flex and java script, 2007Data exchange between flex and java script, 2007
Data exchange between flex and java script, 2007Evgenios Skitsanos
 
RESTful services on IBM Domino/XWork (ICON UK 21-22 Sept. 2015)
RESTful services on IBM Domino/XWork (ICON UK 21-22 Sept. 2015)RESTful services on IBM Domino/XWork (ICON UK 21-22 Sept. 2015)
RESTful services on IBM Domino/XWork (ICON UK 21-22 Sept. 2015)John Dalsgaard
 
Project First presentation about introduction to technologies to be used
Project First presentation about introduction to technologies to be usedProject First presentation about introduction to technologies to be used
Project First presentation about introduction to technologies to be usedarya krazydude
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...Malin Weiss
 
Utilizing JSF Front Ends with Microservices
Utilizing JSF Front Ends with MicroservicesUtilizing JSF Front Ends with Microservices
Utilizing JSF Front Ends with MicroservicesJosh Juneau
 
A powerful web application server (intravision IBM Connect 2013 Update) Febru...
A powerful web application server (intravision IBM Connect 2013 Update) Febru...A powerful web application server (intravision IBM Connect 2013 Update) Febru...
A powerful web application server (intravision IBM Connect 2013 Update) Febru...Per Henrik Lausten
 

Was ist angesagt? (18)

LDAP Synchronization Connector presentation at LDAPCon 2009
LDAP Synchronization Connector presentation at LDAPCon 2009LDAP Synchronization Connector presentation at LDAPCon 2009
LDAP Synchronization Connector presentation at LDAPCon 2009
 
The lazy administrator, how to make your life easier by using tdi to automate...
The lazy administrator, how to make your life easier by using tdi to automate...The lazy administrator, how to make your life easier by using tdi to automate...
The lazy administrator, how to make your life easier by using tdi to automate...
 
Java Web Services
Java Web ServicesJava Web Services
Java Web Services
 
Java web services using JAX-WS
Java web services using JAX-WSJava web services using JAX-WS
Java web services using JAX-WS
 
A sane approach to microservices
A sane approach to microservicesA sane approach to microservices
A sane approach to microservices
 
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
 
Ajax Zf
Ajax ZfAjax Zf
Ajax Zf
 
AJAX the Great: The Origin and Development of the Dynamic Web (2007)
AJAX the Great: The Origin and Development of the Dynamic Web (2007)AJAX the Great: The Origin and Development of the Dynamic Web (2007)
AJAX the Great: The Origin and Development of the Dynamic Web (2007)
 
Data exchange between flex and java script, 2007
Data exchange between flex and java script, 2007Data exchange between flex and java script, 2007
Data exchange between flex and java script, 2007
 
RESTful services on IBM Domino/XWork (ICON UK 21-22 Sept. 2015)
RESTful services on IBM Domino/XWork (ICON UK 21-22 Sept. 2015)RESTful services on IBM Domino/XWork (ICON UK 21-22 Sept. 2015)
RESTful services on IBM Domino/XWork (ICON UK 21-22 Sept. 2015)
 
Project First presentation about introduction to technologies to be used
Project First presentation about introduction to technologies to be usedProject First presentation about introduction to technologies to be used
Project First presentation about introduction to technologies to be used
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
 
Utilizing JSF Front Ends with Microservices
Utilizing JSF Front Ends with MicroservicesUtilizing JSF Front Ends with Microservices
Utilizing JSF Front Ends with Microservices
 
GraphQL 101
GraphQL 101GraphQL 101
GraphQL 101
 
Best DotNet Training in Delhi
Best   DotNet Training  in DelhiBest   DotNet Training  in Delhi
Best DotNet Training in Delhi
 
3 jdbc api
3 jdbc api3 jdbc api
3 jdbc api
 
A powerful web application server (intravision IBM Connect 2013 Update) Febru...
A powerful web application server (intravision IBM Connect 2013 Update) Febru...A powerful web application server (intravision IBM Connect 2013 Update) Febru...
A powerful web application server (intravision IBM Connect 2013 Update) Febru...
 
OUGF OSGi/Flex
OUGF OSGi/FlexOUGF OSGi/Flex
OUGF OSGi/Flex
 

Andere mochten auch

Andere mochten auch (9)

Ajs 1 c
Ajs 1 cAjs 1 c
Ajs 1 c
 
Ajs 3 b
Ajs 3 bAjs 3 b
Ajs 3 b
 
Ajs 4 a
Ajs 4 aAjs 4 a
Ajs 4 a
 
Ajs 3 a
Ajs 3 aAjs 3 a
Ajs 3 a
 
Ajs 4 c
Ajs 4 cAjs 4 c
Ajs 4 c
 
Ajs 4 b
Ajs 4 bAjs 4 b
Ajs 4 b
 
Ajs 1 b
Ajs 1 bAjs 1 b
Ajs 1 b
 
Up to Speed on HTML 5 and CSS 3
Up to Speed on HTML 5 and CSS 3Up to Speed on HTML 5 and CSS 3
Up to Speed on HTML 5 and CSS 3
 
Javascript Best Practices
Javascript Best PracticesJavascript Best Practices
Javascript Best Practices
 

Ähnlich wie Deawsj 7 ppt-1_b

Deawsj 7 ppt-2_c
Deawsj 7 ppt-2_cDeawsj 7 ppt-2_c
Deawsj 7 ppt-2_cNiit Care
 
Deawsj 7 ppt-1_a
Deawsj 7 ppt-1_aDeawsj 7 ppt-1_a
Deawsj 7 ppt-1_aNiit Care
 
Deawsj 7 ppt-1_c
Deawsj 7 ppt-1_cDeawsj 7 ppt-1_c
Deawsj 7 ppt-1_cNiit Care
 
SOAP Service in Mule Esb
SOAP Service in Mule EsbSOAP Service in Mule Esb
SOAP Service in Mule EsbAnand kalla
 
Chapter 12:Understanding Server-Side Technologies
Chapter 12:Understanding Server-Side TechnologiesChapter 12:Understanding Server-Side Technologies
Chapter 12:Understanding Server-Side TechnologiesIt Academy
 
Intorduction to struts
Intorduction to strutsIntorduction to struts
Intorduction to strutsAnup72
 
Adobe Flex - Developing Rich Internet Application Workshop Day 2
Adobe Flex - Developing Rich Internet Application Workshop Day 2Adobe Flex - Developing Rich Internet Application Workshop Day 2
Adobe Flex - Developing Rich Internet Application Workshop Day 2Shyamala Prayaga
 
Introduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptxIntroduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptxSHAIKIRFAN715544
 
Unit 1-uses for scripting languages,web scripting
Unit 1-uses for scripting languages,web scriptingUnit 1-uses for scripting languages,web scripting
Unit 1-uses for scripting languages,web scriptingsana mateen
 
Uses for scripting languages,web scripting in perl
Uses for scripting languages,web scripting in perlUses for scripting languages,web scripting in perl
Uses for scripting languages,web scripting in perlsana mateen
 
.net Based Component Technologies
.net Based Component Technologies.net Based Component Technologies
.net Based Component Technologiesprakashk453625
 
Understanding Dom
Understanding DomUnderstanding Dom
Understanding DomLiquidHub
 

Ähnlich wie Deawsj 7 ppt-1_b (20)

Deawsj 7 ppt-2_c
Deawsj 7 ppt-2_cDeawsj 7 ppt-2_c
Deawsj 7 ppt-2_c
 
Deawsj 7 ppt-1_a
Deawsj 7 ppt-1_aDeawsj 7 ppt-1_a
Deawsj 7 ppt-1_a
 
Deawsj 7 ppt-1_c
Deawsj 7 ppt-1_cDeawsj 7 ppt-1_c
Deawsj 7 ppt-1_c
 
Java script
Java scriptJava script
Java script
 
Linq To XML Overview
Linq To XML OverviewLinq To XML Overview
Linq To XML Overview
 
SOAP Service in Mule Esb
SOAP Service in Mule EsbSOAP Service in Mule Esb
SOAP Service in Mule Esb
 
Flex Rails Pres
Flex Rails PresFlex Rails Pres
Flex Rails Pres
 
Chapter 12:Understanding Server-Side Technologies
Chapter 12:Understanding Server-Side TechnologiesChapter 12:Understanding Server-Side Technologies
Chapter 12:Understanding Server-Side Technologies
 
Ajax
AjaxAjax
Ajax
 
Intorduction to struts
Intorduction to strutsIntorduction to struts
Intorduction to struts
 
XML Pipelines
XML PipelinesXML Pipelines
XML Pipelines
 
Adobe Flex - Developing Rich Internet Application Workshop Day 2
Adobe Flex - Developing Rich Internet Application Workshop Day 2Adobe Flex - Developing Rich Internet Application Workshop Day 2
Adobe Flex - Developing Rich Internet Application Workshop Day 2
 
Introduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptxIntroduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptx
 
dot NET Framework
dot NET Frameworkdot NET Framework
dot NET Framework
 
Unit 1-uses for scripting languages,web scripting
Unit 1-uses for scripting languages,web scriptingUnit 1-uses for scripting languages,web scripting
Unit 1-uses for scripting languages,web scripting
 
Uses for scripting languages,web scripting in perl
Uses for scripting languages,web scripting in perlUses for scripting languages,web scripting in perl
Uses for scripting languages,web scripting in perl
 
.net Based Component Technologies
.net Based Component Technologies.net Based Component Technologies
.net Based Component Technologies
 
Understanding Dom
Understanding DomUnderstanding Dom
Understanding Dom
 
Asp net
Asp netAsp net
Asp net
 
VB IMPORTANT QUESTION
VB IMPORTANT QUESTIONVB IMPORTANT QUESTION
VB IMPORTANT QUESTION
 

Mehr von Niit Care (20)

Ajs 3 c
Ajs 3 cAjs 3 c
Ajs 3 c
 
Ajs 2 b
Ajs 2 bAjs 2 b
Ajs 2 b
 
Ajs 2 a
Ajs 2 aAjs 2 a
Ajs 2 a
 
Ajs 2 c
Ajs 2 cAjs 2 c
Ajs 2 c
 
Ajs 1 a
Ajs 1 aAjs 1 a
Ajs 1 a
 
Dacj 4 2-c
Dacj 4 2-cDacj 4 2-c
Dacj 4 2-c
 
Dacj 4 2-b
Dacj 4 2-bDacj 4 2-b
Dacj 4 2-b
 
Dacj 4 2-a
Dacj 4 2-aDacj 4 2-a
Dacj 4 2-a
 
Dacj 4 1-c
Dacj 4 1-cDacj 4 1-c
Dacj 4 1-c
 
Dacj 4 1-b
Dacj 4 1-bDacj 4 1-b
Dacj 4 1-b
 
Dacj 4 1-a
Dacj 4 1-aDacj 4 1-a
Dacj 4 1-a
 
Dacj 1-2 b
Dacj 1-2 bDacj 1-2 b
Dacj 1-2 b
 
Dacj 1-3 c
Dacj 1-3 cDacj 1-3 c
Dacj 1-3 c
 
Dacj 1-3 b
Dacj 1-3 bDacj 1-3 b
Dacj 1-3 b
 
Dacj 1-3 a
Dacj 1-3 aDacj 1-3 a
Dacj 1-3 a
 
Dacj 1-2 c
Dacj 1-2 cDacj 1-2 c
Dacj 1-2 c
 
Dacj 1-2 a
Dacj 1-2 aDacj 1-2 a
Dacj 1-2 a
 
Dacj 1-1 c
Dacj 1-1 cDacj 1-1 c
Dacj 1-1 c
 
Dacj 1-1 b
Dacj 1-1 bDacj 1-1 b
Dacj 1-1 b
 
Dacj 1-1 a
Dacj 1-1 aDacj 1-1 a
Dacj 1-1 a
 

Kürzlich hochgeladen

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

Deawsj 7 ppt-1_b

  • 1. Developing Applications Using JAXP Pre-assessment Questions 1. ______________ allow integration of applications developed in different languages and running on different platforms. a. JSP applications b. Web services c. Servlet applications d. XML applications 2. ______________ is responsible for providing the software components that are published as Web services. a. Service registry b. Service client c. Service provider d. Service broker ©NIIT XML and Web Services Lesson 1B / Slide 1 of 23
  • 2. Developing Applications Using JAXP Pre-assessment Questions (Contd.) 3. Web services are published to ______________. a. Service registry b. Service broker c. Service client d. Service provider 4. ___________ protocol enables communication between the Web services and its clients. a. SOAP b. WSDL c. UDDI d. XML ©NIIT XML and Web Services Lesson 1B / Slide 2 of 23
  • 3. Developing Applications Using JAXP Pre-assessment Questions (Contd.) 5. ___________ standard describes a Web service that is published in a service registry. a. SOAP b. WSDL c. UDDI d. XML ©NIIT XML and Web Services Lesson 1B / Slide 3 of 23
  • 4. Developing Applications Using JAXP Solutions to Pre-assessment Questions (Contd.) 1. b. Web services 2. c. Service provider 3. a. Service registry 4. a. SOAP 5. b. WSDL ©NIIT XML and Web Services Lesson 1B / Slide 4 of 23
  • 5. Developing Applications Using JAXP Objectives In this lesson, you will learn about: • Document-Oriented JAXP APIs • Creating applications using SAX, DOM, and XSLT API ©NIIT XML and Web Services Lesson 1B / Slide 5 of 23
  • 6. Developing Applications Using JAXP JAXP APIs • JAXP is a collection of APIs that you can use in your Java applications to process and translate XML documents. JAXP consists of three APIs: • Simple API for XML (SAX): Allows you to use a SAX parser to process the XML documents serially. • Document Object Model (DOM): Allows you to use a DOM parser to process the XML documents in an object-oriented manner. • XML Stylesheet Language for Transformation (XSLT): Allows you to transform XML documents in other formats, such as HyperText Markup Language (HTML). ©NIIT XML and Web Services Lesson 1B / Slide 6 of 23
  • 7. Developing Applications Using JAXP Using SAX API • The working of SAX includes: • SAX uses various classes and interfaces that are defined in the SAX API to process XML document in the form of a stream of data. • The SAX parser also notifies your application each time it recognizes any syntax constructs in the XML document. The following figure shows the working of the SAX: ©NIIT XML and Web Services Lesson 1B / Slide 7 of 23
  • 8. Developing Applications Using JAXP Using SAX API (Contd.) • SAX API Packages are: • org.xml.sax • org.xml.sax.ext • org.xml.sax.helpers • javax.xml.parsers • The steps to parse an XML document are: • Import the required packages • Extend the DefaultHandler Interface • Parse the XML Document • Override the call back methods ©NIIT XML and Web Services Lesson 1B / Slide 8 of 23
  • 9. Developing Applications Using JAXP Demonstration-Parsing XML Document Using SAX API • Problem Statement • ABC Books has implemented a Web service that allows them to perform online trading of books. Information of books is exchanged between the organization and their clients as XML documents. Larry Williams, manager of ABC Books, needs to process these XML documents before sending them to the clients. Larry instructs Don Allen, the software engineer to develop a Java application that will process the XML documents. Don Allen decides to process the XML documents using SAX API. ©NIIT XML and Web Services Lesson 1B / Slide 9 of 23
  • 10. Developing Applications Using JAXP Demonstration-Parsing XML Document Using SAX API(Contd.) • Solution 1. Create an XML document that needs to be parsed. 2. Develop the Java class to parse the XML document and display its contents. 3. Compile and run the application. ©NIIT XML and Web Services Lesson 1B / Slide 10 of 23
  • 11. Developing Applications Using JAXP Using DOM API • The working of DOM includes: • DOM uses various classes and interfaces that are defined in the DOM API to process XML document in the form a tree structure, known as DOM tree. • DOM tree consists of nodes, where each node represents a component of the XML document. Different types of nodes supported by DOM API are: • Element node • Text node • Attribute node ©NIIT XML and Web Services Lesson 1B / Slide 11 of 23
  • 12. Developing Applications Using JAXP Using DOM API (Contd.) • The following figure shows the working of DOM API: ©NIIT XML and Web Services Lesson 1B / Slide 12 of 23
  • 13. Developing Applications Using JAXP Using DOM API (Contd.) • DOM API Packages are: • org.w3c.dom • javax.xml.parsers • The steps to parse and display XML document using DOM are: • Import the DOM API related classes • Parse the XML document • Identify the various types of DOM nodes ©NIIT XML and Web Services Lesson 1B / Slide 13 of 23
  • 14. Developing Applications Using JAXP Demonstration-Parsing XML Document Using DOM API • Problem Statement • New Tech Books has implemented a Web service that allows online trading of books. Information of books is exchanged between the organization and their clients as XML documents. Ronald Billing, manager of New Tech Books instructs Jerry Smith, the software engineer to develop a Java application that can parse the XML documents and display the elements of the XML document and their contents. Jerry Smith decides to parse the XML documents using DOM API. ©NIIT XML and Web Services Lesson 1B / Slide 14 of 23
  • 15. Developing Applications Using JAXP Demonstration-Parsing XML Document Using DOM API (Contd.) • Solution 1. Write Java code that imports the various DOM related classes. In addition, the code should also identify the various types of nodes present in the XML file. 2. Compile and run the DOM application. ©NIIT XML and Web Services Lesson 1B / Slide 15 of 23
  • 16. Developing Applications Using JAXP Using XSLT API • Working of XSLT: To transform an XML document into other format such as HTML. XSLT API needs three components: • An instance of the TransformerFactory • An instance of the Transformer • The predefined transformation instructions ©NIIT XML and Web Services Lesson 1B / Slide 16 of 23
  • 17. Developing Applications Using JAXP Using XSLT API (Contd.) • The following figure shows the working of the XSLT API: ©NIIT XML and Web Services Lesson 1B / Slide 17 of 23
  • 18. Developing Applications Using JAXP Using XSLT API (Contd.) • The various packages of XSLT API are: • javax.xml.transform • javax.xml.transform.dom • javax.xml.transform.sax • javax.xml.transform.stream • The steps to transforming an XML document are: • Create a Stylesheet • Create a Java class to transform an XML document ©NIIT XML and Web Services Lesson 1B / Slide 18 of 23
  • 19. Developing Applications Using JAXP Demonstration-Parsing XML Document Using XSLT API • Problem Statement • New Tech Books has a Web service that allows online trading of books. Information of books is exchanged between the organization and their clients as XML documents. Tom Wilkins, manager of New Tech Books, needs to view these XML files in the HTML format. Tom instructs Jerry Smith, the software engineer to develop a Java application that can transform the XML documents in the HTML format. Jerry Smith decides to transform the XML documents using XSLT API. ©NIIT XML and Web Services Lesson 1B / Slide 19 of 23
  • 20. Developing Applications Using JAXP Demonstration-Parsing XML Document Using XSLT API (Contd.) • Solution • Create an XSL file for the corresponding XML file. • Writing the Java code that imports the various transformation related classes. • Compile and run the XSLT application. ©NIIT XML and Web Services Lesson 1B / Slide 20 of 23
  • 21. Developing Applications Using JAXP Summary In this lesson, you learned that: • JAXP is the Java API for processing XML documents. • JAXP API consists of three APIs • The SAX API • The DOM API • The XSLT API • You use the SAX and DOM APIs to parse various XML documents. • You use the XSLT API to transform various input source documents into different types of output result documents, such as HTML, XHTML, and WML. ©NIIT XML and Web Services Lesson 1B / Slide 21 of 23
  • 22. Developing Applications Using JAXP Summary (Contd.) • Various packages that JAXP provides to parse and transform XML documents are: • org.xml.sax • org.xml.sax.ext • org.xml.sax.helpers • javax.xml.parser • org.w3c.dom • javax.xml.transform • javax.xml.transform.dom • javax.xml.transform.sax • javax.xml.transform.stream ©NIIT XML and Web Services Lesson 1B / Slide 22 of 23
  • 23. Developing Applications Using JAXP Summary (Contd.) • Various types of interfaces that the SAX parser uses to parse an XML document are: • ContentHandler • ErrorHandler • DTDHandler • EntityHandler ©NIIT XML and Web Services Lesson 1B / Slide 23 of 23