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 (le, stream, etc.)

Edit: XML Schema
Create
JDK 6

JAXB: Java Architecture for XML Binding

  xjc: generate binding class

XML Schema le

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 le
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

  • 1.
    JAXB: XML Binding Create,Validate XML Message and Edit XML Schema e-mail: [email protected]
  • 2.
    Agenda Create: Java bindingclass and XML message Validate: XML Source (le, stream, etc.) Edit: XML Schema
  • 3.
    Create JDK 6 JAXB: JavaArchitecture for XML Binding xjc: generate binding class XML Schema le Editor: NotePad++, TextMate, vi, etc. Apache Ant
  • 4.
    <?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>
  • 5.
    # xjc [-options...] schema info: http://technology-related.com/javaee/5/docs/tutorial/doc/bnbah.html
  • 6.
    # xjc -pnet.sitdh.schema schema/test.xsd info: http://technology-related.com/javaee/5/docs/tutorial/doc/bnbah.html
  • 12.
    Validate XML Source (File,Stream, etc.) Java Binding Class XML Schema le
  • 13.
    XML Schema Binding Class Source 1 3 Content Valid 2 Objects 4 5 XML Source Validator Invalid
  • 14.
    1 2 3 4 5
  • 16.