exip  Alpha 0.5.4
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
treeTableManipulate.c File Reference

Manipulation operations on the TreeTable such as rationalize, resolveTypeHierarchy etc. More...

#include "treeTableSchema.h"
#include "memManagement.h"
#include "stringManipulate.h"
#include "sTables.h"

Go to the source code of this file.

Macros

#define TREE_TABLE_ENTRY_COUNT   200
 
#define LOOKUP_TYPE   0
 
#define LOOKUP_REF   1
 
#define LOOKUP_SUPER_TYPE   2
 
#define LOOKUP_SUBSTITUTION   3
 
#define MAX_INCLUDE_COUNT   50
 

Functions

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 initTreeTable (TreeTable *treeT)
 Initialize a TreeTable object. More...
 
void destroyTreeTable (TreeTable *treeT)
 Destroy a TreeTable object (free the memory allocations) 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 getTypeQName (EXIPSchema *schema, TreeTable *treeT, const String typeLiteral, QNameID *qNameID)
 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...
 

Variables

const String XML_NAMESPACE
 
const String XML_SCHEMA_INSTANCE
 
const String XML_SCHEMA_NAMESPACE
 
const String URI_1_PFX
 

Detailed Description

Date
Mar 13, 2012
Author
Robert Cragie
Rumen Kyusakov
Version
0.5
[Revision] $Id: treeTableManipulate.c 337 2014-08-02 09:32:36Z kjussakov $

Definition in file treeTableManipulate.c.

Macro Definition Documentation

#define LOOKUP_REF   1

Definition at line 26 of file treeTableManipulate.c.

#define LOOKUP_SUBSTITUTION   3

Definition at line 28 of file treeTableManipulate.c.

#define LOOKUP_SUPER_TYPE   2

Definition at line 27 of file treeTableManipulate.c.

#define LOOKUP_TYPE   0

Definition at line 25 of file treeTableManipulate.c.

#define MAX_INCLUDE_COUNT   50

Definition at line 36 of file treeTableManipulate.c.

#define TREE_TABLE_ENTRY_COUNT   200

Definition at line 23 of file treeTableManipulate.c.

Function Documentation

void destroyTreeTable ( TreeTable treeT)
Parameters
[in,out]treeTa tree table object
Returns
Error handling code

Definition at line 269 of file treeTableManipulate.c.

errorCode getNsList ( TreeTable treeT,
String  nsList,
NsTable nsTable 
)

This function also resolves the special values "##targetNamespace" and "##local"

Parameters
[in]treeTthe tree table object
[in]nsLista sting containing the space separated namespaces
[out]nsTablean array of namespaces
Returns
Error handling code

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

Parameters
[in]schemathe EXIPSchema object
[in]treeTa tree table object
[in]typeLiteralthe type literal
[out]qnameqname of the type
Returns
Error handling code

Definition at line 514 of file treeTableManipulate.c.

errorCode initTreeTable ( TreeTable treeT)
Parameters
[in,out]treeTa tree table container
Returns
Error handling code

Definition at line 228 of file treeTableManipulate.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 
)
Parameters
[in,out]schemathe EXIPSchema object
[in,out]treeTa pointer to an array of tree table objects (can be RE-ALLOCED!)
[in,out]countthe number of tree table objects
[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

Definition at line 49 of file treeTableManipulate.c.

errorCode resolveTypeHierarchy ( EXIPSchema schema,
TreeTable treeT,
unsigned int  count,
SubstituteTable subsTbl 
)

In case of:

  1. type="..." attribute - finds the corresponding type definition and links it to the child pointer of that entry
  2. ref="..." attribute - finds the corresponding element definition and links it to the child pointer of that entry
  3. base="..." attribute - finds the corresponding type definition and links it to the supertype pointer of that entry
  4. substitutionGroup="..." attribute - finds the corresponding substituion group head and adds the head and the substitute in the SubstituteTable
Parameters
[in]schemathe EXIPSchema object
[in,out]treeTan array of tree table objects
[in]countthe number of tree table objects
[in]subsTblIn case of substitutionGroups in the schema maps the heads of the substitutionGroups to their members
Returns
Error handling code

Definition at line 293 of file treeTableManipulate.c.

Variable Documentation

const String URI_1_PFX

Definition at line 87 of file sTables.c.

const String XML_NAMESPACE

Definition at line 83 of file sTables.c.

const String XML_SCHEMA_INSTANCE

Definition at line 84 of file sTables.c.

const String XML_SCHEMA_NAMESPACE

Definition at line 85 of file sTables.c.