exip
Alpha 0.5.4
|
Defining a TreeTable structure for schema definitions; Functions for converting the XML schema definitions to a TreeTable structure, and TreeTable manipulations. More...
#include "procTypes.h"
#include "dynamicArray.h"
#include "protoGrammars.h"
#include "hashtable.h"
#include "grammarGenerator.h"
Go to the source code of this file.
Data Structures | |
struct | PfxNsEntry |
Namespace and prefix defined in a XML schema file. More... | |
struct | PfxNsTable |
An array of namespaces and prefixes defined in a XML schema file. More... | |
struct | QNameIDGrIndx |
uri/ln indices (QNameID) of an element in the string tables and the associated grammar index More... | |
struct | QualifiedTreeTableEntry |
A TreeTableEntry in particular TreeTable It is defined from which XML Schema file (TreeTable) it comes from. More... | |
struct | TreeTableEntry |
Represents a single definition (i.e XML element) from the XML schema. More... | |
struct | TreeTable |
Tree structure to store parsed schema structure and attributes; a schema tree. More... | |
struct | NsTable |
Some schema attributes (e.g. More... | |
struct | SubtGroupHead |
In case there are Substitution groups in the schema, this structure represents a Substitution group head. More... | |
struct | SubstituteTable |
In case there are Substitution groups in the schema, this structure sotres all Substitution group heads. More... | |
Typedefs | |
typedef enum ElemEnum | ElemEnum |
typedef enum AttrEnum | AttrEnum |
typedef struct PfxNsEntry | PfxNsEntry |
typedef struct PfxNsTable | PfxNsTable |
typedef enum FormType | FormType |
typedef struct QNameIDGrIndx | QNameIDGrIndx |
typedef struct QualifiedTreeTableEntry | QualifiedTreeTableEntry |
typedef struct TreeTableEntry | TreeTableEntry |
typedef struct TreeTable | TreeTable |
typedef struct NsTable | NsTable |
typedef struct SubtGroupHead | SubtGroupHead |
typedef struct SubstituteTable | SubstituteTable |
Functions | |
errorCode | initTreeTable (TreeTable *treeT) |
Initialize a TreeTable object. More... | |
void | destroyTreeTable (TreeTable *treeT) |
Destroy a TreeTable object (free the memory allocations) More... | |
errorCode | generateTreeTable (BinaryBuffer buffer, SchemaFormat schemaFormat, EXIOptions *opt, TreeTable *treeT, EXIPSchema *schema) |
Performs two things: builds a treeTable and the string tables of the EXIPSchema object. More... | |
errorCode | resolveIncludeImportReferences (EXIPSchema *schema, TreeTable **treeT, unsigned int *count, errorCode(*loadSchemaHandler)(String *namespace, String *schemaLocation, BinaryBuffer **buffers, unsigned int *bufCount, SchemaFormat *schemaFormat, EXIOptions **opt)) |
Given a set of TreeTable instances, resolve the or <import> dependencies. More... | |
errorCode | resolveTypeHierarchy (EXIPSchema *schema, TreeTable *treeT, unsigned int count, SubstituteTable *subsTbl) |
Links derived types to base types, elements to types and references to global elements. More... | |
errorCode | convertTreeTablesToExipSchema (TreeTable *treeT, unsigned int count, EXIPSchema *schema, SubstituteTable *subsTbl) |
Given types resolved TreeTable objects that are created from a XML schema files, builds the EXIP grammars in the EXIPSchema object. More... | |
errorCode | getTypeQName (EXIPSchema *schema, TreeTable *treeT, const String typeLiteral, QNameID *qname) |
Given a type value encoded as QName string in the form "prefix:localname" derives the "namespace" part and the "local name" part. More... | |
errorCode | getNsList (TreeTable *treeT, String nsList, NsTable *nsTable) |
Given a namespace="..." attribute containing a list of namespaces as a sting, returns an array of these namespaces. More... | |
void | printTreeTableEntry (TreeTableEntry *treeTableEntryIn, int indentIdx, char *prefix) |
Print a tree table entry. More... | |
Definition in file treeTableSchema.h.
Definition at line 117 of file treeTableSchema.h.
Definition at line 91 of file treeTableSchema.h.
Definition at line 146 of file treeTableSchema.h.
Definition at line 293 of file treeTableSchema.h.
typedef struct PfxNsEntry PfxNsEntry |
Definition at line 126 of file treeTableSchema.h.
typedef struct PfxNsTable PfxNsTable |
Definition at line 136 of file treeTableSchema.h.
typedef struct QNameIDGrIndx QNameIDGrIndx |
Definition at line 155 of file treeTableSchema.h.
typedef struct QualifiedTreeTableEntry QualifiedTreeTableEntry |
Definition at line 166 of file treeTableSchema.h.
typedef struct SubstituteTable SubstituteTable |
Definition at line 318 of file treeTableSchema.h.
typedef struct SubtGroupHead SubtGroupHead |
Definition at line 307 of file treeTableSchema.h.
Definition at line 275 of file treeTableSchema.h.
typedef struct TreeTableEntry TreeTableEntry |
Definition at line 217 of file treeTableSchema.h.
enum AttrEnum |
Definition at line 94 of file treeTableSchema.h.
enum ElemEnum |
Definition at line 47 of file treeTableSchema.h.
enum FormType |
Enumerator | |
---|---|
QUALIFIED | |
UNQUALIFIED |
Definition at line 140 of file treeTableSchema.h.
errorCode convertTreeTablesToExipSchema | ( | TreeTable * | treeT, |
unsigned int | count, | ||
EXIPSchema * | schema, | ||
SubstituteTable * | subsTbl | ||
) |
[in] | treeT | an array of tree table objects |
[in] | count | the number of tree table objects |
[out] | schema | schema information used for processing EXI streams in schema mode |
[in] | subsTbl | In case of substitutionGroups in the schema maps the heads of the substitutionGroups to their members |
For every tree table
For every global entry in the tree table
Definition at line 294 of file treeTableToGrammars.c.
void destroyTreeTable | ( | TreeTable * | treeT) |
[in,out] | treeT | a tree table object |
Definition at line 269 of file treeTableManipulate.c.
errorCode generateTreeTable | ( | BinaryBuffer | buffer, |
SchemaFormat | schemaFormat, | ||
EXIOptions * | opt, | ||
TreeTable * | treeT, | ||
EXIPSchema * | schema | ||
) |
The pre-populated entries in the string tables are sorted in generateSchemaInformedGrammars() after all the treeTables are generated.
The schema and treeT objects should be initialized before calling this function.
[in] | buffer | an input buffer holding (part of) the representation of the schema |
[in] | schemaFormat | EXI, XSD, DTD or any other schema representation supported |
[in] | opt | options 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] | treeT | a memory representation of the XML schema definitions. Must be initialized. |
[out] | schema | partly built schema information (only the string tables) used for processing EXI streams. Must be initialized. |
Definition at line 161 of file treeTableBuild.c.
This function also resolves the special values "##targetNamespace" and "##local"
[in] | treeT | the tree table object |
[in] | nsList | a sting containing the space separated namespaces |
[out] | nsTable | an array of namespaces |
Definition at line 663 of file treeTableManipulate.c.
errorCode getTypeQName | ( | EXIPSchema * | schema, |
TreeTable * | treeT, | ||
const String | typeLiteral, | ||
QNameID * | qname | ||
) |
Used for the value of the "type" attribute of element and attribute use definitions
[in] | schema | the EXIPSchema object |
[in] | treeT | a tree table object |
[in] | typeLiteral | the type literal |
[out] | qname | qname of the type |
Definition at line 514 of file treeTableManipulate.c.
[in,out] | treeT | a tree table container |
Definition at line 228 of file treeTableManipulate.c.
void printTreeTableEntry | ( | TreeTableEntry * | treeTableEntryIn, |
int | indentIdx, | ||
char * | prefix | ||
) |
[in] | treeTableEntryIn | a tree table object |
[in] | indentIdx | Indent index |
[in] | prefix | prefix for the C definitions |
Definition at line 839 of file treeTableBuild.c.
errorCode resolveIncludeImportReferences | ( | EXIPSchema * | schema, |
TreeTable ** | treeT, | ||
unsigned int * | count, | ||
errorCode(*)(String *namespace, String *schemaLocation, BinaryBuffer **buffers, unsigned int *bufCount, SchemaFormat *schemaFormat, EXIOptions **opt) | loadSchemaHandler | ||
) |
[in,out] | schema | the EXIPSchema object |
[in,out] | treeT | a pointer to an array of tree table objects (can be RE-ALLOCED!) |
[in,out] | count | the number of tree table objects |
[in] | loadSchemaHandler | Call-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. |
Definition at line 49 of file treeTableManipulate.c.
errorCode resolveTypeHierarchy | ( | EXIPSchema * | schema, |
TreeTable * | treeT, | ||
unsigned int | count, | ||
SubstituteTable * | subsTbl | ||
) |
In case of:
[in] | schema | the EXIPSchema object |
[in,out] | treeT | an array of tree table objects |
[in] | count | the number of tree table objects |
[in] | subsTbl | In case of substitutionGroups in the schema maps the heads of the substitutionGroups to their members |
Definition at line 293 of file treeTableManipulate.c.