jaxb: create, validate xml message and edit xml schema

Post on 05-Dec-2014

10.073 Views

Category:

Technology

6 Downloads

Preview:

Click to see full reader

DESCRIPTION

Explain how to generate java xml binding class from xml schema file validation xml message and editing xml schema

TRANSCRIPT

JAXB: XML BindingCreate, 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

Validator

ContentObjects

XML Source

XML Schema Source

Valid

Invalid

Binding Class

1

2

3

4 5

1

2

5

3

4

Edit

XML Schema File

XML Schema Syntax

top related