ReactOS 0.4.15-dev-5666-gc548b97
SAX2.c File Reference
#include "libxml.h"
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <stddef.h>
#include <libxml/xmlmemory.h>
#include <libxml/tree.h>
#include <libxml/parser.h>
#include <libxml/parserInternals.h>
#include <libxml/valid.h>
#include <libxml/entities.h>
#include <libxml/xmlerror.h>
#include <libxml/debugXML.h>
#include <libxml/xmlIO.h>
#include <libxml/SAX.h>
#include <libxml/uri.h>
#include <libxml/HTMLtree.h>
#include <libxml/globals.h>
Include dependency graph for SAX2.c:

Go to the source code of this file.

Macros

#define IN_LIBXML
 
#define TODO
 

Functions

static void LIBXML_ATTR_FORMAT (2, 0)
 
static void LIBXML_ATTR_FORMAT (3, 0)
 
const xmlCharxmlSAX2GetPublicId (void *ctx ATTRIBUTE_UNUSED)
 
const xmlCharxmlSAX2GetSystemId (void *ctx)
 
int xmlSAX2GetLineNumber (void *ctx)
 
int xmlSAX2GetColumnNumber (void *ctx)
 
int xmlSAX2IsStandalone (void *ctx)
 
int xmlSAX2HasInternalSubset (void *ctx)
 
int xmlSAX2HasExternalSubset (void *ctx)
 
: the root element name

xmlSAX2ExternalSubset: @ctx: the user data (XML parser context)

@ExternalID: the external ID @SystemID: the SYSTEM ID (e.g. filename or URL)

Callback on external subset declaration.

void xmlSAX2InternalSubset (void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID)
 
void xmlSAX2ExternalSubset (void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID)
 
xmlParserInputPtr xmlSAX2ResolveEntity (void *ctx, const xmlChar *publicId, const xmlChar *systemId)
 
: The entity name

xmlSAX2GetParameterEntity: @ctx: the user data (XML parser context)

Get a parameter entity by name

Returns the xmlEntityPtr if found.

xmlEntityPtr xmlSAX2GetEntity (void *ctx, const xmlChar *name)
 
xmlEntityPtr xmlSAX2GetParameterEntity (void *ctx, const xmlChar *name)
 
: the element name

xmlSAX2ElementDecl: @ctx: the user data (XML parser context)

@type: the element type @content: the element value tree

An element definition has been parsed

void xmlSAX2ElementDecl (void *ctx, const xmlChar *name, int type, xmlElementContentPtr content)
 
: The name of the notation

xmlSAX2NotationDecl: @ctx: the user data (XML parser context)

@publicId: The public ID of the entity @systemId: The system ID of the entity

What to do when a notation declaration has been parsed.

void xmlSAX2NotationDecl (void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId)
 
: The name of the entity

xmlSAX2UnparsedEntityDecl: @ctx: the user data (XML parser context)

@publicId: The public ID of the entity @systemId: The system ID of the entity @notationName: the name of the notation

What to do when an unparsed entity declaration is parsed

void xmlSAX2UnparsedEntityDecl (void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId, const xmlChar *notationName)
 
void xmlSAX2SetDocumentLocator (void *ctx ATTRIBUTE_UNUSED, xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED)
 
void xmlSAX2StartDocument (void *ctx)
 
void xmlSAX2EndDocument (void *ctx)
 
static xmlNodePtr xmlSAX2TextNode (xmlParserCtxtPtr ctxt, const xmlChar *str, int len)
 
static void xmlSAX2AttributeNs (xmlParserCtxtPtr ctxt, const xmlChar *localname, const xmlChar *prefix, const xmlChar *value, const xmlChar *valueend)
 
void xmlSAX2StartElementNs (void *ctx, const xmlChar *localname, const xmlChar *prefix, const xmlChar *URI, int nb_namespaces, const xmlChar **namespaces, int nb_attributes, int nb_defaulted, const xmlChar **attributes)
 
void xmlSAX2EndElementNs (void *ctx, const xmlChar *localname ATTRIBUTE_UNUSED, const xmlChar *prefix ATTRIBUTE_UNUSED, const xmlChar *URI ATTRIBUTE_UNUSED)
 

: the entity name

xmlSAX2Reference: @ctx: the user data (XML parser context)

called when an entity xmlSAX2Reference is detected.

static int xmlSAX2DefaultVersionValue = 2
 
void xmlSAX2EntityDecl (void *ctx, const xmlChar *name, int type, const xmlChar *publicId, const xmlChar *systemId, xmlChar *content)
 
void xmlSAX2AttributeDecl (void *ctx, const xmlChar *elem, const xmlChar *fullname, int type, int def, const xmlChar *defaultValue, xmlEnumerationPtr tree)
 
void xmlSAX2Reference (void *ctx, const xmlChar *name)
 
static void xmlSAX2Text (xmlParserCtxtPtr ctxt, const xmlChar *ch, int len, xmlElementType type)
 
void xmlSAX2Characters (void *ctx, const xmlChar *ch, int len)
 
void xmlSAX2IgnorableWhitespace (void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch ATTRIBUTE_UNUSED, int len ATTRIBUTE_UNUSED)
 
void xmlSAX2ProcessingInstruction (void *ctx, const xmlChar *target, const xmlChar *data)
 
void xmlSAX2Comment (void *ctx, const xmlChar *value)
 
void xmlSAX2CDataBlock (void *ctx, const xmlChar *value, int len)
 
int xmlSAXVersion (xmlSAXHandler *hdlr, int version)
 
void xmlSAX2InitDefaultSAXHandler (xmlSAXHandler *hdlr, int warning)
 
void xmlDefaultSAXHandlerInit (void)
 

Macro Definition Documentation

◆ IN_LIBXML

#define IN_LIBXML

Definition at line 10 of file SAX2.c.

◆ TODO

#define TODO
Value:
"Unimplemented block at %s:%d\n", \
__FILE__, __LINE__);
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:353
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:337

TODO:

macro to flag unimplemented blocks XML_CATALOG_PREFER user env to select between system/public preferred option. C.f. Richard Tobin richa.nosp@m.rd@c.nosp@m.ogsci.nosp@m..ed..nosp@m.ac.uk

‍Just FYI, I am using an environment variable XML_CATALOG_PREFER with values "system" and "public". I have made the default be "system" to match yours.

Definition at line 44 of file SAX2.c.

Function Documentation

◆ LIBXML_ATTR_FORMAT() [1/2]

static void LIBXML_ATTR_FORMAT ( ,
 
)
static

Definition at line 54 of file SAX2.c.

55 {
57 const char *str1 = "out of memory\n";
58
59 if (ctxt != NULL) {
60 ctxt->errNo = XML_ERR_NO_MEMORY;
61 if ((ctxt->sax != NULL) && (ctxt->sax->initialized == XML_SAX2_MAGIC))
62 schannel = ctxt->sax->serror;
63 __xmlRaiseError(schannel,
64 ctxt->vctxt.error, ctxt->vctxt.userData,
66 XML_ERR_ERROR, NULL, 0, (const char *) str1,
67 NULL, NULL, 0, 0,
68 msg, (const char *) str1, NULL);
69 ctxt->errNo = XML_ERR_NO_MEMORY;
70 ctxt->instate = XML_PARSER_EOF;
71 ctxt->disableSAX = 1;
72 } else {
73 __xmlRaiseError(schannel,
74 NULL, NULL,
76 XML_ERR_ERROR, NULL, 0, (const char *) str1,
77 NULL, NULL, 0, 0,
78 msg, (const char *) str1, NULL);
79 }
80}
#define msg(x)
Definition: auth_time.c:54
#define NULL
Definition: types.h:112
@ XML_PARSER_EOF
Definition: parser.h:111
#define XML_SAX2_MAGIC
Definition: parser.h:671
@ XML_ERR_ERROR
Definition: xmlerror.h:27
@ XML_FROM_PARSER
Definition: xmlerror.h:38
void(XMLCDECL *) typedef void(XMLCALL * xmlStructuredErrorFunc)(void *userData, xmlErrorPtr error)
Definition: xmlerror.h:858
@ XML_ERR_NO_MEMORY
Definition: xmlerror.h:102

◆ LIBXML_ATTR_FORMAT() [2/2]

static void LIBXML_ATTR_FORMAT ( ,
 
)
static

xmlValidError: @ctxt: an XML validation parser context @error: the error number @msg: the error message @str1: extra data @str2: extra data

Handle a validation error

xmlFatalErrMsg: @ctxt: an XML parser context @error: the error number @msg: the error message @str1: an error string @str2: an error string

Handle a fatal parser error, i.e. violating Well-Formedness constraints

xmlWarnMsg: @ctxt: an XML parser context @error: the error number @msg: the error message @str1: an error string @str2: an error string

Handle a parser warning

xmlNsWarnMsg: @ctxt: an XML parser context @error: the error number @msg: the error message @str1: an error string

Handle a namespace warning

Definition at line 92 of file SAX2.c.

95{
97
98 if ((ctxt != NULL) && (ctxt->disableSAX != 0) &&
99 (ctxt->instate == XML_PARSER_EOF))
100 return;
101 if (ctxt != NULL) {
102 ctxt->errNo = error;
103 if ((ctxt->sax != NULL) && (ctxt->sax->initialized == XML_SAX2_MAGIC))
104 schannel = ctxt->sax->serror;
105 __xmlRaiseError(schannel,
106 ctxt->vctxt.error, ctxt->vctxt.userData,
107 ctxt, NULL, XML_FROM_DTD, error,
108 XML_ERR_ERROR, NULL, 0, (const char *) str1,
109 (const char *) str2, NULL, 0, 0,
110 msg, (const char *) str1, (const char *) str2);
111 ctxt->valid = 0;
112 } else {
113 __xmlRaiseError(schannel,
114 NULL, NULL,
115 ctxt, NULL, XML_FROM_DTD, error,
116 XML_ERR_ERROR, NULL, 0, (const char *) str1,
117 (const char *) str2, NULL, 0, 0,
118 msg, (const char *) str1, (const char *) str2);
119 }
120}
#define error(str)
Definition: mkdosfs.c:1605
@ XML_FROM_DTD
Definition: xmlerror.h:41

◆ xmlDefaultSAXHandlerInit()

void xmlDefaultSAXHandlerInit ( void  )

xmlDefaultSAXHandlerInit:

DEPRECATED: This function will be made private. Call xmlInitParser to initialize the library.

Initialize the default SAX2 handler

Definition at line 2934 of file SAX2.c.

2935{
2936#ifdef LIBXML_SAX1_ENABLED
2938#endif /* LIBXML_SAX1_ENABLED */
2939}
int xmlSAXVersion(xmlSAXHandler *hdlr, int version)
Definition: SAX2.c:2858
XMLPUBVAR xmlSAXHandlerV1 xmlDefaultSAXHandler
Definition: globals.h:312

Referenced by xmlInitParser().

◆ xmlSAX2AttributeDecl()

void xmlSAX2AttributeDecl ( void ctx,
const xmlChar elem,
const xmlChar fullname,
int  type,
int  def,
const xmlChar defaultValue,
xmlEnumerationPtr  tree 
)

Definition at line 674 of file SAX2.c.

677{
680 xmlChar *name = NULL, *prefix = NULL;
681
682 /* Avoid unused variable warning if features are disabled. */
683 (void) attr;
684
685 if ((ctxt == NULL) || (ctxt->myDoc == NULL))
686 return;
687
688#ifdef DEBUG_SAX
690 "SAX.xmlSAX2AttributeDecl(%s, %s, %d, %d, %s, ...)\n",
691 elem, fullname, type, def, defaultValue);
692#endif
693 if ((xmlStrEqual(fullname, BAD_CAST "xml:id")) &&
694 (type != XML_ATTRIBUTE_ID)) {
695 /*
696 * Raise the error but keep the validity flag
697 */
698 int tmp = ctxt->valid;
699 xmlErrValid(ctxt, XML_DTD_XMLID_TYPE,
700 "xml:id : attribute type should be ID\n", NULL, NULL);
701 ctxt->valid = tmp;
702 }
703 /* TODO: optimize name/prefix allocation */
704 name = xmlSplitQName(ctxt, fullname, &prefix);
705 ctxt->vctxt.valid = 1;
706 if (ctxt->inSubset == 1)
708 name, prefix, (xmlAttributeType) type,
709 (xmlAttributeDefault) def, defaultValue, tree);
710 else if (ctxt->inSubset == 2)
712 name, prefix, (xmlAttributeType) type,
713 (xmlAttributeDefault) def, defaultValue, tree);
714 else {
715 xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
716 "SAX.xmlSAX2AttributeDecl(%s) called while not in subset\n",
717 name, NULL);
718 xmlFree(name);
720 return;
721 }
722#ifdef LIBXML_VALID_ENABLED
723 if (ctxt->vctxt.valid == 0)
724 ctxt->valid = 0;
725 if ((attr != NULL) && (ctxt->validate) && (ctxt->wellFormed) &&
726 (ctxt->myDoc->intSubset != NULL))
727 ctxt->valid &= xmlValidateAttributeDecl(&ctxt->vctxt, ctxt->myDoc,
728 attr);
729#endif /* LIBXML_VALID_ENABLED */
730 if (prefix != NULL)
731 xmlFree(prefix);
732 if (name != NULL)
733 xmlFree(name);
734}
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
const char * fullname
Definition: shader.c:1766
static size_t elem
Definition: string.c:68
XMLPUBFUN xmlChar *XMLCALL xmlSplitQName(xmlParserCtxtPtr ctxt, const xmlChar *name, xmlChar **prefix)
Definition: parser.c:2946
XMLPUBVAR xmlFreeFunc xmlFree
Definition: globals.h:251
xmlAttributeType
Definition: tree.h:206
@ XML_ATTRIBUTE_ID
Definition: tree.h:208
xmlAttributeDefault
Definition: tree.h:225
xmlParserCtxt * xmlParserCtxtPtr
Definition: tree.h:39
struct _xmlDtd * intSubset
Definition: tree.h:570
struct _xmlDtd * extSubset
Definition: tree.h:571
xmlValidCtxt vctxt
Definition: parser.h:221
int wellFormed
Definition: parser.h:188
xmlDocPtr myDoc
Definition: parser.h:187
int inSubset
Definition: parser.h:238
int validate
Definition: parser.h:220
Definition: cookie.c:202
Definition: name.c:39
XMLPUBFUN void XMLCALL xmlFreeEnumeration(xmlEnumerationPtr cur)
Definition: valid.c:1817
XMLPUBFUN xmlAttributePtr XMLCALL xmlAddAttributeDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *elem, const xmlChar *name, const xmlChar *ns, xmlAttributeType type, xmlAttributeDefault def, const xmlChar *defaultValue, xmlEnumerationPtr tree)
Definition: valid.c:1967
@ XML_DTD_XMLID_TYPE
Definition: xmlerror.h:259
@ XML_ERR_INTERNAL_ERROR
Definition: xmlerror.h:101
#define BAD_CAST
Definition: xmlstring.h:35
XMLPUBFUN int XMLCALL xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
Definition: xmlstring.c:160
unsigned char xmlChar
Definition: xmlstring.h:28

Referenced by xmlSAXVersion().

◆ xmlSAX2AttributeNs()

static void xmlSAX2AttributeNs ( xmlParserCtxtPtr  ctxt,
const xmlChar localname,
const xmlChar prefix,
const xmlChar value,
const xmlChar valueend 
)
static

xmlSAX2AttributeNs: @ctx: the user data (XML parser context) @localname: the local name of the attribute @prefix: the attribute namespace prefix if available @URI: the attribute namespace name if available @value: Start of the attribute value @valueend: end of the attribute value

Handle an attribute that has been read by the parser. The default handling is to convert the attribute into an DOM subtree and past it in a new xmlAttr element added to the element.

Definition at line 1967 of file SAX2.c.

1972{
1974 xmlNsPtr namespace = NULL;
1975 xmlChar *dup = NULL;
1976
1977 /*
1978 * Note: if prefix == NULL, the attribute is not in the default namespace
1979 */
1980 if (prefix != NULL)
1981 namespace = xmlSearchNs(ctxt->myDoc, ctxt->node, prefix);
1982
1983 /*
1984 * allocate the node
1985 */
1986 if (ctxt->freeAttrs != NULL) {
1987 ret = ctxt->freeAttrs;
1988 ctxt->freeAttrs = ret->next;
1989 ctxt->freeAttrsNr--;
1990 memset(ret, 0, sizeof(xmlAttr));
1991 ret->type = XML_ATTRIBUTE_NODE;
1992
1993 ret->parent = ctxt->node;
1994 ret->doc = ctxt->myDoc;
1995 ret->ns = namespace;
1996
1997 if (ctxt->dictNames)
1998 ret->name = localname;
1999 else
2000 ret->name = xmlStrdup(localname);
2001
2002 /* link at the end to preserve order, TODO speed up with a last */
2003 if (ctxt->node->properties == NULL) {
2004 ctxt->node->properties = ret;
2005 } else {
2006 xmlAttrPtr prev = ctxt->node->properties;
2007
2008 while (prev->next != NULL) prev = prev->next;
2009 prev->next = ret;
2010 ret->prev = prev;
2011 }
2012
2015 } else {
2016 if (ctxt->dictNames)
2017 ret = xmlNewNsPropEatName(ctxt->node, namespace,
2018 (xmlChar *) localname, NULL);
2019 else
2020 ret = xmlNewNsProp(ctxt->node, namespace, localname, NULL);
2021 if (ret == NULL) {
2022 xmlErrMemory(ctxt, "xmlSAX2AttributeNs");
2023 return;
2024 }
2025 }
2026
2027 if ((ctxt->replaceEntities == 0) && (!ctxt->html)) {
2028 xmlNodePtr tmp;
2029
2030 /*
2031 * We know that if there is an entity reference, then
2032 * the string has been dup'ed and terminates with 0
2033 * otherwise with ' or "
2034 */
2035 if (*valueend != 0) {
2036 tmp = xmlSAX2TextNode(ctxt, value, valueend - value);
2037 ret->children = tmp;
2038 ret->last = tmp;
2039 if (tmp != NULL) {
2040 tmp->doc = ret->doc;
2041 tmp->parent = (xmlNodePtr) ret;
2042 }
2043 } else {
2044 ret->children = xmlStringLenGetNodeList(ctxt->myDoc, value,
2045 valueend - value);
2046 tmp = ret->children;
2047 while (tmp != NULL) {
2048 tmp->doc = ret->doc;
2049 tmp->parent = (xmlNodePtr) ret;
2050 if (tmp->next == NULL)
2051 ret->last = tmp;
2052 tmp = tmp->next;
2053 }
2054 }
2055 } else if (value != NULL) {
2056 xmlNodePtr tmp;
2057
2058 tmp = xmlSAX2TextNode(ctxt, value, valueend - value);
2059 ret->children = tmp;
2060 ret->last = tmp;
2061 if (tmp != NULL) {
2062 tmp->doc = ret->doc;
2063 tmp->parent = (xmlNodePtr) ret;
2064 }
2065 }
2066
2067#ifdef LIBXML_VALID_ENABLED
2068 if ((!ctxt->html) && ctxt->validate && ctxt->wellFormed &&
2069 ctxt->myDoc && ctxt->myDoc->intSubset) {
2070 /*
2071 * If we don't substitute entities, the validation should be
2072 * done on a value with replaced entities anyway.
2073 */
2074 if (!ctxt->replaceEntities) {
2075 dup = xmlSAX2DecodeAttrEntities(ctxt, value, valueend);
2076 if (dup == NULL) {
2077 if (*valueend == 0) {
2078 ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
2079 ctxt->myDoc, ctxt->node, ret, value);
2080 } else {
2081 /*
2082 * That should already be normalized.
2083 * cheaper to finally allocate here than duplicate
2084 * entry points in the full validation code
2085 */
2086 dup = xmlStrndup(value, valueend - value);
2087
2088 ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
2089 ctxt->myDoc, ctxt->node, ret, dup);
2090 }
2091 } else {
2092 /*
2093 * dup now contains a string of the flattened attribute
2094 * content with entities substituted. Check if we need to
2095 * apply an extra layer of normalization.
2096 * It need to be done twice ... it's an extra burden related
2097 * to the ability to keep references in attributes
2098 */
2099 if (ctxt->attsSpecial != NULL) {
2100 xmlChar *nvalnorm;
2101 xmlChar fn[50];
2103
2104 fullname = xmlBuildQName(localname, prefix, fn, 50);
2105 if (fullname != NULL) {
2106 ctxt->vctxt.valid = 1;
2107 nvalnorm = xmlValidCtxtNormalizeAttributeValue(
2108 &ctxt->vctxt, ctxt->myDoc,
2109 ctxt->node, fullname, dup);
2110 if (ctxt->vctxt.valid != 1)
2111 ctxt->valid = 0;
2112
2113 if ((fullname != fn) && (fullname != localname))
2115 if (nvalnorm != NULL) {
2116 xmlFree(dup);
2117 dup = nvalnorm;
2118 }
2119 }
2120 }
2121
2122 ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
2123 ctxt->myDoc, ctxt->node, ret, dup);
2124 }
2125 } else {
2126 /*
2127 * if entities already have been substituted, then
2128 * the attribute as passed is already normalized
2129 */
2130 dup = xmlStrndup(value, valueend - value);
2131
2132 ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
2133 ctxt->myDoc, ctxt->node, ret, dup);
2134 }
2135 } else
2136#endif /* LIBXML_VALID_ENABLED */
2137 if (((ctxt->loadsubset & XML_SKIP_IDS) == 0) &&
2138 (((ctxt->replaceEntities == 0) && (ctxt->external != 2)) ||
2139 ((ctxt->replaceEntities != 0) && (ctxt->inSubset == 0))) &&
2140 /* Don't create IDs containing entity references */
2141 (ret->children != NULL) &&
2142 (ret->children->type == XML_TEXT_NODE) &&
2143 (ret->children->next == NULL)) {
2144 xmlChar *content = ret->children->content;
2145 /*
2146 * when validating, the ID registration is done at the attribute
2147 * validation level. Otherwise we have to do specific handling here.
2148 */
2149 if ((prefix == ctxt->str_xml) &&
2150 (localname[0] == 'i') && (localname[1] == 'd') &&
2151 (localname[2] == 0)) {
2152 /*
2153 * Add the xml:id value
2154 *
2155 * Open issue: normalization of the value.
2156 */
2157#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
2158#ifdef LIBXML_VALID_ENABLED
2159 if (xmlValidateNCName(content, 1) != 0) {
2160 xmlErrValid(ctxt, XML_DTD_XMLID_VALUE,
2161 "xml:id : attribute value %s is not an NCName\n",
2162 (const char *) content, NULL);
2163 }
2164#endif
2165#endif
2166 xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
2167 } else if (xmlIsID(ctxt->myDoc, ctxt->node, ret)) {
2168 xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
2169 } else if (xmlIsRef(ctxt->myDoc, ctxt->node, ret)) {
2170 xmlAddRef(&ctxt->vctxt, ctxt->myDoc, content, ret);
2171 }
2172 }
2173 if (dup != NULL)
2174 xmlFree(dup);
2175}
static xmlNodePtr xmlSAX2TextNode(xmlParserCtxtPtr ctxt, const xmlChar *str, int len)
Definition: SAX2.c:1844
content
Definition: atl_ax.c:994
#define dup
Definition: syshdrs.h:51
int __xmlRegisterCallbacks
Definition: tree.c:50
void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra)
XMLPUBVAR xmlRegisterNodeFunc xmlRegisterNodeDefaultValue
Definition: globals.h:467
#define XML_SKIP_IDS
Definition: parser.h:154
XMLPUBFUN xmlNsPtr XMLCALL xmlSearchNs(xmlDocPtr doc, xmlNodePtr node, const xmlChar *nameSpace)
XMLPUBFUN xmlChar *XMLCALL xmlBuildQName(const xmlChar *ncname, const xmlChar *prefix, xmlChar *memory, int len)
xmlNode * xmlNodePtr
Definition: tree.h:488
@ XML_ATTRIBUTE_NODE
Definition: tree.h:161
@ XML_TEXT_NODE
Definition: tree.h:162
XMLPUBFUN xmlAttrPtr XMLCALL xmlNewNsPropEatName(xmlNodePtr node, xmlNsPtr ns, xmlChar *name, const xmlChar *value)
XMLPUBFUN xmlAttrPtr XMLCALL xmlNewNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name, const xmlChar *value)
XMLPUBFUN xmlNodePtr XMLCALL xmlStringLenGetNodeList(const xmlDoc *doc, const xmlChar *value, int len)
#define memset(x, y, z)
Definition: compat.h:39
Definition: tree.h:434
struct _xmlAttr * next
Definition: tree.h:441
Definition: tree.h:489
struct _xmlNode * next
Definition: tree.h:496
struct _xmlDoc * doc
Definition: tree.h:498
struct _xmlAttr * properties
Definition: tree.h:503
struct _xmlNode * parent
Definition: tree.h:495
Definition: tree.h:389
int replaceEntities
Definition: parser.h:189
int external
Definition: parser.h:217
int loadsubset
Definition: parser.h:258
const xmlChar * str_xml
Definition: parser.h:271
int freeAttrsNr
Definition: parser.h:295
int dictNames
Definition: parser.h:292
xmlHashTablePtr attsSpecial
Definition: parser.h:285
xmlAttrPtr freeAttrs
Definition: parser.h:296
xmlNodePtr node
Definition: parser.h:205
Definition: dlist.c:348
Definition: pdh_main.c:94
XMLPUBFUN xmlIDPtr XMLCALL xmlAddID(xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value, xmlAttrPtr attr)
Definition: valid.c:2672
XML_DEPRECATED XMLPUBFUN xmlRefPtr XMLCALL xmlAddRef(xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value, xmlAttrPtr attr)
Definition: valid.c:3003
XML_DEPRECATED XMLPUBFUN int XMLCALL xmlIsRef(xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr)
Definition: valid.c:3122
XMLPUBFUN int XMLCALL xmlIsID(xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr)
Definition: valid.c:2774
int ret
static GLenum _GLUfuncptr fn
Definition: wgl_font.c:159
@ XML_DTD_XMLID_VALUE
Definition: xmlerror.h:258
XMLPUBFUN xmlChar *XMLCALL xmlStrndup(const xmlChar *cur, int len)
Definition: xmlstring.c:42
XMLPUBFUN xmlChar *XMLCALL xmlStrdup(const xmlChar *cur)
Definition: xmlstring.c:67

Referenced by xmlSAX2StartElementNs().

◆ xmlSAX2CDataBlock()

void xmlSAX2CDataBlock ( void ctx,
const xmlChar value,
int  len 
)

xmlSAX2CDataBlock: @ctx: the user data (XML parser context) @value: The pcdata content @len: the block length

called when a pcdata block has been parsed

Definition at line 2816 of file SAX2.c.

2817{
2819}
static void xmlSAX2Text(xmlParserCtxtPtr ctxt, const xmlChar *ch, int len, xmlElementType type)
Definition: SAX2.c:2521
GLenum GLsizei len
Definition: glext.h:6722
@ XML_CDATA_SECTION_NODE
Definition: tree.h:163

Referenced by xmlSAXVersion().

◆ xmlSAX2Characters()

void xmlSAX2Characters ( void ctx,
const xmlChar ch,
int  len 
)

xmlSAX2Characters: @ctx: the user data (XML parser context) @ch: a xmlChar string @len: the number of xmlChar

receiving some chars from the parser.

Definition at line 2657 of file SAX2.c.

2658{
2660}

Referenced by xmlSAXVersion().

◆ xmlSAX2Comment()

void xmlSAX2Comment ( void ctx,
const xmlChar value 
)

xmlSAX2Comment: @ctx: the user data (XML parser context) @value: the xmlSAX2Comment content

A xmlSAX2Comment has been parsed.

Definition at line 2754 of file SAX2.c.

2755{
2759
2760 if (ctx == NULL) return;
2761 parent = ctxt->node;
2762#ifdef DEBUG_SAX
2763 xmlGenericError(xmlGenericErrorContext, "SAX.xmlSAX2Comment(%s)\n", value);
2764#endif
2765 ret = xmlNewDocComment(ctxt->myDoc, value);
2766 if (ret == NULL) return;
2767 if (ctxt->linenumbers) {
2768 if (ctxt->input != NULL) {
2769 if (ctxt->input->line < USHRT_MAX)
2770 ret->line = (unsigned short) ctxt->input->line;
2771 else
2772 ret->line = USHRT_MAX;
2773 }
2774 }
2775
2776 if (ctxt->inSubset == 1) {
2778 return;
2779 } else if (ctxt->inSubset == 2) {
2781 return;
2782 }
2783 if (parent == NULL) {
2784#ifdef DEBUG_SAX_TREE
2786 "Setting xmlSAX2Comment as root\n");
2787#endif
2789 return;
2790 }
2791 if (parent->type == XML_ELEMENT_NODE) {
2792#ifdef DEBUG_SAX_TREE
2794 "adding xmlSAX2Comment child to %s\n", parent->name);
2795#endif
2797 } else {
2798#ifdef DEBUG_SAX_TREE
2800 "adding xmlSAX2Comment sibling to ");
2801 xmlDebugDumpOneNode(stderr, parent, 0);
2802#endif
2804 }
2805}
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
r parent
Definition: btrfs.c:3010
#define USHRT_MAX
Definition: limits.h:38
#define stderr
Definition: stdio.h:100
XMLPUBFUN xmlNodePtr XMLCALL xmlAddChild(xmlNodePtr parent, xmlNodePtr cur)
@ XML_ELEMENT_NODE
Definition: tree.h:160
XMLPUBFUN xmlNodePtr XMLCALL xmlAddSibling(xmlNodePtr cur, xmlNodePtr elem)
XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocComment(xmlDocPtr doc, const xmlChar *content)
int linenumbers
Definition: parser.h:259
xmlParserInputPtr input
Definition: parser.h:199

Referenced by xmlSAXVersion().

◆ xmlSAX2ElementDecl()

void xmlSAX2ElementDecl ( void ctx,
const xmlChar name,
int  type,
xmlElementContentPtr  content 
)

Definition at line 746 of file SAX2.c.

748{
751
752 /* Avoid unused variable warning if features are disabled. */
753 (void) elem;
754
755 if ((ctxt == NULL) || (ctxt->myDoc == NULL))
756 return;
757
758#ifdef DEBUG_SAX
760 "SAX.xmlSAX2ElementDecl(%s, %d, ...)\n", name, type);
761#endif
762
763 if (ctxt->inSubset == 1)
764 elem = xmlAddElementDecl(&ctxt->vctxt, ctxt->myDoc->intSubset,
766 else if (ctxt->inSubset == 2)
767 elem = xmlAddElementDecl(&ctxt->vctxt, ctxt->myDoc->extSubset,
769 else {
770 xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
771 "SAX.xmlSAX2ElementDecl(%s) called while not in subset\n",
772 name, NULL);
773 return;
774 }
775#ifdef LIBXML_VALID_ENABLED
776 if (elem == NULL)
777 ctxt->valid = 0;
778 if (ctxt->validate && ctxt->wellFormed &&
779 ctxt->myDoc && ctxt->myDoc->intSubset)
780 ctxt->valid &=
781 xmlValidateElementDecl(&ctxt->vctxt, ctxt->myDoc, elem);
782#endif /* LIBXML_VALID_ENABLED */
783}
xmlElementTypeVal
Definition: tree.h:322
XMLPUBFUN xmlElementPtr XMLCALL xmlAddElementDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *name, xmlElementTypeVal type, xmlElementContentPtr content)
Definition: valid.c:1418

Referenced by xmlSAXVersion().

◆ xmlSAX2EndDocument()

void xmlSAX2EndDocument ( void ctx)

xmlSAX2EndDocument: @ctx: the user data (XML parser context)

called when the document end has been detected.

Definition at line 998 of file SAX2.c.

999{
1001#ifdef DEBUG_SAX
1003 "SAX.xmlSAX2EndDocument()\n");
1004#endif
1005 if (ctx == NULL) return;
1006#ifdef LIBXML_VALID_ENABLED
1007 if (ctxt->validate && ctxt->wellFormed &&
1008 ctxt->myDoc && ctxt->myDoc->intSubset)
1009 ctxt->valid &= xmlValidateDocumentFinal(&ctxt->vctxt, ctxt->myDoc);
1010#endif /* LIBXML_VALID_ENABLED */
1011
1012 /*
1013 * Grab the encoding if it was added on-the-fly
1014 */
1015 if ((ctxt->encoding != NULL) && (ctxt->myDoc != NULL) &&
1016 (ctxt->myDoc->encoding == NULL)) {
1017 ctxt->myDoc->encoding = ctxt->encoding;
1018 ctxt->encoding = NULL;
1019 }
1020 if ((ctxt->inputTab != NULL) &&
1021 (ctxt->inputNr > 0) && (ctxt->inputTab[0] != NULL) &&
1022 (ctxt->inputTab[0]->encoding != NULL) && (ctxt->myDoc != NULL) &&
1023 (ctxt->myDoc->encoding == NULL)) {
1024 ctxt->myDoc->encoding = xmlStrdup(ctxt->inputTab[0]->encoding);
1025 }
1026 if ((ctxt->charset != XML_CHAR_ENCODING_NONE) && (ctxt->myDoc != NULL) &&
1027 (ctxt->myDoc->charset == XML_CHAR_ENCODING_NONE)) {
1028 ctxt->myDoc->charset = ctxt->charset;
1029 }
1030}
@ XML_CHAR_ENCODING_NONE
Definition: encoding.h:58
int charset
Definition: tree.h:578
const xmlChar * encoding
Definition: tree.h:574
const xmlChar * encoding
Definition: parser.h:191
xmlParserInputPtr * inputTab
Definition: parser.h:202
const xmlChar * encoding
Definition: parser.h:71

Referenced by xmlSAXVersion().

◆ xmlSAX2EndElementNs()

void xmlSAX2EndElementNs ( void ctx,
const xmlChar *localname  ATTRIBUTE_UNUSED,
const xmlChar *prefix  ATTRIBUTE_UNUSED,
const xmlChar *URI  ATTRIBUTE_UNUSED 
)

xmlSAX2EndElementNs: @ctx: the user data (XML parser context) @localname: the local name of the element @prefix: the element namespace prefix if available @URI: the element namespace name if available

SAX2 callback when an element end has been detected by the parser. It provides the namespace information for the element.

Definition at line 2448 of file SAX2.c.

2452{
2454 xmlParserNodeInfo node_info;
2456
2457 if (ctx == NULL) return;
2458 cur = ctxt->node;
2459 /* Capture end position and add node */
2460 if ((ctxt->record_info) && (cur != NULL)) {
2461 node_info.end_pos = ctxt->input->cur - ctxt->input->base;
2462 node_info.end_line = ctxt->input->line;
2463 node_info.node = cur;
2464 xmlParserAddNodeInfo(ctxt, &node_info);
2465 }
2466 ctxt->nodemem = -1;
2467
2468#ifdef LIBXML_VALID_ENABLED
2469 if (ctxt->validate && ctxt->wellFormed &&
2470 ctxt->myDoc && ctxt->myDoc->intSubset)
2471 ctxt->valid &= xmlValidateOneElement(&ctxt->vctxt, ctxt->myDoc, cur);
2472#endif /* LIBXML_VALID_ENABLED */
2473
2474 /*
2475 * end of parsing of this node.
2476 */
2477 nodePop(ctxt);
2478}
FxCollectionEntry * cur
XMLPUBFUN xmlNodePtr XMLCALL nodePop(xmlParserCtxtPtr ctxt)
Definition: parser.c:1839
XMLPUBFUN void XMLCALL xmlParserAddNodeInfo(xmlParserCtxtPtr ctxt, const xmlParserNodeInfoPtr info)
int record_info
Definition: parser.h:210
const xmlChar * base
Definition: parser.h:58
const xmlChar * cur
Definition: parser.h:59
const struct _xmlNode * node
Definition: parser.h:88
unsigned long end_pos
Definition: parser.h:92
unsigned long end_line
Definition: parser.h:93

Referenced by xmlSAXVersion().

◆ xmlSAX2EntityDecl()

void xmlSAX2EntityDecl ( void ctx,
const xmlChar name,
int  type,
const xmlChar publicId,
const xmlChar systemId,
xmlChar content 
)

Definition at line 604 of file SAX2.c.

606{
607 xmlEntityPtr ent;
609
610 if (ctx == NULL) return;
611#ifdef DEBUG_SAX
613 "SAX.xmlSAX2EntityDecl(%s, %d, %s, %s, %s)\n",
614 name, type, publicId, systemId, content);
615#endif
616 if (ctxt->inSubset == 1) {
617 ent = xmlAddDocEntity(ctxt->myDoc, name, type, publicId,
618 systemId, content);
619 if ((ent == NULL) && (ctxt->pedantic))
620 xmlWarnMsg(ctxt, XML_WAR_ENTITY_REDEFINED,
621 "Entity(%s) already defined in the internal subset\n",
622 name);
623 if ((ent != NULL) && (ent->URI == NULL) && (systemId != NULL)) {
624 xmlChar *URI;
625 const char *base = NULL;
626
627 if (ctxt->input != NULL)
628 base = ctxt->input->filename;
629 if (base == NULL)
630 base = ctxt->directory;
631
632 URI = xmlBuildURI(systemId, (const xmlChar *) base);
633 ent->URI = URI;
634 }
635 } else if (ctxt->inSubset == 2) {
636 ent = xmlAddDtdEntity(ctxt->myDoc, name, type, publicId,
637 systemId, content);
638 if ((ent == NULL) && (ctxt->pedantic) &&
639 (ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
640 ctxt->sax->warning(ctxt->userData,
641 "Entity(%s) already defined in the external subset\n", name);
642 if ((ent != NULL) && (ent->URI == NULL) && (systemId != NULL)) {
643 xmlChar *URI;
644 const char *base = NULL;
645
646 if (ctxt->input != NULL)
647 base = ctxt->input->filename;
648 if (base == NULL)
649 base = ctxt->directory;
650
651 URI = xmlBuildURI(systemId, (const xmlChar *) base);
652 ent->URI = URI;
653 }
654 } else {
655 xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_PROCESSING,
656 "SAX.xmlSAX2EntityDecl(%s) called while not in subset\n",
657 name, NULL);
658 }
659}
XMLPUBFUN xmlEntityPtr XMLCALL xmlAddDocEntity(xmlDocPtr doc, const xmlChar *name, int type, const xmlChar *ExternalID, const xmlChar *SystemID, const xmlChar *content)
XMLPUBFUN xmlEntityPtr XMLCALL xmlAddDtdEntity(xmlDocPtr doc, const xmlChar *name, int type, const xmlChar *ExternalID, const xmlChar *SystemID, const xmlChar *content)
const xmlChar * URI
Definition: entities.h:57
char * directory
Definition: parser.h:226
struct _xmlSAXHandler * sax
Definition: parser.h:185
int pedantic
Definition: parser.h:255
void * userData
Definition: parser.h:186
const char * filename
Definition: parser.h:56
XMLPUBFUN xmlChar *XMLCALL xmlBuildURI(const xmlChar *URI, const xmlChar *base)
Definition: uri.c:1892
@ XML_WAR_ENTITY_REDEFINED
Definition: xmlerror.h:207
@ XML_ERR_ENTITY_PROCESSING
Definition: xmlerror.h:204

Referenced by xmlParseEntityDecl(), and xmlSAXVersion().

◆ xmlSAX2ExternalSubset()

void xmlSAX2ExternalSubset ( void ctx,
const xmlChar name,
const xmlChar ExternalID,
const xmlChar SystemID 
)

Definition at line 362 of file SAX2.c.

364{
366 if (ctx == NULL) return;
367#ifdef DEBUG_SAX
369 "SAX.xmlSAX2ExternalSubset(%s, %s, %s)\n",
370 name, ExternalID, SystemID);
371#endif
372 if (((ExternalID != NULL) || (SystemID != NULL)) &&
373 (((ctxt->validate) || (ctxt->loadsubset != 0)) &&
374 (ctxt->wellFormed && ctxt->myDoc))) {
375 /*
376 * Try to fetch and parse the external subset.
377 */
378 xmlParserInputPtr oldinput;
379 int oldinputNr;
380 int oldinputMax;
381 xmlParserInputPtr *oldinputTab;
383 xmlCharEncoding enc;
384 int oldcharset;
385 const xmlChar *oldencoding;
386
387 /*
388 * Ask the Entity resolver to load the damn thing
389 */
390 if ((ctxt->sax != NULL) && (ctxt->sax->resolveEntity != NULL))
391 input = ctxt->sax->resolveEntity(ctxt->userData, ExternalID,
392 SystemID);
393 if (input == NULL) {
394 return;
395 }
396
397 xmlNewDtd(ctxt->myDoc, name, ExternalID, SystemID);
398
399 /*
400 * make sure we won't destroy the main document context
401 */
402 oldinput = ctxt->input;
403 oldinputNr = ctxt->inputNr;
404 oldinputMax = ctxt->inputMax;
405 oldinputTab = ctxt->inputTab;
406 oldcharset = ctxt->charset;
407 oldencoding = ctxt->encoding;
408 ctxt->encoding = NULL;
409
410 ctxt->inputTab = (xmlParserInputPtr *)
411 xmlMalloc(5 * sizeof(xmlParserInputPtr));
412 if (ctxt->inputTab == NULL) {
413 xmlSAX2ErrMemory(ctxt, "xmlSAX2ExternalSubset");
414 ctxt->input = oldinput;
415 ctxt->inputNr = oldinputNr;
416 ctxt->inputMax = oldinputMax;
417 ctxt->inputTab = oldinputTab;
418 ctxt->charset = oldcharset;
419 ctxt->encoding = oldencoding;
420 return;
421 }
422 ctxt->inputNr = 0;
423 ctxt->inputMax = 5;
424 ctxt->input = NULL;
425 xmlPushInput(ctxt, input);
426
427 /*
428 * On the fly encoding conversion if needed
429 */
430 if (ctxt->input->length >= 4) {
431 enc = xmlDetectCharEncoding(ctxt->input->cur, 4);
432 xmlSwitchEncoding(ctxt, enc);
433 }
434
435 if (input->filename == NULL)
436 input->filename = (char *) xmlCanonicPath(SystemID);
437 input->line = 1;
438 input->col = 1;
439 input->base = ctxt->input->cur;
440 input->cur = ctxt->input->cur;
441 input->free = NULL;
442
443 /*
444 * let's parse that entity knowing it's an external subset.
445 */
446 xmlParseExternalSubset(ctxt, ExternalID, SystemID);
447
448 /*
449 * Free up the external entities
450 */
451
452 while (ctxt->inputNr > 1)
453 xmlPopInput(ctxt);
455 xmlFree(ctxt->inputTab);
456
457 /*
458 * Restore the parsing context of the main entity
459 */
460 ctxt->input = oldinput;
461 ctxt->inputNr = oldinputNr;
462 ctxt->inputMax = oldinputMax;
463 ctxt->inputTab = oldinputTab;
464 ctxt->charset = oldcharset;
465 if ((ctxt->encoding != NULL) &&
466 ((ctxt->dict == NULL) ||
467 (!xmlDictOwns(ctxt->dict, ctxt->encoding))))
468 xmlFree((xmlChar *) ctxt->encoding);
469 ctxt->encoding = oldencoding;
470 /* ctxt->wellFormed = oldwellFormed; */
471 }
472}
xmlCharEncoding
Definition: encoding.h:56
XMLPUBFUN xmlCharEncoding XMLCALL xmlDetectCharEncoding(const unsigned char *in, int len)
Definition: encoding.c:952
GLenum GLenum GLenum input
Definition: glext.h:9031
XMLPUBFUN void XMLCALL xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const xmlChar *ExternalID, const xmlChar *SystemID)
Definition: parser.c:6998
XMLPUBFUN xmlChar XMLCALL xmlPopInput(xmlParserCtxtPtr ctxt)
Definition: parser.c:2265
XMLPUBFUN int XMLCALL xmlSwitchEncoding(xmlParserCtxtPtr ctxt, xmlCharEncoding enc)
XMLPUBFUN int XMLCALL xmlPushInput(xmlParserCtxtPtr ctxt, xmlParserInputPtr input)
Definition: parser.c:2290
XMLPUBFUN void XMLCALL xmlFreeInputStream(xmlParserInputPtr input)
XMLPUBFUN int XMLCALL xmlDictOwns(xmlDictPtr dict, const xmlChar *str)
Definition: dict.c:1220
XMLPUBVAR xmlMallocFunc xmlMalloc
Definition: globals.h:248
XMLPUBFUN xmlDtdPtr XMLCALL xmlNewDtd(xmlDocPtr doc, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID)
int inputMax
Definition: parser.h:201
xmlDictPtr dict
Definition: parser.h:263
XMLPUBFUN xmlChar *XMLCALL xmlCanonicPath(const xmlChar *path)
Definition: uri.c:2380

Referenced by xmlSAXVersion().

◆ xmlSAX2GetColumnNumber()

int xmlSAX2GetColumnNumber ( void ctx)

xmlSAX2GetColumnNumber: @ctx: the user data (XML parser context)

Provide the column number of the current parsing point.

Returns an int

Definition at line 259 of file SAX2.c.

260{
262 if ((ctx == NULL) || (ctxt->input == NULL)) return(0);
263 return(ctxt->input->col);
264}

Referenced by xmlInitializeGlobalState().

◆ xmlSAX2GetEntity()

xmlEntityPtr xmlSAX2GetEntity ( void ctx,
const xmlChar name 
)

Definition at line 526 of file SAX2.c.

527{
530
531 if (ctx == NULL) return(NULL);
532#ifdef DEBUG_SAX
534 "SAX.xmlSAX2GetEntity(%s)\n", name);
535#endif
536
537 if (ctxt->inSubset == 0) {
539 if (ret != NULL)
540 return(ret);
541 }
542 if ((ctxt->myDoc != NULL) && (ctxt->myDoc->standalone == 1)) {
543 if (ctxt->inSubset == 2) {
544 ctxt->myDoc->standalone = 0;
545 ret = xmlGetDocEntity(ctxt->myDoc, name);
546 ctxt->myDoc->standalone = 1;
547 } else {
548 ret = xmlGetDocEntity(ctxt->myDoc, name);
549 if (ret == NULL) {
550 ctxt->myDoc->standalone = 0;
551 ret = xmlGetDocEntity(ctxt->myDoc, name);
552 if (ret != NULL) {
553 xmlFatalErrMsg(ctxt, XML_ERR_NOT_STANDALONE,
554 "Entity(%s) document marked standalone but requires external subset\n",
555 name, NULL);
556 }
557 ctxt->myDoc->standalone = 1;
558 }
559 }
560 } else {
561 ret = xmlGetDocEntity(ctxt->myDoc, name);
562 }
563 return(ret);
564}
XMLPUBFUN xmlEntityPtr XMLCALL xmlGetDocEntity(const xmlDoc *doc, const xmlChar *name)
XMLPUBFUN xmlEntityPtr XMLCALL xmlGetPredefinedEntity(const xmlChar *name)
int standalone
Definition: tree.h:564
@ XML_ERR_NOT_STANDALONE
Definition: xmlerror.h:203

Referenced by xmlParseEntityDecl(), xmlParseEntityRef(), xmlParseStringEntityRef(), and xmlSAXVersion().

◆ xmlSAX2GetLineNumber()

int xmlSAX2GetLineNumber ( void ctx)

xmlSAX2GetLineNumber: @ctx: the user data (XML parser context)

Provide the line number of the current parsing point.

Returns an int

Definition at line 243 of file SAX2.c.

244{
246 if ((ctx == NULL) || (ctxt->input == NULL)) return(0);
247 return(ctxt->input->line);
248}

Referenced by xmlInitializeGlobalState().

◆ xmlSAX2GetParameterEntity()

xmlEntityPtr xmlSAX2GetParameterEntity ( void ctx,
const xmlChar name 
)

Definition at line 576 of file SAX2.c.

577{
580
581 if (ctx == NULL) return(NULL);
582#ifdef DEBUG_SAX
584 "SAX.xmlSAX2GetParameterEntity(%s)\n", name);
585#endif
586
588 return(ret);
589}
XMLPUBFUN xmlEntityPtr XMLCALL xmlGetParameterEntity(xmlDocPtr doc, const xmlChar *name)

Referenced by xmlSAXVersion().

◆ xmlSAX2GetPublicId()

const xmlChar * xmlSAX2GetPublicId ( void *ctx  ATTRIBUTE_UNUSED)

xmlSAX2GetPublicId: @ctx: the user data (XML parser context)

Provides the public ID e.g. "-//SGMLSOURCE//DTD DEMO//EN"

Returns a xmlChar *

Definition at line 211 of file SAX2.c.

212{
213 /* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */
214 return(NULL);
215}

◆ xmlSAX2GetSystemId()

const xmlChar * xmlSAX2GetSystemId ( void ctx)

xmlSAX2GetSystemId: @ctx: the user data (XML parser context)

Provides the system ID, basically URL or filename e.g. http://www.sgmlsource.com/dtds/memo.dtd

Returns a xmlChar *

Definition at line 227 of file SAX2.c.

228{
230 if ((ctx == NULL) || (ctxt->input == NULL)) return(NULL);
231 return((const xmlChar *) ctxt->input->filename);
232}

Referenced by xmlInitializeGlobalState().

◆ xmlSAX2HasExternalSubset()

int xmlSAX2HasExternalSubset ( void ctx)

xmlSAX2HasExternalSubset: @ctx: the user data (XML parser context)

Does this document has an external subset

Returns 1 if true

Definition at line 307 of file SAX2.c.

308{
310 if ((ctxt == NULL) || (ctxt->myDoc == NULL)) return(0);
311 return(ctxt->myDoc->extSubset != NULL);
312}

Referenced by xmlSAXVersion().

◆ xmlSAX2HasInternalSubset()

int xmlSAX2HasInternalSubset ( void ctx)

xmlSAX2HasInternalSubset: @ctx: the user data (XML parser context)

Does this document has an internal subset

Returns 1 if true

Definition at line 291 of file SAX2.c.

292{
294 if ((ctxt == NULL) || (ctxt->myDoc == NULL)) return(0);
295 return(ctxt->myDoc->intSubset != NULL);
296}

Referenced by xmlSAXVersion().

◆ xmlSAX2IgnorableWhitespace()

void xmlSAX2IgnorableWhitespace ( void *ctx  ATTRIBUTE_UNUSED,
const xmlChar *ch  ATTRIBUTE_UNUSED,
int len  ATTRIBUTE_UNUSED 
)

xmlSAX2IgnorableWhitespace: @ctx: the user data (XML parser context) @ch: a xmlChar string @len: the number of xmlChar

receiving some ignorable whitespaces from the parser. UNUSED: by default the DOM building will use xmlSAX2Characters

Definition at line 2672 of file SAX2.c.

2673{
2674 /* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */
2675#ifdef DEBUG_SAX
2677 "SAX.xmlSAX2IgnorableWhitespace(%.30s, %d)\n", ch, len);
2678#endif
2679}

◆ xmlSAX2InitDefaultSAXHandler()

void xmlSAX2InitDefaultSAXHandler ( xmlSAXHandler hdlr,
int  warning 
)

xmlSAX2InitDefaultSAXHandler: @hdlr: the SAX handler

Warning
: flag if non-zero sets the handler warning procedure

Initialize the default XML SAX2 handler

Definition at line 2913 of file SAX2.c.

2914{
2915 if ((hdlr == NULL) || (hdlr->initialized != 0))
2916 return;
2917
2919 if (warning == 0)
2920 hdlr->warning = NULL;
2921 else
2922 hdlr->warning = xmlParserWarning;
2923}
static int xmlSAX2DefaultVersionValue
Definition: SAX2.c:2821
#define warning(s)
Definition: debug.h:83
warningSAXFunc warning
Definition: parser.h:741
unsigned int initialized
Definition: parser.h:747
XMLPUBFUN void XMLCDECL XMLPUBFUN void XMLCDECL xmlParserWarning(void *ctx, const char *msg,...) LIBXML_ATTR_FORMAT(2

◆ xmlSAX2InternalSubset()

void xmlSAX2InternalSubset ( void ctx,
const xmlChar name,
const xmlChar ExternalID,
const xmlChar SystemID 
)

Definition at line 324 of file SAX2.c.

326{
328 xmlDtdPtr dtd;
329 if (ctx == NULL) return;
330#ifdef DEBUG_SAX
332 "SAX.xmlSAX2InternalSubset(%s, %s, %s)\n",
333 name, ExternalID, SystemID);
334#endif
335
336 if (ctxt->myDoc == NULL)
337 return;
338 dtd = xmlGetIntSubset(ctxt->myDoc);
339 if (dtd != NULL) {
340 if (ctxt->html)
341 return;
343 xmlFreeDtd(dtd);
344 ctxt->myDoc->intSubset = NULL;
345 }
346 ctxt->myDoc->intSubset =
347 xmlCreateIntSubset(ctxt->myDoc, name, ExternalID, SystemID);
348 if (ctxt->myDoc->intSubset == NULL)
349 xmlSAX2ErrMemory(ctxt, "xmlSAX2InternalSubset");
350}
XMLPUBFUN xmlDtdPtr XMLCALL xmlCreateIntSubset(xmlDocPtr doc, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID)
XMLPUBFUN void XMLCALL xmlFreeDtd(xmlDtdPtr cur)
XMLPUBFUN xmlDtdPtr XMLCALL xmlGetIntSubset(const xmlDoc *doc)
XMLPUBFUN void XMLCALL xmlUnlinkNode(xmlNodePtr cur)
Definition: tree.h:406

Referenced by xmlSAXVersion().

◆ xmlSAX2IsStandalone()

int xmlSAX2IsStandalone ( void ctx)

xmlSAX2IsStandalone: @ctx: the user data (XML parser context)

Is this document tagged standalone ?

Returns 1 if true

Definition at line 275 of file SAX2.c.

276{
278 if ((ctx == NULL) || (ctxt->myDoc == NULL)) return(0);
279 return(ctxt->myDoc->standalone == 1);
280}

Referenced by xmlSAXVersion().

◆ xmlSAX2NotationDecl()

void xmlSAX2NotationDecl ( void ctx,
const xmlChar name,
const xmlChar publicId,
const xmlChar systemId 
)

Definition at line 795 of file SAX2.c.

797{
799 xmlNotationPtr nota = NULL;
800
801 /* Avoid unused variable warning if features are disabled. */
802 (void) nota;
803
804 if ((ctxt == NULL) || (ctxt->myDoc == NULL))
805 return;
806
807#ifdef DEBUG_SAX
809 "SAX.xmlSAX2NotationDecl(%s, %s, %s)\n", name, publicId, systemId);
810#endif
811
812 if ((publicId == NULL) && (systemId == NULL)) {
813 xmlFatalErrMsg(ctxt, XML_ERR_NOTATION_PROCESSING,
814 "SAX.xmlSAX2NotationDecl(%s) externalID or PublicID missing\n",
815 name, NULL);
816 return;
817 } else if (ctxt->inSubset == 1)
818 nota = xmlAddNotationDecl(&ctxt->vctxt, ctxt->myDoc->intSubset, name,
819 publicId, systemId);
820 else if (ctxt->inSubset == 2)
821 nota = xmlAddNotationDecl(&ctxt->vctxt, ctxt->myDoc->extSubset, name,
822 publicId, systemId);
823 else {
824 xmlFatalErrMsg(ctxt, XML_ERR_NOTATION_PROCESSING,
825 "SAX.xmlSAX2NotationDecl(%s) called while not in subset\n",
826 name, NULL);
827 return;
828 }
829#ifdef LIBXML_VALID_ENABLED
830 if (nota == NULL) ctxt->valid = 0;
831 if ((ctxt->validate) && (ctxt->wellFormed) &&
832 (ctxt->myDoc->intSubset != NULL))
833 ctxt->valid &= xmlValidateNotationDecl(&ctxt->vctxt, ctxt->myDoc,
834 nota);
835#endif /* LIBXML_VALID_ENABLED */
836}
XMLPUBFUN xmlNotationPtr XMLCALL xmlAddNotationDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *name, const xmlChar *PublicID, const xmlChar *SystemID)
Definition: valid.c:2394
@ XML_ERR_NOTATION_PROCESSING
Definition: xmlerror.h:205

Referenced by xmlSAXVersion().

◆ xmlSAX2ProcessingInstruction()

void xmlSAX2ProcessingInstruction ( void ctx,
const xmlChar target,
const xmlChar data 
)

xmlSAX2ProcessingInstruction: @ctx: the user data (XML parser context) @target: the target name @data: the PI data's

A processing instruction has been parsed.

Definition at line 2690 of file SAX2.c.

2692{
2696
2697 if (ctx == NULL) return;
2698 parent = ctxt->node;
2699#ifdef DEBUG_SAX
2701 "SAX.xmlSAX2ProcessingInstruction(%s, %s)\n", target, data);
2702#endif
2703
2704 ret = xmlNewDocPI(ctxt->myDoc, target, data);
2705 if (ret == NULL) return;
2706
2707 if (ctxt->linenumbers) {
2708 if (ctxt->input != NULL) {
2709 if (ctxt->input->line < USHRT_MAX)
2710 ret->line = (unsigned short) ctxt->input->line;
2711 else
2712 ret->line = USHRT_MAX;
2713 }
2714 }
2715 if (ctxt->inSubset == 1) {
2717 return;
2718 } else if (ctxt->inSubset == 2) {
2720 return;
2721 }
2722 if (parent == NULL) {
2723#ifdef DEBUG_SAX_TREE
2725 "Setting PI %s as root\n", target);
2726#endif
2728 return;
2729 }
2730 if (parent->type == XML_ELEMENT_NODE) {
2731#ifdef DEBUG_SAX_TREE
2733 "adding PI %s child to %s\n", target, parent->name);
2734#endif
2736 } else {
2737#ifdef DEBUG_SAX_TREE
2739 "adding PI %s sibling to ", target);
2740 xmlDebugDumpOneNode(stderr, parent, 0);
2741#endif
2743 }
2744}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLenum target
Definition: glext.h:7315
XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocPI(xmlDocPtr doc, const xmlChar *name, const xmlChar *content)

Referenced by xmlSAXVersion().

◆ xmlSAX2Reference()

void xmlSAX2Reference ( void ctx,
const xmlChar name 
)

Definition at line 2488 of file SAX2.c.

2489{
2492
2493 if (ctx == NULL) return;
2494#ifdef DEBUG_SAX
2496 "SAX.xmlSAX2Reference(%s)\n", name);
2497#endif
2498 if (name[0] == '#')
2499 ret = xmlNewCharRef(ctxt->myDoc, name);
2500 else
2501 ret = xmlNewReference(ctxt->myDoc, name);
2502#ifdef DEBUG_SAX_TREE
2504 "add xmlSAX2Reference %s to %s \n", name, ctxt->node->name);
2505#endif
2506 if (xmlAddChild(ctxt->node, ret) == NULL) {
2508 }
2509}
XMLPUBFUN xmlNodePtr XMLCALL xmlNewReference(const xmlDoc *doc, const xmlChar *name)
XMLPUBFUN xmlNodePtr XMLCALL xmlNewCharRef(xmlDocPtr doc, const xmlChar *name)
XMLPUBFUN void XMLCALL xmlFreeNode(xmlNodePtr cur)
const xmlChar * name
Definition: tree.h:492

Referenced by xmlSAXVersion().

◆ xmlSAX2ResolveEntity()

xmlParserInputPtr xmlSAX2ResolveEntity ( void ctx,
const xmlChar publicId,
const xmlChar systemId 
)

xmlSAX2ResolveEntity: @ctx: the user data (XML parser context) @publicId: The public ID of the entity @systemId: The system ID of the entity

The entity loader, to control the loading of external entities, the application can either:

Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.

Definition at line 489 of file SAX2.c.

490{
493 xmlChar *URI;
494 const char *base = NULL;
495
496 if (ctx == NULL) return(NULL);
497 if (ctxt->input != NULL)
498 base = ctxt->input->filename;
499 if (base == NULL)
500 base = ctxt->directory;
501
502 URI = xmlBuildURI(systemId, (const xmlChar *) base);
503
504#ifdef DEBUG_SAX
506 "SAX.xmlSAX2ResolveEntity(%s, %s)\n", publicId, systemId);
507#endif
508
509 ret = xmlLoadExternalEntity((const char *) URI,
510 (const char *) publicId, ctxt);
511 if (URI != NULL)
512 xmlFree(URI);
513 return(ret);
514}
XMLPUBFUN xmlParserInputPtr XMLCALL xmlLoadExternalEntity(const char *URL, const char *ID, xmlParserCtxtPtr ctxt)

Referenced by xmlSAXVersion().

◆ xmlSAX2SetDocumentLocator()

void xmlSAX2SetDocumentLocator ( void *ctx  ATTRIBUTE_UNUSED,
xmlSAXLocatorPtr loc  ATTRIBUTE_UNUSED 
)

xmlSAX2SetDocumentLocator: @ctx: the user data (XML parser context) @loc: A SAX Locator

Receive the document locator at startup, actually xmlDefaultSAXLocator Everything is available on the context, so this is useless in our case.

Definition at line 917 of file SAX2.c.

918{
919 /* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */
920#ifdef DEBUG_SAX
922 "SAX.xmlSAX2SetDocumentLocator()\n");
923#endif
924}

Referenced by xmlSAXVersion().

◆ xmlSAX2StartDocument()

void xmlSAX2StartDocument ( void ctx)

xmlSAX2StartDocument: @ctx: the user data (XML parser context)

called when the document start being processed.

Definition at line 933 of file SAX2.c.

934{
936 xmlDocPtr doc;
937
938 if (ctx == NULL) return;
939
940#ifdef DEBUG_SAX
942 "SAX.xmlSAX2StartDocument()\n");
943#endif
944 if (ctxt->html) {
945#ifdef LIBXML_HTML_ENABLED
946 if (ctxt->myDoc == NULL)
947 ctxt->myDoc = htmlNewDocNoDtD(NULL, NULL);
948 if (ctxt->myDoc == NULL) {
949 xmlSAX2ErrMemory(ctxt, "xmlSAX2StartDocument");
950 return;
951 }
953 ctxt->myDoc->parseFlags = ctxt->options;
954#else
956 "libxml2 built without HTML support\n");
958 ctxt->instate = XML_PARSER_EOF;
959 ctxt->disableSAX = 1;
960 return;
961#endif
962 } else {
963 doc = ctxt->myDoc = xmlNewDoc(ctxt->version);
964 if (doc != NULL) {
965 doc->properties = 0;
966 if (ctxt->options & XML_PARSE_OLD10)
968 doc->parseFlags = ctxt->options;
969 if (ctxt->encoding != NULL)
970 doc->encoding = xmlStrdup(ctxt->encoding);
971 else
972 doc->encoding = NULL;
973 doc->standalone = ctxt->standalone;
974 } else {
975 xmlSAX2ErrMemory(ctxt, "xmlSAX2StartDocument");
976 return;
977 }
978 if ((ctxt->dictNames) && (doc != NULL)) {
979 doc->dict = ctxt->dict;
981 }
982 }
983 if ((ctxt->myDoc != NULL) && (ctxt->myDoc->URL == NULL) &&
984 (ctxt->input != NULL) && (ctxt->input->filename != NULL)) {
985 ctxt->myDoc->URL = xmlPathToURI((const xmlChar *)ctxt->input->filename);
986 if (ctxt->myDoc->URL == NULL)
987 xmlSAX2ErrMemory(ctxt, "xmlSAX2StartDocument");
988 }
989}
XMLPUBFUN int XMLCALL xmlDictReference(xmlDictPtr dict)
Definition: dict.c:647
@ XML_PARSE_OLD10
Definition: parser.h:1112
XMLPUBFUN xmlDocPtr XMLCALL xmlNewDoc(const xmlChar *version)
@ XML_DOC_HTML
Definition: tree.h:541
@ XML_DOC_OLD10
Definition: tree.h:535
Definition: tree.h:551
const xmlChar * URL
Definition: tree.h:577
int parseFlags
Definition: tree.h:582
int properties
Definition: tree.h:584
struct _xmlDict * dict
Definition: tree.h:580
int disableSAX
Definition: parser.h:237
xmlParserInputState instate
Definition: parser.h:223
const xmlChar * version
Definition: parser.h:190
int standalone
Definition: parser.h:192
XMLPUBFUN xmlChar *XMLCALL xmlPathToURI(const xmlChar *path)
Definition: uri.c:2521

Referenced by xmlSAXVersion().

◆ xmlSAX2StartElementNs()

void xmlSAX2StartElementNs ( void ctx,
const xmlChar localname,
const xmlChar prefix,
const xmlChar URI,
int  nb_namespaces,
const xmlChar **  namespaces,
int  nb_attributes,
int  nb_defaulted,
const xmlChar **  attributes 
)

xmlSAX2StartElementNs: @ctx: the user data (XML parser context) @localname: the local name of the element @prefix: the element namespace prefix if available @URI: the element namespace name if available @nb_namespaces: number of namespace definitions on that node @namespaces: pointer to the array of prefix/URI pairs namespace definitions @nb_attributes: the number of attributes on that node @nb_defaulted: the number of defaulted attributes. @attributes: pointer to the array of (localname/prefix/URI/value/end) attribute values.

SAX2 callback when an element start has been detected by the parser. It provides the namespace information for the element, as well as the new namespace declarations on the element.

Definition at line 2195 of file SAX2.c.

2204{
2208 xmlNsPtr last = NULL, ns;
2209 const xmlChar *uri, *pref;
2210 xmlChar *lname = NULL;
2211 int i, j;
2212
2213 if (ctx == NULL) return;
2214 parent = ctxt->node;
2215 /*
2216 * First check on validity:
2217 */
2218 if (ctxt->validate && (ctxt->myDoc->extSubset == NULL) &&
2219 ((ctxt->myDoc->intSubset == NULL) ||
2220 ((ctxt->myDoc->intSubset->notations == NULL) &&
2221 (ctxt->myDoc->intSubset->elements == NULL) &&
2222 (ctxt->myDoc->intSubset->attributes == NULL) &&
2223 (ctxt->myDoc->intSubset->entities == NULL)))) {
2224 xmlErrValid(ctxt, XML_DTD_NO_DTD,
2225 "Validation failed: no DTD found !", NULL, NULL);
2226 ctxt->validate = 0;
2227 }
2228
2229 /*
2230 * Take care of the rare case of an undefined namespace prefix
2231 */
2232 if ((prefix != NULL) && (URI == NULL)) {
2233 if (ctxt->dictNames) {
2234 const xmlChar *fullname;
2235
2236 fullname = xmlDictQLookup(ctxt->dict, prefix, localname);
2237 if (fullname != NULL)
2238 localname = fullname;
2239 } else {
2240 lname = xmlBuildQName(localname, prefix, NULL, 0);
2241 }
2242 }
2243 /*
2244 * allocate the node
2245 */
2246 if (ctxt->freeElems != NULL) {
2247 ret = ctxt->freeElems;
2248 ctxt->freeElems = ret->next;
2249 ctxt->freeElemsNr--;
2250 memset(ret, 0, sizeof(xmlNode));
2251 ret->doc = ctxt->myDoc;
2252 ret->type = XML_ELEMENT_NODE;
2253
2254 if (ctxt->dictNames)
2255 ret->name = localname;
2256 else {
2257 if (lname == NULL)
2258 ret->name = xmlStrdup(localname);
2259 else
2260 ret->name = lname;
2261 if (ret->name == NULL) {
2262 xmlSAX2ErrMemory(ctxt, "xmlSAX2StartElementNs");
2263 return;
2264 }
2265 }
2268 } else {
2269 if (ctxt->dictNames)
2271 (xmlChar *) localname, NULL);
2272 else if (lname == NULL)
2273 ret = xmlNewDocNode(ctxt->myDoc, NULL, localname, NULL);
2274 else
2276 (xmlChar *) lname, NULL);
2277 if (ret == NULL) {
2278 xmlSAX2ErrMemory(ctxt, "xmlSAX2StartElementNs");
2279 return;
2280 }
2281 }
2282 if (ctxt->linenumbers) {
2283 if (ctxt->input != NULL) {
2284 if (ctxt->input->line < USHRT_MAX)
2285 ret->line = (unsigned short) ctxt->input->line;
2286 else
2287 ret->line = USHRT_MAX;
2288 }
2289 }
2290
2291 if (parent == NULL) {
2293 }
2294 /*
2295 * Build the namespace list
2296 */
2297 for (i = 0,j = 0;j < nb_namespaces;j++) {
2298 pref = namespaces[i++];
2299 uri = namespaces[i++];
2300 ns = xmlNewNs(NULL, uri, pref);
2301 if (ns != NULL) {
2302 if (last == NULL) {
2303 ret->nsDef = last = ns;
2304 } else {
2305 last->next = ns;
2306 last = ns;
2307 }
2308 if ((URI != NULL) && (prefix == pref))
2309 ret->ns = ns;
2310 } else {
2311 /*
2312 * any out of memory error would already have been raised
2313 * but we can't be guaranteed it's the actual error due to the
2314 * API, best is to skip in this case
2315 */
2316 continue;
2317 }
2318#ifdef LIBXML_VALID_ENABLED
2319 if ((!ctxt->html) && ctxt->validate && ctxt->wellFormed &&
2320 ctxt->myDoc && ctxt->myDoc->intSubset) {
2321 ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc,
2322 ret, prefix, ns, uri);
2323 }
2324#endif /* LIBXML_VALID_ENABLED */
2325 }
2326 ctxt->nodemem = -1;
2327
2328 /*
2329 * We are parsing a new node.
2330 */
2331 if (nodePush(ctxt, ret) < 0) {
2334 return;
2335 }
2336
2337 /*
2338 * Link the child element
2339 */
2340 if (parent != NULL) {
2341 if (parent->type == XML_ELEMENT_NODE) {
2343 } else {
2345 }
2346 }
2347
2348 /*
2349 * Insert the defaulted attributes from the DTD only if requested:
2350 */
2351 if ((nb_defaulted != 0) &&
2352 ((ctxt->loadsubset & XML_COMPLETE_ATTRS) == 0))
2353 nb_attributes -= nb_defaulted;
2354
2355 /*
2356 * Search the namespace if it wasn't already found
2357 * Note that, if prefix is NULL, this searches for the default Ns
2358 */
2359 if ((URI != NULL) && (ret->ns == NULL)) {
2360 ret->ns = xmlSearchNs(ctxt->myDoc, parent, prefix);
2361 if ((ret->ns == NULL) && (xmlStrEqual(prefix, BAD_CAST "xml"))) {
2362 ret->ns = xmlSearchNs(ctxt->myDoc, ret, prefix);
2363 }
2364 if (ret->ns == NULL) {
2365 ns = xmlNewNs(ret, NULL, prefix);
2366 if (ns == NULL) {
2367
2368 xmlSAX2ErrMemory(ctxt, "xmlSAX2StartElementNs");
2369 return;
2370 }
2371 if (prefix != NULL)
2372 xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
2373 "Namespace prefix %s was not found\n",
2374 prefix, NULL);
2375 else
2376 xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
2377 "Namespace default prefix was not found\n",
2378 NULL, NULL);
2379 }
2380 }
2381
2382 /*
2383 * process all the other attributes
2384 */
2385 if (nb_attributes > 0) {
2386 for (j = 0,i = 0;i < nb_attributes;i++,j+=5) {
2387 /*
2388 * Handle the rare case of an undefined attribute prefix
2389 */
2390 if ((attributes[j+1] != NULL) && (attributes[j+2] == NULL)) {
2391 if (ctxt->dictNames) {
2392 const xmlChar *fullname;
2393
2394 fullname = xmlDictQLookup(ctxt->dict, attributes[j+1],
2395 attributes[j]);
2396 if (fullname != NULL) {
2398 attributes[j+3], attributes[j+4]);
2399 continue;
2400 }
2401 } else {
2402 lname = xmlBuildQName(attributes[j], attributes[j+1],
2403 NULL, 0);
2404 if (lname != NULL) {
2405 xmlSAX2AttributeNs(ctxt, lname, NULL,
2406 attributes[j+3], attributes[j+4]);
2407 xmlFree(lname);
2408 continue;
2409 }
2410 }
2411 }
2412 xmlSAX2AttributeNs(ctxt, attributes[j], attributes[j+1],
2413 attributes[j+3], attributes[j+4]);
2414 }
2415 }
2416
2417#ifdef LIBXML_VALID_ENABLED
2418 /*
2419 * If it's the Document root, finish the DTD validation and
2420 * check the document root element for validity
2421 */
2422 if ((ctxt->validate) &&
2423 ((ctxt->vctxt.flags & XML_VCTXT_DTD_VALIDATED) == 0)) {
2424 int chk;
2425
2426 chk = xmlValidateDtdFinal(&ctxt->vctxt, ctxt->myDoc);
2427 if (chk <= 0)
2428 ctxt->valid = 0;
2429 if (chk < 0)
2430 ctxt->wellFormed = 0;
2431 ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
2432 ctxt->vctxt.flags |= XML_VCTXT_DTD_VALIDATED;
2433 }
2434#endif /* LIBXML_VALID_ENABLED */
2435}
static void xmlSAX2AttributeNs(xmlParserCtxtPtr ctxt, const xmlChar *localname, const xmlChar *prefix, const xmlChar *value, const xmlChar *valueend)
Definition: SAX2.c:1967
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
POINT last
Definition: font.c:46
const char * uri
Definition: sec_mgr.c:1588
XMLPUBFUN int XMLCALL nodePush(xmlParserCtxtPtr ctxt, xmlNodePtr value)
Definition: parser.c:1801
XMLPUBFUN const xmlChar *XMLCALL xmlDictQLookup(xmlDictPtr dict, const xmlChar *prefix, const xmlChar *name)
Definition: dict.c:1115
#define XML_COMPLETE_ATTRS
Definition: parser.h:146
XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocNode(xmlDocPtr doc, xmlNsPtr ns, const xmlChar *name, const xmlChar *content)
XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocNodeEatName(xmlDocPtr doc, xmlNsPtr ns, xmlChar *name, const xmlChar *content)
XMLPUBFUN xmlNsPtr XMLCALL xmlNewNs(xmlNodePtr node, const xmlChar *href, const xmlChar *prefix)
int freeElemsNr
Definition: parser.h:293
xmlNodePtr freeElems
Definition: parser.h:294
Definition: mxnamespace.c:45
@ XML_DTD_NO_DTD
Definition: xmlerror.h:241
@ XML_NS_ERR_UNDEFINED_NAMESPACE
Definition: xmlerror.h:214

Referenced by xmlSAXVersion().

◆ xmlSAX2Text()

static void xmlSAX2Text ( xmlParserCtxtPtr  ctxt,
const xmlChar ch,
int  len,
xmlElementType  type 
)
static

xmlSAX2Text: @ctx: the user data (XML parser context) @ch: a xmlChar string @len: the number of xmlChar @type: text or cdata

Append characters.

Definition at line 2521 of file SAX2.c.

2523{
2524 xmlNodePtr lastChild;
2525
2526 if (ctxt == NULL) return;
2527#ifdef DEBUG_SAX
2529 "SAX.xmlSAX2Characters(%.30s, %d)\n", ch, len);
2530#endif
2531 /*
2532 * Handle the data if any. If there is no child
2533 * add it as content, otherwise if the last child is text,
2534 * concatenate it, else create a new node of type text.
2535 */
2536
2537 if (ctxt->node == NULL) {
2538#ifdef DEBUG_SAX_TREE
2540 "add chars: ctxt->node == NULL !\n");
2541#endif
2542 return;
2543 }
2544 lastChild = ctxt->node->last;
2545#ifdef DEBUG_SAX_TREE
2547 "add chars to %s \n", ctxt->node->name);
2548#endif
2549
2550 /*
2551 * Here we needed an accelerator mechanism in case of very large
2552 * elements. Use an attribute in the structure !!!
2553 */
2554 if (lastChild == NULL) {
2555 if (type == XML_TEXT_NODE)
2556 lastChild = xmlSAX2TextNode(ctxt, ch, len);
2557 else
2558 lastChild = xmlNewCDataBlock(ctxt->myDoc, ch, len);
2559 if (lastChild != NULL) {
2560 ctxt->node->children = lastChild;
2561 ctxt->node->last = lastChild;
2562 lastChild->parent = ctxt->node;
2563 lastChild->doc = ctxt->node->doc;
2564 ctxt->nodelen = len;
2565 ctxt->nodemem = len + 1;
2566 } else {
2567 xmlSAX2ErrMemory(ctxt, "xmlSAX2Characters");
2568 return;
2569 }
2570 } else {
2571 int coalesceText = (lastChild != NULL) &&
2572 (lastChild->type == type) &&
2573 ((type != XML_TEXT_NODE) ||
2574 (lastChild->name == xmlStringText));
2575 if ((coalesceText) && (ctxt->nodemem != 0)) {
2576 /*
2577 * The whole point of maintaining nodelen and nodemem,
2578 * xmlTextConcat is too costly, i.e. compute length,
2579 * reallocate a new buffer, move data, append ch. Here
2580 * We try to minimize realloc() uses and avoid copying
2581 * and recomputing length over and over.
2582 */
2583 if (lastChild->content == (xmlChar *)&(lastChild->properties)) {
2584 lastChild->content = xmlStrdup(lastChild->content);
2585 lastChild->properties = NULL;
2586 } else if ((ctxt->nodemem == ctxt->nodelen + 1) &&
2587 (xmlDictOwns(ctxt->dict, lastChild->content))) {
2588 lastChild->content = xmlStrdup(lastChild->content);
2589 }
2590 if (lastChild->content == NULL) {
2591 xmlSAX2ErrMemory(ctxt, "xmlSAX2Characters: xmlStrdup returned NULL");
2592 return;
2593 }
2594 if (ctxt->nodelen > INT_MAX - len) {
2595 xmlSAX2ErrMemory(ctxt, "xmlSAX2Characters overflow prevented");
2596 return;
2597 }
2598 if ((ctxt->nodelen + len > XML_MAX_TEXT_LENGTH) &&
2599 ((ctxt->options & XML_PARSE_HUGE) == 0)) {
2600 xmlSAX2ErrMemory(ctxt, "xmlSAX2Characters: huge text node");
2601 return;
2602 }
2603 if (ctxt->nodelen + len >= ctxt->nodemem) {
2604 xmlChar *newbuf;
2605 int size;
2606
2607 size = ctxt->nodemem > INT_MAX - len ?
2608 INT_MAX :
2609 ctxt->nodemem + len;
2610 size = size > INT_MAX / 2 ? INT_MAX : size * 2;
2611 newbuf = (xmlChar *) xmlRealloc(lastChild->content,size);
2612 if (newbuf == NULL) {
2613 xmlSAX2ErrMemory(ctxt, "xmlSAX2Characters");
2614 return;
2615 }
2616 ctxt->nodemem = size;
2617 lastChild->content = newbuf;
2618 }
2619 memcpy(&lastChild->content[ctxt->nodelen], ch, len);
2620 ctxt->nodelen += len;
2621 lastChild->content[ctxt->nodelen] = 0;
2622 } else if (coalesceText) {
2623 if (xmlTextConcat(lastChild, ch, len)) {
2624 xmlSAX2ErrMemory(ctxt, "xmlSAX2Characters");
2625 }
2626 if (ctxt->node->children != NULL) {
2627 ctxt->nodelen = xmlStrlen(lastChild->content);
2628 ctxt->nodemem = ctxt->nodelen + 1;
2629 }
2630 } else {
2631 /* Mixed content, first time */
2632 if (type == XML_TEXT_NODE) {
2633 lastChild = xmlSAX2TextNode(ctxt, ch, len);
2634 lastChild->doc = ctxt->myDoc;
2635 } else
2636 lastChild = xmlNewCDataBlock(ctxt->myDoc, ch, len);
2637 if (lastChild != NULL) {
2638 xmlAddChild(ctxt->node, lastChild);
2639 if (ctxt->node->children != NULL) {
2640 ctxt->nodelen = len;
2641 ctxt->nodemem = len + 1;
2642 }
2643 }
2644 }
2645 }
2646}
GLsizeiptr size
Definition: glext.h:5919
#define INT_MAX
Definition: limits.h:40
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define XML_MAX_TEXT_LENGTH
XMLPUBVAR const xmlChar xmlStringText[]
XMLPUBVAR xmlReallocFunc xmlRealloc
Definition: globals.h:250
@ XML_PARSE_HUGE
Definition: parser.h:1114
XMLPUBFUN int XMLCALL xmlTextConcat(xmlNodePtr node, const xmlChar *content, int len)
XMLPUBFUN xmlNodePtr XMLCALL xmlNewCDataBlock(xmlDocPtr doc, const xmlChar *content, int len)
xmlChar * content
Definition: tree.h:502
struct _xmlNode * children
Definition: tree.h:493
struct _xmlNode * last
Definition: tree.h:494
xmlElementType type
Definition: tree.h:491
XMLPUBFUN int XMLCALL xmlStrlen(const xmlChar *str)
Definition: xmlstring.c:426

Referenced by xmlSAX2CDataBlock(), and xmlSAX2Characters().

◆ xmlSAX2TextNode()

static xmlNodePtr xmlSAX2TextNode ( xmlParserCtxtPtr  ctxt,
const xmlChar str,
int  len 
)
static

Definition at line 1844 of file SAX2.c.

1844 {
1846 const xmlChar *intern = NULL;
1847
1848 /*
1849 * Allocate
1850 */
1851 if (ctxt->freeElems != NULL) {
1852 ret = ctxt->freeElems;
1853 ctxt->freeElems = ret->next;
1854 ctxt->freeElemsNr--;
1855 } else {
1856 ret = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
1857 }
1858 if (ret == NULL) {
1859 xmlErrMemory(ctxt, "xmlSAX2Characters");
1860 return(NULL);
1861 }
1862 memset(ret, 0, sizeof(xmlNode));
1863 /*
1864 * intern the formatting blanks found between tags, or the
1865 * very short strings
1866 */
1867 if (ctxt->dictNames) {
1868 xmlChar cur = str[len];
1869
1870 if ((len < (int) (2 * sizeof(void *))) &&
1871 (ctxt->options & XML_PARSE_COMPACT)) {
1872 /* store the string in the node overriding properties and nsDef */
1873 xmlChar *tmp = (xmlChar *) &(ret->properties);
1874 memcpy(tmp, str, len);
1875 tmp[len] = 0;
1876 intern = tmp;
1877 } else if ((len <= 3) && ((cur == '"') || (cur == '\'') ||
1878 ((cur == '<') && (str[len + 1] != '!')))) {
1879 intern = xmlDictLookup(ctxt->dict, str, len);
1880 } else if (IS_BLANK_CH(*str) && (len < 60) && (cur == '<') &&
1881 (str[len + 1] != '!')) {
1882 int i;
1883
1884 for (i = 1;i < len;i++) {
1885 if (!IS_BLANK_CH(str[i])) goto skip;
1886 }
1887 intern = xmlDictLookup(ctxt->dict, str, len);
1888 }
1889 }
1890skip:
1891 ret->type = XML_TEXT_NODE;
1892
1893 ret->name = xmlStringText;
1894 if (intern == NULL) {
1895 ret->content = xmlStrndup(str, len);
1896 if (ret->content == NULL) {
1897 xmlSAX2ErrMemory(ctxt, "xmlSAX2TextNode");
1898 xmlFree(ret);
1899 return(NULL);
1900 }
1901 } else
1902 ret->content = (xmlChar *) intern;
1903
1904 if (ctxt->linenumbers) {
1905 if (ctxt->input != NULL) {
1906 if (ctxt->input->line < USHRT_MAX)
1907 ret->line = (unsigned short) ctxt->input->line;
1908 else {
1909 ret->line = USHRT_MAX;
1911 ret->psvi = (void *) (ptrdiff_t) ctxt->input->line;
1912 }
1913 }
1914 }
1915
1918 return(ret);
1919}
#define skip(...)
Definition: atltest.h:64
__kernel_ptrdiff_t ptrdiff_t
Definition: linux.h:247
if(dx< 0)
Definition: linetemp.h:194
#define IS_BLANK_CH(c)
const WCHAR * str
XMLPUBFUN const xmlChar *XMLCALL xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len)
Definition: dict.c:867
@ XML_PARSE_COMPACT
Definition: parser.h:1109
@ XML_PARSE_BIG_LINES
Definition: parser.h:1117

Referenced by xmlSAX2AttributeNs(), and xmlSAX2Text().

◆ xmlSAX2UnparsedEntityDecl()

void xmlSAX2UnparsedEntityDecl ( void ctx,
const xmlChar name,
const xmlChar publicId,
const xmlChar systemId,
const xmlChar notationName 
)

Definition at line 849 of file SAX2.c.

852{
853 xmlEntityPtr ent;
855 if (ctx == NULL) return;
856#ifdef DEBUG_SAX
858 "SAX.xmlSAX2UnparsedEntityDecl(%s, %s, %s, %s)\n",
859 name, publicId, systemId, notationName);
860#endif
861 if (ctxt->inSubset == 1) {
862 ent = xmlAddDocEntity(ctxt->myDoc, name,
864 publicId, systemId, notationName);
865 if ((ent == NULL) && (ctxt->pedantic) &&
866 (ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
867 ctxt->sax->warning(ctxt->userData,
868 "Entity(%s) already defined in the internal subset\n", name);
869 if ((ent != NULL) && (ent->URI == NULL) && (systemId != NULL)) {
870 xmlChar *URI;
871 const char *base = NULL;
872
873 if (ctxt->input != NULL)
874 base = ctxt->input->filename;
875 if (base == NULL)
876 base = ctxt->directory;
877
878 URI = xmlBuildURI(systemId, (const xmlChar *) base);
879 ent->URI = URI;
880 }
881 } else if (ctxt->inSubset == 2) {
882 ent = xmlAddDtdEntity(ctxt->myDoc, name,
884 publicId, systemId, notationName);
885 if ((ent == NULL) && (ctxt->pedantic) &&
886 (ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
887 ctxt->sax->warning(ctxt->userData,
888 "Entity(%s) already defined in the external subset\n", name);
889 if ((ent != NULL) && (ent->URI == NULL) && (systemId != NULL)) {
890 xmlChar *URI;
891 const char *base = NULL;
892
893 if (ctxt->input != NULL)
894 base = ctxt->input->filename;
895 if (base == NULL)
896 base = ctxt->directory;
897
898 URI = xmlBuildURI(systemId, (const xmlChar *) base);
899 ent->URI = URI;
900 }
901 } else {
902 xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
903 "SAX.xmlSAX2UnparsedEntityDecl(%s) called while not in subset\n",
904 name, NULL);
905 }
906}
@ XML_EXTERNAL_GENERAL_UNPARSED_ENTITY
Definition: entities.h:27

Referenced by xmlSAXVersion().

◆ xmlSAXVersion()

int xmlSAXVersion ( xmlSAXHandler hdlr,
int  version 
)

xmlSAXVersion: @hdlr: the SAX handler

Version
: the version, 1 or 2

Initialize the default XML SAX handler according to the version

Returns 0 in case of success and -1 in case of error.

Definition at line 2858 of file SAX2.c.

2859{
2860 if (hdlr == NULL) return(-1);
2861 if (version == 2) {
2862 hdlr->startElement = NULL;
2863 hdlr->endElement = NULL;
2866 hdlr->serror = NULL;
2868#ifdef LIBXML_SAX1_ENABLED
2869 } else if (version == 1) {
2870 hdlr->startElement = xmlSAX2StartElement;
2871 hdlr->endElement = xmlSAX2EndElement;
2872 hdlr->initialized = 1;
2873#endif /* LIBXML_SAX1_ENABLED */
2874 } else
2875 return(-1);
2897 hdlr->comment = xmlSAX2Comment;
2898 hdlr->warning = xmlParserWarning;
2899 hdlr->error = xmlParserError;
2900 hdlr->fatalError = xmlParserError;
2901
2902 return(0);
2903}
int xmlSAX2HasInternalSubset(void *ctx)
Definition: SAX2.c:291
void xmlSAX2NotationDecl(void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId)
Definition: SAX2.c:795
void xmlSAX2ExternalSubset(void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID)
Definition: SAX2.c:362
xmlParserInputPtr xmlSAX2ResolveEntity(void *ctx, const xmlChar *publicId, const xmlChar *systemId)
Definition: SAX2.c:489
void xmlSAX2UnparsedEntityDecl(void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId, const xmlChar *notationName)
Definition: SAX2.c:849
xmlEntityPtr xmlSAX2GetParameterEntity(void *ctx, const xmlChar *name)
Definition: SAX2.c:576
void xmlSAX2EndDocument(void *ctx)
Definition: SAX2.c:998
void xmlSAX2EntityDecl(void *ctx, const xmlChar *name, int type, const xmlChar *publicId, const xmlChar *systemId, xmlChar *content)
Definition: SAX2.c:604
void xmlSAX2Comment(void *ctx, const xmlChar *value)
Definition: SAX2.c:2754
void xmlSAX2CDataBlock(void *ctx, const xmlChar *value, int len)
Definition: SAX2.c:2816
int xmlSAX2HasExternalSubset(void *ctx)
Definition: SAX2.c:307
void xmlSAX2InternalSubset(void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID)
Definition: SAX2.c:324
void xmlSAX2SetDocumentLocator(void *ctx ATTRIBUTE_UNUSED, xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED)
Definition: SAX2.c:917
void xmlSAX2ElementDecl(void *ctx, const xmlChar *name, int type, xmlElementContentPtr content)
Definition: SAX2.c:746
void xmlSAX2StartElementNs(void *ctx, const xmlChar *localname, const xmlChar *prefix, const xmlChar *URI, int nb_namespaces, const xmlChar **namespaces, int nb_attributes, int nb_defaulted, const xmlChar **attributes)
Definition: SAX2.c:2195
void xmlSAX2StartDocument(void *ctx)
Definition: SAX2.c:933
void xmlSAX2Characters(void *ctx, const xmlChar *ch, int len)
Definition: SAX2.c:2657
xmlEntityPtr xmlSAX2GetEntity(void *ctx, const xmlChar *name)
Definition: SAX2.c:526
void xmlSAX2Reference(void *ctx, const xmlChar *name)
Definition: SAX2.c:2488
void xmlSAX2ProcessingInstruction(void *ctx, const xmlChar *target, const xmlChar *data)
Definition: SAX2.c:2690
void xmlSAX2EndElementNs(void *ctx, const xmlChar *localname ATTRIBUTE_UNUSED, const xmlChar *prefix ATTRIBUTE_UNUSED, const xmlChar *URI ATTRIBUTE_UNUSED)
Definition: SAX2.c:2448
void xmlSAX2AttributeDecl(void *ctx, const xmlChar *elem, const xmlChar *fullname, int type, int def, const xmlChar *defaultValue, xmlEnumerationPtr tree)
Definition: SAX2.c:674
int xmlSAX2IsStandalone(void *ctx)
Definition: SAX2.c:275
static const WCHAR version[]
Definition: asmname.c:66
unparsedEntityDeclSAXFunc unparsedEntityDecl
Definition: parser.h:730
hasExternalSubsetSAXFunc hasExternalSubset
Definition: parser.h:723
setDocumentLocatorSAXFunc setDocumentLocator
Definition: parser.h:731
getEntitySAXFunc getEntity
Definition: parser.h:725
commentSAXFunc comment
Definition: parser.h:740
errorSAXFunc error
Definition: parser.h:742
attributeDeclSAXFunc attributeDecl
Definition: parser.h:728
referenceSAXFunc reference
Definition: parser.h:736
startElementNsSAX2Func startElementNs
Definition: parser.h:750
externalSubsetSAXFunc externalSubset
Definition: parser.h:746
internalSubsetSAXFunc internalSubset
Definition: parser.h:720
endElementSAXFunc endElement
Definition: parser.h:735
isStandaloneSAXFunc isStandalone
Definition: parser.h:721
endDocumentSAXFunc endDocument
Definition: parser.h:733
fatalErrorSAXFunc fatalError
Definition: parser.h:743
hasInternalSubsetSAXFunc hasInternalSubset
Definition: parser.h:722
notationDeclSAXFunc notationDecl
Definition: parser.h:727
resolveEntitySAXFunc resolveEntity
Definition: parser.h:724
getParameterEntitySAXFunc getParameterEntity
Definition: parser.h:744
endElementNsSAX2Func endElementNs
Definition: parser.h:751
cdataBlockSAXFunc cdataBlock
Definition: parser.h:745
startElementSAXFunc startElement
Definition: parser.h:734
xmlStructuredErrorFunc serror
Definition: parser.h:752
entityDeclSAXFunc entityDecl
Definition: parser.h:726
processingInstructionSAXFunc processingInstruction
Definition: parser.h:739
charactersSAXFunc characters
Definition: parser.h:737
startDocumentSAXFunc startDocument
Definition: parser.h:732
elementDeclSAXFunc elementDecl
Definition: parser.h:729
ignorableWhitespaceSAXFunc ignorableWhitespace
Definition: parser.h:738
XMLPUBFUN void XMLCDECL xmlParserError(void *ctx, const char *msg,...) LIBXML_ATTR_FORMAT(2

Referenced by xmlDefaultSAXHandlerInit(), xmlInitParserCtxt(), and xmlSAX2InitDefaultSAXHandler().

Variable Documentation

◆ xmlSAX2DefaultVersionValue

int xmlSAX2DefaultVersionValue = 2
static

Definition at line 2821 of file SAX2.c.

Referenced by xmlSAX2InitDefaultSAXHandler().