Importing from an XSD file

In order to transform the imported XML schema to the relational schema, you can choose to import an XML schema by importing the structure of an XML data source and the information of its elements that are recorded in an XSD file.

You should be aware of the following about XSD in order to generate a correct imported XML schema:

Data type conversion table

Before the data type defined in the XSD file can function with JReport Designer, it should first be converted into a corresponding data type when the XML schema is imported, following the rules in the conversion table below.

XSD Data Type SQL Data Type
BOOLEAN BIT
BYTE TINYINT
UNSIGNEDBYTE SMALLINT
SHORT SMALLINT
UNSIGNEDSHORT INTEGER
INT INTEGER
UNSIGNEDINT BIGINT
LONG BIGINT
UNSIGNEDLONG DECIMAL
NEGATIVEINTEGER DECIMAL
NONPOSITIVEINGEGER DECIMAL
POSITIVEINTEGER DECIMAL
NONNEGATIVEINTEGER DECIMAL
INTEGER DECIMAL
FLOAT FLOAT
DOUBLE DOUBLE
DECIMAL DECIMAL
STRING VARCHAR
NORMALIZEDSTRING VARCHAR
TOKEN VARCHAR
LANGUAGE VARCHAR
NAME VARCHAR
NMTOKEN VARCHAR
NMTOKENS VARCHAR
NCNAME VARCHAR
ID VARCHAR
IDREF VARCHAR
ENTITY VARCHAR
IDREFS VARCHAR
ENTITIES VARCHAR
ANYSIMPLETYPE VARCHAR
GYEAR VARCHAR
GYEARMONTH VARCHAR
GMONTH VARCHAR
GMONTHDAY VARCHAR
GDAY VARCHAR
DATE DATE
TIME TIME
DATETIME TIMESTAMP
HEXBINARY BLOB
BASE64BINARY BLOB
XSD syntax supported by JReport Designer

In JReport Designer, not all XSD syntax can be supported. The following diagram shows the XSD syntax that is supported by JReport Designer and syntax is in accordance with the W3C standard:

XML Schema::=

Text description of the XML Schema:

annotation*, ((element declaration | SimpleType| ComplexType | notation), annotation*)*;

Notes:

The following are diagrams show the detail syntax of elements in the above diagram:

Namespace limitation in the XSD file

Default namespace (3w) and target namespace are supported by JReport Designer. You can define a prefix for the default namespace, such as xs, or xsd, but the value of elementFormDefault must be qualified. The value of attributeFormDefault should be unqualified, but JReport Designer will not allow you to add prefixes before the attributes of the elements.