Java api for xml processing jaxp
This presentation is the property of its rightful owner.
Sponsored Links
1 / 17

Java API for XML Processing (JAXP) PowerPoint PPT Presentation


  • 40 Views
  • Uploaded on
  • Presentation posted in: General

Java API for XML Processing (JAXP). توسط: محمّدمهدي حامد استاد راهنما: دكتر مسعود رهگذر. XML. Extensible Markup Language W3C Standard XML Documents Well-Formed Element must have an open tag and a close tag One root element that contains all other elements Valid DTD XML Schema.

Download Presentation

Java API for XML Processing (JAXP)

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Java api for xml processing jaxp

Java API for XML Processing(JAXP)

توسط: محمّدمهدي حامد

استاد راهنما: دكتر مسعود رهگذر


Java api for xml processing jaxp

XML

  • Extensible Markup Language

  • W3C Standard

  • XML Documents

    • Well-Formed

      • Element must have an open tag and a close tag

      • One root element that contains all other elements

    • Valid

      • DTD

      • XML Schema


Xml and java

XML and Java

  • Java: Portable Language

  • XML: Portable Data


Xml and java1

XML and Java

  • Java API for XML-Based Web Services (JAX-WS)

  • Java API for XML Processing (JAXP)

  • Java Architecture for XML Binding (JAXB)

  • Java API for XML Messaging (JAXM)

  • Java API for XML Registries (JAXR)

  • Java API for XML-Based RPC (JAX-RPC)

  • Java 2 Platform, Enterprise Edition (J2EE)


Java api for xml processing jaxp

JAXP

  • Java API for XML Processing

  • Includes

    • SAX

    • DOM

    • XPath

    • XSLT


Java api for xml processing jaxp

JAXP

  • javax.xml Package

    • javax.xml.parsers

    • javax.xml.validation

    • javax.xml.transform

    • javax.xml.xpath


Xml parsers

XML Parsers

  • javax.xml.parsers Package

  • SAX

    • Stream Model

  • DOM

    • Data Model


Java api for xml processing jaxp

SAX

  • Simple API for XML

  • An Standard Interface

  • Different Implementations

    • Xerces2 (Apache distribution)

    • Ælfred parser

    • Apache Crimson parser (in JDK 1.4)

    • Oracle XML Parser

    • Piccolo XML Parser


Java api for xml processing jaxp

SAX

  • Stream Model

  • Lightweight and fast

  • Event-based API

    • ContentHandler

    • DTDHandler

    • ErrorHandler

    • EntityResolver


Sax example

SAX Example

  • Events:

    • startDocument

    • startElement

    • startElement

    • startElement

    • characters

    • endElement


Sax in java

SAX in Java


Java api for xml processing jaxp

SAX

  • Advantages

    • Lightweight

    • Fast

  • Problems

    • No Random Access

    • Can’t Change the Document

    • Hard to Program

    • Hard to Navigate the Document


Java api for xml processing jaxp

DOM

  • Document Object Model

  • An Standard Interface

  • Data Model

  • Tree Representation

    • Two Kinds of Nodes

      • Element

      • Text


Dom tree traversing

DOM Tree Traversing

  • Document Class

    • Tree Runtime Representation

    • Methods for Navigation

      • getFirstChild()

      • getNextSibling()

      • getParentNode()

    • Methods for Changing the Document


Dom in java

DOM in Java


Java api for xml processing jaxp

DOM

  • Usually Implements on SAX

    • SAX is Faster

  • In-Memory Representation

  • Tree Representation

    • Easy to Traverse

    • Traverse Forward and Backward

  • Easy to Program


Java api for xml processing jaxp

Thanks

?


  • Login