⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xmlschemas.c

📁 xml开源解析代码.版本为libxml2-2.6.29,可支持GB3212.网络消息发送XML时很有用.
💻 C
📖 第 1 页 / 共 5 页
字号:
* (extends xmlSchemaBucket)*/typedef struct _xmlSchemaInclude xmlSchemaInclude;typedef xmlSchemaInclude *xmlSchemaIncludePtr;struct _xmlSchemaInclude {    int type;    int flags;    const xmlChar *schemaLocation;    const xmlChar *origTargetNamespace;    const xmlChar *targetNamespace;    xmlDocPtr doc;    xmlSchemaSchemaRelationPtr relations;    int located;    int parsed;    int imported;    int preserveDoc;    xmlSchemaItemListPtr globals; /* Global components. */     xmlSchemaItemListPtr locals; /* Local components. */    /* The owning main or import schema bucket. */    xmlSchemaImportPtr ownerImport;};/** * xmlSchemaBasicItem: * * The abstract base type for schema components. */typedef struct _xmlSchemaBasicItem xmlSchemaBasicItem;typedef xmlSchemaBasicItem *xmlSchemaBasicItemPtr;struct _xmlSchemaBasicItem {    xmlSchemaTypeType type;};/** * xmlSchemaAnnotItem: * * The abstract base type for annotated schema components. * (Extends xmlSchemaBasicItem) */typedef struct _xmlSchemaAnnotItem xmlSchemaAnnotItem;typedef xmlSchemaAnnotItem *xmlSchemaAnnotItemPtr;struct _xmlSchemaAnnotItem {    xmlSchemaTypeType type;    xmlSchemaAnnotPtr annot;};/** * xmlSchemaTreeItem: * * The abstract base type for tree-like structured schema components. * (Extends xmlSchemaAnnotItem) */typedef struct _xmlSchemaTreeItem xmlSchemaTreeItem;typedef xmlSchemaTreeItem *xmlSchemaTreeItemPtr;struct _xmlSchemaTreeItem {    xmlSchemaTypeType type;    xmlSchemaAnnotPtr annot;    xmlSchemaTreeItemPtr next;    xmlSchemaTreeItemPtr children;};#define XML_SCHEMA_ATTR_USE_FIXED 1<<0/** * xmlSchemaAttributeUsePtr: * * The abstract base type for tree-like structured schema components. * (Extends xmlSchemaTreeItem) */typedef struct _xmlSchemaAttributeUse xmlSchemaAttributeUse;typedef xmlSchemaAttributeUse *xmlSchemaAttributeUsePtr;struct _xmlSchemaAttributeUse {    xmlSchemaTypeType type;    xmlSchemaAnnotPtr annot;    xmlSchemaAttributeUsePtr next; /* The next attr. use. */    /*     * The attr. decl. OR a QName-ref. to an attr. decl. OR    * a QName-ref. to an attribute group definition.    */    xmlSchemaAttributePtr attrDecl;    int flags;    xmlNodePtr node;    int occurs; /* required, optional */    const xmlChar * defValue;    xmlSchemaValPtr defVal;};/** * xmlSchemaAttributeUseProhibPtr: * * A helper component to reflect attribute prohibitions. * (Extends xmlSchemaBasicItem) */typedef struct _xmlSchemaAttributeUseProhib xmlSchemaAttributeUseProhib;typedef xmlSchemaAttributeUseProhib *xmlSchemaAttributeUseProhibPtr;struct _xmlSchemaAttributeUseProhib {    xmlSchemaTypeType type; /* == XML_SCHEMA_EXTRA_ATTR_USE_PROHIB */    xmlNodePtr node;    const xmlChar *name;    const xmlChar *targetNamespace;    int isRef;};/** * xmlSchemaRedef: */typedef struct _xmlSchemaRedef xmlSchemaRedef;typedef xmlSchemaRedef *xmlSchemaRedefPtr;struct _xmlSchemaRedef {    xmlSchemaRedefPtr next;    xmlSchemaBasicItemPtr item; /* The redefining component. */    xmlSchemaBasicItemPtr reference; /* The referencing component. */    xmlSchemaBasicItemPtr target; /* The to-be-redefined component. */    const xmlChar *refName; /* The name of the to-be-redefined component. */    const xmlChar *refTargetNs; /* The target namespace of the                                   to-be-redefined comp. */    xmlSchemaBucketPtr targetBucket; /* The redefined schema. */};/** * xmlSchemaConstructionCtxt: */typedef struct _xmlSchemaConstructionCtxt xmlSchemaConstructionCtxt;typedef xmlSchemaConstructionCtxt *xmlSchemaConstructionCtxtPtr;struct _xmlSchemaConstructionCtxt {    xmlSchemaPtr mainSchema; /* The main schema. */    xmlSchemaBucketPtr mainBucket; /* The main schema bucket */    xmlDictPtr dict;    xmlSchemaItemListPtr buckets; /* List of schema buckets. */    /* xmlSchemaItemListPtr relations; */ /* List of schema relations. */    xmlSchemaBucketPtr bucket; /* The current schema bucket */        xmlSchemaItemListPtr pending; /* All Components of all schemas that                                     need to be fixed. */    xmlHashTablePtr substGroups;    xmlSchemaRedefPtr redefs;    xmlSchemaRedefPtr lastRedef;};#define XML_SCHEMAS_PARSE_ERROR		1#define SCHEMAS_PARSE_OPTIONS XML_PARSE_NOENTstruct _xmlSchemaParserCtxt {    int type;    void *errCtxt;             /* user specific error context */    xmlSchemaValidityErrorFunc error;   /* the callback in case of errors */    xmlSchemaValidityWarningFunc warning;       /* the callback in case of warning */    int err;    int nberrors;    xmlStructuredErrorFunc serror;    xmlSchemaConstructionCtxtPtr constructor;    int ownsConstructor; /* TODO: Move this to parser *flags*. */    /* xmlSchemaPtr topschema;	*/    /* xmlHashTablePtr namespaces;  */    xmlSchemaPtr schema;        /* The main schema in use */    int counter;    const xmlChar *URL;    xmlDocPtr doc;    int preserve;		/* Whether the doc should be freed  */    const char *buffer;    int size;    /*     * Used to build complex element content models     */    xmlAutomataPtr am;    xmlAutomataStatePtr start;    xmlAutomataStatePtr end;    xmlAutomataStatePtr state;    xmlDictPtr dict;		/* dictionnary for interned string names */    xmlSchemaTypePtr ctxtType; /* The current context simple/complex type */    int options;    xmlSchemaValidCtxtPtr vctxt;    int isS4S;    int isRedefine;    int xsiAssemble;    int stop; /* If the parser should stop; i.e. a critical error. */    const xmlChar *targetNamespace;    xmlSchemaBucketPtr redefined; /* The schema to be redefined. */    xmlSchemaRedefPtr redef; /* Used for redefinitions. */    int redefCounter; /* Used for redefinitions. */     xmlSchemaItemListPtr attrProhibs;};/** * xmlSchemaQNameRef: * * A component reference item (not a schema component) * (Extends xmlSchemaBasicItem) */typedef struct _xmlSchemaQNameRef xmlSchemaQNameRef;typedef xmlSchemaQNameRef *xmlSchemaQNameRefPtr;struct _xmlSchemaQNameRef {    xmlSchemaTypeType type;    xmlSchemaBasicItemPtr item; /* The resolved referenced item. */    xmlSchemaTypeType itemType;    const xmlChar *name;    const xmlChar *targetNamespace;    xmlNodePtr node;};/** * xmlSchemaParticle: * * A particle component. * (Extends xmlSchemaTreeItem) */typedef struct _xmlSchemaParticle xmlSchemaParticle;typedef xmlSchemaParticle *xmlSchemaParticlePtr;struct _xmlSchemaParticle {    xmlSchemaTypeType type;    xmlSchemaAnnotPtr annot;    xmlSchemaTreeItemPtr next; /* next particle */    xmlSchemaTreeItemPtr children; /* the "term" (e.g. a model group,	a group definition, a XML_SCHEMA_EXTRA_QNAMEREF (if a reference),        etc.) */    int minOccurs;    int maxOccurs;    xmlNodePtr node;};/** * xmlSchemaModelGroup: * * A model group component. * (Extends xmlSchemaTreeItem) */typedef struct _xmlSchemaModelGroup xmlSchemaModelGroup;typedef xmlSchemaModelGroup *xmlSchemaModelGroupPtr;struct _xmlSchemaModelGroup {    xmlSchemaTypeType type; /* XML_SCHEMA_TYPE_SEQUENCE, XML_SCHEMA_TYPE_CHOICE, XML_SCHEMA_TYPE_ALL */    xmlSchemaAnnotPtr annot;    xmlSchemaTreeItemPtr next; /* not used */    xmlSchemaTreeItemPtr children; /* first particle (OR "element decl" OR "wildcard") */    xmlNodePtr node;};#define XML_SCHEMA_MODEL_GROUP_DEF_MARKED 1<<0#define XML_SCHEMA_MODEL_GROUP_DEF_REDEFINED 1<<1/** * xmlSchemaModelGroupDef: * * A model group definition component. * (Extends xmlSchemaTreeItem) */typedef struct _xmlSchemaModelGroupDef xmlSchemaModelGroupDef;typedef xmlSchemaModelGroupDef *xmlSchemaModelGroupDefPtr;struct _xmlSchemaModelGroupDef {    xmlSchemaTypeType type; /* XML_SCHEMA_TYPE_GROUP */    xmlSchemaAnnotPtr annot;    xmlSchemaTreeItemPtr next; /* not used */    xmlSchemaTreeItemPtr children; /* the "model group" */    const xmlChar *name;    const xmlChar *targetNamespace;    xmlNodePtr node;    int flags;};typedef struct _xmlSchemaIDC xmlSchemaIDC;typedef xmlSchemaIDC *xmlSchemaIDCPtr;/** * xmlSchemaIDCSelect: * * The identity-constraint "field" and "selector" item, holding the * XPath expression. */typedef struct _xmlSchemaIDCSelect xmlSchemaIDCSelect;typedef xmlSchemaIDCSelect *xmlSchemaIDCSelectPtr;struct _xmlSchemaIDCSelect {    xmlSchemaIDCSelectPtr next;    xmlSchemaIDCPtr idc;    int index; /* an index position if significant for IDC key-sequences */    const xmlChar *xpath; /* the XPath expression */    void *xpathComp; /* the compiled XPath expression */};/** * xmlSchemaIDC: * * The identity-constraint definition component. * (Extends xmlSchemaAnnotItem) */struct _xmlSchemaIDC {    xmlSchemaTypeType type;    xmlSchemaAnnotPtr annot;    xmlSchemaIDCPtr next;    xmlNodePtr node;    const xmlChar *name;    const xmlChar *targetNamespace;    xmlSchemaIDCSelectPtr selector;    xmlSchemaIDCSelectPtr fields;    int nbFields;    xmlSchemaQNameRefPtr ref;};/** * xmlSchemaIDCAug: * * The augmented IDC information used for validation. */typedef struct _xmlSchemaIDCAug xmlSchemaIDCAug;typedef xmlSchemaIDCAug *xmlSchemaIDCAugPtr;struct _xmlSchemaIDCAug {    xmlSchemaIDCAugPtr next; /* next in a list */    xmlSchemaIDCPtr def; /* the IDC definition */    int keyrefDepth; /* the lowest tree level to which IDC                        tables need to be bubbled upwards */};/** * xmlSchemaPSVIIDCKeySequence: * * The key sequence of a node table item. */typedef struct _xmlSchemaPSVIIDCKey xmlSchemaPSVIIDCKey;typedef xmlSchemaPSVIIDCKey *xmlSchemaPSVIIDCKeyPtr;struct _xmlSchemaPSVIIDCKey {    xmlSchemaTypePtr type;    xmlSchemaValPtr val;};/** * xmlSchemaPSVIIDCNode: * * The node table item of a node table. */typedef struct _xmlSchemaPSVIIDCNode xmlSchemaPSVIIDCNode;typedef xmlSchemaPSVIIDCNode *xmlSchemaPSVIIDCNodePtr;struct _xmlSchemaPSVIIDCNode {    xmlNodePtr node;    xmlSchemaPSVIIDCKeyPtr *keys;    int nodeLine;    int nodeQNameID;    };/** * xmlSchemaPSVIIDCBinding: * * The identity-constraint binding item of the [identity-constraint table]. */typedef struct _xmlSchemaPSVIIDCBinding xmlSchemaPSVIIDCBinding;typedef xmlSchemaPSVIIDCBinding *xmlSchemaPSVIIDCBindingPtr;struct _xmlSchemaPSVIIDCBinding {    xmlSchemaPSVIIDCBindingPtr next; /* next binding of a specific node */    xmlSchemaIDCPtr definition; /* the IDC definition */    xmlSchemaPSVIIDCNodePtr *nodeTable; /* array of key-sequences */    int nbNodes; /* number of entries in the node table */    int sizeNodes; /* size of the node table */    xmlSchemaItemListPtr dupls;};#define XPATH_STATE_OBJ_TYPE_IDC_SELECTOR 1#define XPATH_STATE_OBJ_TYPE_IDC_FIELD 2#define XPATH_STATE_OBJ_MATCHES -2#define XPATH_STATE_OBJ_BLOCKED -3typedef struct _xmlSchemaIDCMatcher xmlSchemaIDCMatcher;typedef xmlSchemaIDCMatcher *xmlSchemaIDCMatcherPtr;/** * xmlSchemaIDCStateObj: * * The state object used to evaluate XPath expressions. */typedef struct _xmlSchemaIDCStateObj xmlSchemaIDCStateObj;typedef xmlSchemaIDCStateObj *xmlSchemaIDCStateObjPtr;struct _xmlSchemaIDCStateObj {    int type;    xmlSchemaIDCStateObjPtr next; /* next if in a list */    int depth; /* depth of creation */    int *history; /* list of (depth, state-id) tuples */    int nbHistory;    int sizeHistory;    xmlSchemaIDCMatcherPtr matcher; /* the correspondent field/selector                                       matcher */    xmlSchemaIDCSelectPtr sel;    void *xpathCtxt;};#define IDC_MATCHER 0/** * xmlSchemaIDCMatcher: * * Used to evaluate IDC selectors (and fields). */struct _xmlSchemaIDCMatcher {    int type;    int depth; /* the tree depth at creation time */    xmlSchemaIDCMatcherPtr next; /* next in the list */    xmlSchemaIDCMatcherPtr nextCached; /* next in the cache list */    xmlSchemaIDCAugPtr aidc; /* the augmented IDC item */    int idcType;    xmlSchemaPSVIIDCKeyPtr **keySeqs; /* the key-sequences of the target                                         elements */    int sizeKeySeqs;    xmlSchemaItemListPtr targets; /* list of target-node                                     (xmlSchemaPSVIIDCNodePtr) entries */};/** Element info flags.*/#define XML_SCHEMA_NODE_INFO_FLAG_OWNED_NAMES  1<<0#define XML_SCHEMA_NODE_INFO_FLAG_OWNED_VALUES 1<<1#define XML_SCHEMA_ELEM_INFO_NILLED	       1<<2#define XML_SCHEMA_ELEM_INFO_LOCAL_TYPE	       1<<3#define XML_SCHEMA_NODE_INFO_VALUE_NEEDED      1<<4#define XML_SCHEMA_ELEM_INFO_EMPTY             1<<5#define XML_SCHEMA_ELEM_INFO_HAS_CONTENT       1<<6#define XML_SCHEMA_ELEM_INFO_HAS_ELEM_CONTENT  1<<7#define XML_SCHEMA_ELEM_INFO_ERR_BAD_CONTENT  1<<8#define XML_SCHEMA_NODE_INFO_ERR_NOT_EXPECTED  1<<9#define XML_SCHEMA_NODE_INFO_ERR_BAD_TYPE  1<<10/** * xmlSchemaNodeInfo: * * Holds information of an element node. */struct _xmlSchemaNodeInfo {    int nodeType;    xmlNodePtr node;    int nodeLine;        const xmlChar *localName;    const xmlChar *nsName;    const xmlChar *value;    xmlSchemaValPtr val; /* the pre-computed value if any */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -