ixmlparser.h
Go to the documentation of this file.
/**************************************************************************
*
* Copyright (c) 2000-2003 Intel Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* - Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
**************************************************************************/
#ifndef IXMLPARSER_H
#define IXMLPARSER_H
#include "ixml.h"
#include "ixmlmembuf.h"
/* Parser definitions */
#define QUOT "&quot;"
#define LT "&lt;"
#define GT "&gt;"
#define APOS "&apos;"
#define AMP "&amp;"
#define ESC_HEX "&#x"
#define ESC_DEC "&#"
typedef struct _IXML_NamespaceURI
{
char *nsURI;
char *prefix;
struct _IXML_NamespaceURI *nextNsURI;
} IXML_NamespaceURI;
typedef struct _IXML_ElementStack
{
char *element;
char *prefix;
char *namespaceUri;
IXML_NamespaceURI *pNsURI;
struct _IXML_ElementStack *nextElement;
} IXML_ElementStack;
typedef enum
{
eELEMENT,
eATTRIBUTE,
eCONTENT
} PARSER_STATE;
typedef struct _Parser
{
char *dataBuffer;
char *curPtr;
char *savePtr;
ixml_membuf lastElem;
ixml_membuf tokenBuf;
IXML_Node *pNeedPrefixNode;
IXML_ElementStack *pCurElement;
IXML_Node *currentNodePtr;
PARSER_STATE state;
int bHasTopLevel;
} Parser;
int Parser_isValidXmlName(
const DOMString name);
void Parser_setErrorChar(
char c);
#ifdef IXML_HAVE_SCRIPTSUPPORT
void Parser_setBeforeFree(
IXML_BeforeFreeNode_t hndlr);
IXML_BeforeFreeNode_t Parser_getBeforeFree(void);
#endif
void Parser_freeNodeContent(
IXML_Node *IXML_Nodeptr);
int Parser_LoadDocument(IXML_Document **retDoc, const char *xmlFile, int file);
int Parser_setNodePrefixAndLocalName(IXML_Node *newIXML_NodeIXML_Attr);
void ixmlAttr_init(IXML_Attr *attrNode);
int ixmlElement_setTagName(
IXML_Element *element,
const char *tagName);
void ixmlNamedNodeMap_init(
IXML_NamedNodeMap *nnMap);
int ixmlNamedNodeMap_addToNamedNodeMap(
/* [in] The named node map. */
IXML_NamedNodeMap **nnMap,
/* [in] The node to add. */
IXML_Node *add);
int ixmlNodeList_addToNodeList(
IXML_NodeList **nList,
IXML_Node *add);
void ixmlNode_init(
IXML_Node *nodeptr);
int ixmlNode_compare(
IXML_Node *srcNode,
IXML_Node *destNode);
void ixmlNode_getElementsByTagName(
IXML_Node *n,
const char *tagname,
IXML_NodeList **list);
void ixmlNode_getElementsByTagNameNS(
IXML_Node *n,
const char *namespaceURI,
const char *localName,
IXML_NodeList **list);
int ixmlNode_setNodeName(
IXML_Node *node,
const DOMString qualifiedName);
int ixmlNode_setNodeProperties(
IXML_Node *destNode,
IXML_Node *src);
void ixmlNodeList_init(
IXML_NodeList *nList);
#endif /* IXMLPARSER_H */
DOMString
#define DOMString
The type of DOM strings.
Definition ixml.h:48
ixml.h
ixmlmembuf.h
ixmlNodeList_addToNodeList
int ixmlNodeList_addToNodeList(IXML_NodeList **nList, IXML_Node *add)
Add a node to nodelist.
Definition nodeList.c:75
ixmlNamedNodeMap_init
void ixmlNamedNodeMap_init(IXML_NamedNodeMap *nnMap)
Initializes a NamedNodeMap object.
Definition namedNodeMap.c:72
ixmlNode_setNodeProperties
int ixmlNode_setNodeProperties(IXML_Node *destNode, IXML_Node *src)
Definition node.c:1384
ixmlNode_compare
int ixmlNode_compare(IXML_Node *srcNode, IXML_Node *destNode)
Compare two nodes to see whether they are the same node. Parent, sibling and children node are ignore...
Definition node.c:518
ixmlNode_getElementsByTagName
void ixmlNode_getElementsByTagName(IXML_Node *n, const char *tagname, IXML_NodeList **list)
Returns a nodeList of all descendant Elements with a given tagName, in the order in which they are en...
Definition node.c:1272
ixmlNode_init
void ixmlNode_init(IXML_Node *nodeptr)
Intializes a node.
Definition node.c:45
ixmlNode_setNodeName
int ixmlNode_setNodeName(IXML_Node *node, const DOMString qualifiedName)
Definition node.c:1357
ixmlNodeList_init
void ixmlNodeList_init(IXML_NodeList *nList)
Initializes a nodelist.
Definition nodeList.c:42
Parser_freeNodeContent
void Parser_freeNodeContent(IXML_Node *IXML_Nodeptr)
Fees a node contents.
Definition ixmlparser.c:2817
ixmlElement_setTagName
int ixmlElement_setTagName(IXML_Element *element, const char *tagName)
Set the given element's tagName.
Definition element.c:61
Parser_setNodePrefixAndLocalName
int Parser_setNodePrefixAndLocalName(IXML_Node *newIXML_NodeIXML_Attr)
Set the node prefix and localName as defined by the nodeName in the form of ns:name.
Definition ixmlparser.c:2848
Parser_LoadDocument
int Parser_LoadDocument(IXML_Document **retDoc, const char *xmlFile, int file)
Parses a xml file and return the DOM tree.
Definition ixmlparser.c:2788
Parser_setErrorChar
void Parser_setErrorChar(char c)
Sets the error character.
Definition ixmlparser.c:2691
ixmlNamedNodeMap_addToNamedNodeMap
int ixmlNamedNodeMap_addToNamedNodeMap(IXML_NamedNodeMap **nnMap, IXML_Node *add)
Add a node to a NamedNodeMap.
Definition namedNodeMap.c:145
Parser_isValidXmlName
int Parser_isValidXmlName(const DOMString name)
Check to see whether name is a valid xml name.
Definition ixmlparser.c:2669
ixmlNode_getElementsByTagNameNS
void ixmlNode_getElementsByTagNameNS(IXML_Node *n, const char *namespaceURI, const char *localName, IXML_NodeList **list)
Returns a nodeList of all the descendant Elements with a given local name and namespace URI in the or...
Definition node.c:1331
_IXML_ATTR
Data structure representing an Attribute node.
Definition ixml.h:185
_IXML_Document
Data structure representing the DOM Document.
Definition ixml.h:160
_IXML_ElementStack
Definition ixmlparser.h:59
_IXML_Element
Data structure representing an Element node.
Definition ixml.h:176
_IXML_NamedNodeMap
Data structure representing a list of named nodes.
Definition ixml.h:212
_IXML_NamespaceURI
Definition ixmlparser.h:52
_IXML_NodeList
Data structure representing a list of nodes.
Definition ixml.h:203
_IXML_Node
Data structure common to all types of nodes.
Definition ixml.h:136
_Parser
Definition ixmlparser.h:75
_Parser::curPtr
char * curPtr
Definition ixmlparser.h:79
_Parser::dataBuffer
char * dataBuffer
Definition ixmlparser.h:77
_Parser::savePtr
char * savePtr
Definition ixmlparser.h:81
ixml_membuf
The ixml_membuf type.
Definition ixmlmembuf.h:53