JAXB: XML Binding
Create, Validate XML Message and Edit XML Schema




                                     e-mail: goto.champ@gmail.com
Agenda


Create: Java binding class and XML message

Validate: XML Source (file, stream, etc.)

Edit: XML Schema
Create
JDK 6

JAXB: Java Architecture for XML Binding

  xjc: generate binding class

XML Schema file

Editor: NotePad++, TextMate, vi, etc.

Apache Ant
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
  jxb:version="2.0">

  ...

</xs:schema>
# xjc [-options ...] schema




                 info: http://technology-related.com/javaee/5/docs/tutorial/doc/bnbah.html
# xjc -p net.sitdh.schema 
   schema/test.xsd




                 info: http://technology-related.com/javaee/5/docs/tutorial/doc/bnbah.html
Validate


XML Source (File, Stream, etc.)

Java Binding Class

XML Schema file
XML Schema
                 Binding Class
                                       Source


                             1                   3

                  Content                                Valid
             2    Objects        4                   5
XML Source                           Validator


                                                         Invalid
1



    2

    3



4       5
Edit



XML Schema File

XML Schema Syntax
JAXB: Create, Validate XML Message and Edit XML Schema
JAXB: Create, Validate XML Message and Edit XML Schema
JAXB: Create, Validate XML Message and Edit XML Schema

JAXB: Create, Validate XML Message and Edit XML Schema