exip  Alpha 0.5.4
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
bin/headers/grammarGenerator.h File Reference
#include "errorHandle.h"
#include "procTypes.h"

Go to the source code of this file.

Supported schema formats

Such as XML-XSD, EXI-XSD, DTD or any other schema representation

enum  SchemaFormat {
  SCHEMA_FORMAT_XSD_EXI = 0, SCHEMA_FORMAT_XSD_XML = 1, SCHEMA_FORMAT_DTD = 2, SCHEMA_FORMAT_RELAX_NG = 3,
  SCHEMA_FORMAT_XSD_EXI = 0, SCHEMA_FORMAT_XSD_XML = 1, SCHEMA_FORMAT_DTD = 2, SCHEMA_FORMAT_RELAX_NG = 3
}
 
typedef enum SchemaFormat SchemaFormat
 
errorCode loadSchemaHandler (String *namespace, String *schemaLocation, BinaryBuffer **buffers, unsigned int *bufCount, SchemaFormat *schemaFormat, EXIOptions **opt)
 Call-back handler, to be implemented by the applications It is called to resolve references to schemas ( and <import>) not included in the BinaryBuffer list of generateSchemaInformedGrammars(). More...
 
errorCode generateSchemaInformedGrammars (BinaryBuffer *buffers, unsigned int bufCount, SchemaFormat schemaFormat, EXIOptions *opt, EXIPSchema *schema, errorCode(*loadSchemaHandler)(String *namespace, String *schemaLocation, BinaryBuffer **buffers, unsigned int *bufCount, SchemaFormat *schemaFormat, EXIOptions **opt))
 Given a set of XML schemes, generates all Schema-informed Element and Type Grammars as well as the pre-populated string tables (i.e. More...
 
void destroySchema (EXIPSchema *schema)
 Frees all the memory allocated by an EXIPSchema object. More...
 

Typedef Documentation

typedef enum SchemaFormat SchemaFormat

Definition at line 34 of file bin/headers/grammarGenerator.h.

Enumeration Type Documentation

Enumerator
SCHEMA_FORMAT_XSD_EXI 
SCHEMA_FORMAT_XSD_XML 
SCHEMA_FORMAT_DTD 
SCHEMA_FORMAT_RELAX_NG 
SCHEMA_FORMAT_XSD_EXI 
SCHEMA_FORMAT_XSD_XML 
SCHEMA_FORMAT_DTD 
SCHEMA_FORMAT_RELAX_NG 

Definition at line 26 of file bin/headers/grammarGenerator.h.

Function Documentation

void destroySchema ( EXIPSchema schema)
Parameters
[in]schemathe schema containing the EXI grammars to be freed

Definition at line 151 of file grammarGenerator.c.

errorCode generateSchemaInformedGrammars ( BinaryBuffer buffers,
unsigned int  bufCount,
SchemaFormat  schemaFormat,
EXIOptions opt,
EXIPSchema schema,
errorCode(*)(String *namespace, String *schemaLocation, BinaryBuffer **buffers, unsigned int *bufCount, SchemaFormat *schemaFormat, EXIOptions **opt)  loadSchemaHandler 
)

EXIPSchema instance) The current version supports only SCHEMA_FORMAT_XSD_EXI format of the XML schema.

Parameters
[in]buffersan array of input buffers holding the representation of the schema. Each buffer refers to one schema file.
[in]bufCountthe number of buffers in the array
[in]schemaFormatEXI, XSD, DTD or any other schema representation supported
[in]optoptions used for EXI schemaFormat - otherwise NULL. If options are set then they will be used for processing the EXI XSD stream although no options are specified in the EXI header. If there are options defined in the EXI header of the XSD stream then this parameter must be NULL.
[out]schemathe resulted schema information used for processing EXI streams
[in]loadSchemaHandlerCall-back handler for loading -ed or <import>-ed schema files; Can be left NULL if no or <import> statements are used in the XML schema.
Returns
Error handling code
Note
In the case of - both the host- and included-schema must have identical target namespace. That is, the current implementation does not support the case of using from XML Schema that has non empty target namespace and the referenced/included XML schema have an empty target namespace, although this is allowed by the XML Schema spec.

Definition at line 33 of file grammarGenerator.c.

errorCode loadSchemaHandler ( String namespace,
String schemaLocation,
BinaryBuffer **  buffers,
unsigned int *  bufCount,
SchemaFormat schemaFormat,
EXIOptions **  opt 
)
Parameters
[in]namespaceNULL for reference; the target namespace of <import>-ed schema otherwise
[in]schemaLocationcan be NULL for <import> reference only; The uri location of the schema otherwise
[out]buffersan array of input buffers holding the representation of the schema -ed or <import>-ed Each buffer refers to one schema file.
[out]bufCountthe number of buffers in the array
[out]schemaFormatEXI, XSD, DTD or any other schema representation supported
[out]optoptions used for EXI schemaFormat - otherwise NULL. If options are set then they will be used for processing the EXI XSD stream although no options are specified in the EXI header. If there are options defined in the EXI header of the XSD stream then this parameter must be NULL.
Returns
Error handling code
Note
In the case of - both the host- and included-schema must have identical target namespace. That is, the current implementation does not support the case of using from XML Schema that has non empty target namespace and the referenced/included XML schema have an empty target namespace, although this is allowed by the XML Schema spec.