ReactOS  0.4.13-dev-241-g63286c6
SAX2.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <libxml/xmlversion.h>
#include <libxml/parser.h>
#include <libxml/xlink.h>
Include dependency graph for SAX2.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

XMLPUBFUN const xmlChar *XMLCALL xmlSAX2GetPublicId (void *ctx)
 
XMLPUBFUN const xmlChar *XMLCALL xmlSAX2GetSystemId (void *ctx)
 
XMLPUBFUN void XMLCALL xmlSAX2SetDocumentLocator (void *ctx, xmlSAXLocatorPtr loc)
 
XMLPUBFUN int XMLCALL xmlSAX2GetLineNumber (void *ctx)
 
XMLPUBFUN int XMLCALL xmlSAX2GetColumnNumber (void *ctx)
 
XMLPUBFUN int XMLCALL xmlSAX2IsStandalone (void *ctx)
 
XMLPUBFUN int XMLCALL xmlSAX2HasInternalSubset (void *ctx)
 
XMLPUBFUN int XMLCALL xmlSAX2HasExternalSubset (void *ctx)
 
XMLPUBFUN void XMLCALL xmlSAX2InternalSubset (void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID)
 
XMLPUBFUN void XMLCALL xmlSAX2ExternalSubset (void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID)
 
XMLPUBFUN xmlEntityPtr XMLCALL xmlSAX2GetEntity (void *ctx, const xmlChar *name)
 
XMLPUBFUN xmlEntityPtr XMLCALL xmlSAX2GetParameterEntity (void *ctx, const xmlChar *name)
 
XMLPUBFUN xmlParserInputPtr XMLCALL xmlSAX2ResolveEntity (void *ctx, const xmlChar *publicId, const xmlChar *systemId)
 
XMLPUBFUN void XMLCALL xmlSAX2EntityDecl (void *ctx, const xmlChar *name, int type, const xmlChar *publicId, const xmlChar *systemId, xmlChar *content)
 
XMLPUBFUN void XMLCALL xmlSAX2AttributeDecl (void *ctx, const xmlChar *elem, const xmlChar *fullname, int type, int def, const xmlChar *defaultValue, xmlEnumerationPtr tree)
 
XMLPUBFUN void XMLCALL xmlSAX2ElementDecl (void *ctx, const xmlChar *name, int type, xmlElementContentPtr content)
 
XMLPUBFUN void XMLCALL xmlSAX2NotationDecl (void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId)
 
XMLPUBFUN void XMLCALL xmlSAX2UnparsedEntityDecl (void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId, const xmlChar *notationName)
 
XMLPUBFUN void XMLCALL xmlSAX2StartDocument (void *ctx)
 
XMLPUBFUN void XMLCALL xmlSAX2EndDocument (void *ctx)
 
XMLPUBFUN void XMLCALL 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)
 
XMLPUBFUN void XMLCALL xmlSAX2EndElementNs (void *ctx, const xmlChar *localname, const xmlChar *prefix, const xmlChar *URI)
 
XMLPUBFUN void XMLCALL xmlSAX2Reference (void *ctx, const xmlChar *name)
 
XMLPUBFUN void XMLCALL xmlSAX2Characters (void *ctx, const xmlChar *ch, int len)
 
XMLPUBFUN void XMLCALL xmlSAX2IgnorableWhitespace (void *ctx, const xmlChar *ch, int len)
 
XMLPUBFUN void XMLCALL xmlSAX2ProcessingInstruction (void *ctx, const xmlChar *target, const xmlChar *data)
 
XMLPUBFUN void XMLCALL xmlSAX2Comment (void *ctx, const xmlChar *value)
 
XMLPUBFUN void XMLCALL xmlSAX2CDataBlock (void *ctx, const xmlChar *value, int len)
 
XMLPUBFUN int XMLCALL xmlSAXVersion (xmlSAXHandler *hdlr, int version)
 
XMLPUBFUN void XMLCALL xmlSAX2InitDefaultSAXHandler (xmlSAXHandler *hdlr, int warning)
 
XMLPUBFUN void XMLCALL xmlDefaultSAXHandlerInit (void)
 

Function Documentation

◆ xmlDefaultSAXHandlerInit()

XMLPUBFUN void XMLCALL xmlDefaultSAXHandlerInit ( void  )

xmlDefaultSAXHandlerInit:

Initialize the default SAX2 handler

Definition at line 2939 of file SAX2.c.

2940 {
2941 #ifdef LIBXML_SAX1_ENABLED
2943 #endif /* LIBXML_SAX1_ENABLED */
2944 }
int xmlSAXVersion(xmlSAXHandler *hdlr, int version)
Definition: SAX2.c:2866
XMLPUBVAR xmlSAXHandlerV1 xmlDefaultSAXHandler
Definition: globals.h:321

Referenced by xmlInitParser(), xmlInitParserCtxt(), and xmlParseExtParsedEnt().

◆ xmlSAX2AttributeDecl()

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

Definition at line 734 of file SAX2.c.

737 {
738  xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
740  xmlChar *name = NULL, *prefix = NULL;
741 
742  if ((ctxt == NULL) || (ctxt->myDoc == NULL))
743  return;
744 
745 #ifdef DEBUG_SAX
747  "SAX.xmlSAX2AttributeDecl(%s, %s, %d, %d, %s, ...)\n",
748  elem, fullname, type, def, defaultValue);
749 #endif
750  if ((xmlStrEqual(fullname, BAD_CAST "xml:id")) &&
751  (type != XML_ATTRIBUTE_ID)) {
752  /*
753  * Raise the error but keep the validity flag
754  */
755  int tmp = ctxt->valid;
756  xmlErrValid(ctxt, XML_DTD_XMLID_TYPE,
757  "xml:id : attribute type should be ID\n", NULL, NULL);
758  ctxt->valid = tmp;
759  }
760  /* TODO: optimize name/prefix allocation */
761  name = xmlSplitQName(ctxt, fullname, &prefix);
762  ctxt->vctxt.valid = 1;
763  if (ctxt->inSubset == 1)
764  attr = xmlAddAttributeDecl(&ctxt->vctxt, ctxt->myDoc->intSubset, elem,
765  name, prefix, (xmlAttributeType) type,
766  (xmlAttributeDefault) def, defaultValue, tree);
767  else if (ctxt->inSubset == 2)
768  attr = xmlAddAttributeDecl(&ctxt->vctxt, ctxt->myDoc->extSubset, elem,
769  name, prefix, (xmlAttributeType) type,
770  (xmlAttributeDefault) def, defaultValue, tree);
771  else {
772  xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
773  "SAX.xmlSAX2AttributeDecl(%s) called while not in subset\n",
774  name, NULL);
776  return;
777  }
778 #ifdef LIBXML_VALID_ENABLED
779  if (ctxt->vctxt.valid == 0)
780  ctxt->valid = 0;
781  if ((attr != NULL) && (ctxt->validate) && (ctxt->wellFormed) &&
782  (ctxt->myDoc->intSubset != NULL))
783  ctxt->valid &= xmlValidateAttributeDecl(&ctxt->vctxt, ctxt->myDoc,
784  attr);
785 #endif /* LIBXML_VALID_ENABLED */
786  if (prefix != NULL)
787  xmlFree(prefix);
788  if (name != NULL)
789  xmlFree(name);
790 }
struct _xmlDtd * intSubset
Definition: tree.h:570
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static size_t elem
Definition: string.c:68
XMLPUBFUN xmlChar *XMLCALL xmlSplitQName(xmlParserCtxtPtr ctxt, const xmlChar *name, xmlChar **prefix)
Definition: parser.c:2887
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:346
smooth NULL
Definition: ftsmooth.c:416
#define BAD_CAST
Definition: xmlstring.h:35
int validate
Definition: parser.h:220
int wellFormed
Definition: parser.h:188
xmlAttributeDefault
Definition: tree.h:225
XMLPUBVAR xmlFreeFunc xmlFree
Definition: globals.h:250
Definition: cookie.c:170
xmlDocPtr myDoc
Definition: parser.h:187
__u8 attr
Definition: mkdosfs.c:359
unsigned char xmlChar
Definition: xmlstring.h:28
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:1938
int inSubset
Definition: parser.h:238
xmlParserCtxt * xmlParserCtxtPtr
Definition: tree.h:39
struct _xmlDtd * extSubset
Definition: tree.h:571
Definition: name.c:36
XMLPUBFUN int XMLCALL xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
Definition: xmlstring.c:157
xmlValidCtxt vctxt
Definition: parser.h:221
int valid
Definition: valid.h:95
XMLPUBFUN void XMLCALL xmlFreeEnumeration(xmlEnumerationPtr cur)
Definition: valid.c:1788
xmlAttributeType
Definition: tree.h:206
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:362

Referenced by xmlSAXVersion().

◆ xmlSAX2CDataBlock()

XMLPUBFUN void XMLCALL 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 2804 of file SAX2.c.

2805 {
2806  xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
2807  xmlNodePtr ret, lastChild;
2808 
2809  if (ctx == NULL) return;
2810 #ifdef DEBUG_SAX
2812  "SAX.pcdata(%.10s, %d)\n", value, len);
2813 #endif
2814  lastChild = xmlGetLastChild(ctxt->node);
2815 #ifdef DEBUG_SAX_TREE
2817  "add chars to %s \n", ctxt->node->name);
2818 #endif
2819  if ((lastChild != NULL) &&
2820  (lastChild->type == XML_CDATA_SECTION_NODE)) {
2821  xmlTextConcat(lastChild, value, len);
2822  } else {
2823  ret = xmlNewCDataBlock(ctxt->myDoc, value, len);
2824  if (xmlAddChild(ctxt->node, ret) == NULL)
2825  xmlFreeNode(ret);
2826  }
2827 }
const xmlChar * name
Definition: tree.h:492
XMLPUBFUN xmlNodePtr XMLCALL xmlNewCDataBlock(xmlDocPtr doc, const xmlChar *content, int len)
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:346
smooth NULL
Definition: ftsmooth.c:416
XMLPUBFUN xmlNodePtr XMLCALL xmlGetLastChild(const xmlNode *parent)
XMLPUBFUN xmlNodePtr XMLCALL xmlAddChild(xmlNodePtr parent, xmlNodePtr cur)
xmlNodePtr node
Definition: parser.h:205
Definition: tree.h:489
int ret
xmlDocPtr myDoc
Definition: parser.h:187
GLenum GLsizei len
Definition: glext.h:6722
xmlElementType type
Definition: tree.h:491
xmlParserCtxt * xmlParserCtxtPtr
Definition: tree.h:39
XMLPUBFUN int XMLCALL xmlTextConcat(xmlNodePtr node, const xmlChar *content, int len)
XMLPUBFUN void XMLCALL xmlFreeNode(xmlNodePtr cur)
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:362

Referenced by xmlSAXVersion().

◆ xmlSAX2Characters()

XMLPUBFUN void XMLCALL 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 2532 of file SAX2.c.

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

Referenced by xmlSAXVersion().

◆ xmlSAX2Comment()

XMLPUBFUN void XMLCALL 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 2742 of file SAX2.c.

2743 {
2744  xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
2745  xmlNodePtr ret;
2747 
2748  if (ctx == NULL) return;
2749  parent = ctxt->node;
2750 #ifdef DEBUG_SAX
2751  xmlGenericError(xmlGenericErrorContext, "SAX.xmlSAX2Comment(%s)\n", value);
2752 #endif
2753  ret = xmlNewDocComment(ctxt->myDoc, value);
2754  if (ret == NULL) return;
2755  if (ctxt->linenumbers) {
2756  if (ctxt->input != NULL) {
2757  if (ctxt->input->line < 65535)
2758  ret->line = (short) ctxt->input->line;
2759  else
2760  ret->line = 65535;
2761  }
2762  }
2763 
2764  if (ctxt->inSubset == 1) {
2766  return;
2767  } else if (ctxt->inSubset == 2) {
2769  return;
2770  }
2771  if (parent == NULL) {
2772 #ifdef DEBUG_SAX_TREE
2774  "Setting xmlSAX2Comment as root\n");
2775 #endif
2777  return;
2778  }
2779  if (parent->type == XML_ELEMENT_NODE) {
2780 #ifdef DEBUG_SAX_TREE
2782  "adding xmlSAX2Comment child to %s\n", parent->name);
2783 #endif
2785  } else {
2786 #ifdef DEBUG_SAX_TREE
2788  "adding xmlSAX2Comment sibling to ");
2789  xmlDebugDumpOneNode(stderr, parent, 0);
2790 #endif
2792  }
2793 }
struct _xmlDtd * intSubset
Definition: tree.h:570
XMLPUBFUN xmlNodePtr XMLCALL xmlAddSibling(xmlNodePtr cur, xmlNodePtr elem)
xmlParserInputPtr input
Definition: parser.h:199
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:93
int linenumbers
Definition: parser.h:259
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:346
smooth NULL
Definition: ftsmooth.c:416
XMLPUBFUN xmlNodePtr XMLCALL xmlAddChild(xmlNodePtr parent, xmlNodePtr cur)
xmlNodePtr node
Definition: parser.h:205
r parent
Definition: btrfs.c:2677
Definition: tree.h:489
int ret
xmlDocPtr myDoc
Definition: parser.h:187
XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocComment(xmlDocPtr doc, const xmlChar *content)
int inSubset
Definition: parser.h:238
xmlParserCtxt * xmlParserCtxtPtr
Definition: tree.h:39
struct _xmlDtd * extSubset
Definition: tree.h:571
FILE * stderr
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:362

Referenced by xmlSAXVersion().

◆ xmlSAX2ElementDecl()

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

Definition at line 802 of file SAX2.c.

804 {
805  xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
807 
808  if ((ctxt == NULL) || (ctxt->myDoc == NULL))
809  return;
810 
811 #ifdef DEBUG_SAX
813  "SAX.xmlSAX2ElementDecl(%s, %d, ...)\n", name, type);
814 #endif
815 
816  if (ctxt->inSubset == 1)
817  elem = xmlAddElementDecl(&ctxt->vctxt, ctxt->myDoc->intSubset,
819  else if (ctxt->inSubset == 2)
820  elem = xmlAddElementDecl(&ctxt->vctxt, ctxt->myDoc->extSubset,
822  else {
823  xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
824  "SAX.xmlSAX2ElementDecl(%s) called while not in subset\n",
825  name, NULL);
826  return;
827  }
828 #ifdef LIBXML_VALID_ENABLED
829  if (elem == NULL)
830  ctxt->valid = 0;
831  if (ctxt->validate && ctxt->wellFormed &&
832  ctxt->myDoc && ctxt->myDoc->intSubset)
833  ctxt->valid &=
834  xmlValidateElementDecl(&ctxt->vctxt, ctxt->myDoc, elem);
835 #endif /* LIBXML_VALID_ENABLED */
836 }
struct _xmlDtd * intSubset
Definition: tree.h:570
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
xmlElementTypeVal
Definition: tree.h:322
static size_t elem
Definition: string.c:68
content
Definition: atl_ax.c:994
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:346
smooth NULL
Definition: ftsmooth.c:416
int validate
Definition: parser.h:220
int wellFormed
Definition: parser.h:188
xmlDocPtr myDoc
Definition: parser.h:187
XMLPUBFUN xmlElementPtr XMLCALL xmlAddElementDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *name, xmlElementTypeVal type, xmlElementContentPtr content)
Definition: valid.c:1387
int inSubset
Definition: parser.h:238
xmlParserCtxt * xmlParserCtxtPtr
Definition: tree.h:39
struct _xmlDtd * extSubset
Definition: tree.h:571
Definition: name.c:36
xmlValidCtxt vctxt
Definition: parser.h:221
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:362

Referenced by xmlSAXVersion().

◆ xmlSAX2EndDocument()

XMLPUBFUN void XMLCALL xmlSAX2EndDocument ( void ctx)

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

called when the document end has been detected.

Definition at line 1048 of file SAX2.c.

1049 {
1050  xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
1051 #ifdef DEBUG_SAX
1053  "SAX.xmlSAX2EndDocument()\n");
1054 #endif
1055  if (ctx == NULL) return;
1056 #ifdef LIBXML_VALID_ENABLED
1057  if (ctxt->validate && ctxt->wellFormed &&
1058  ctxt->myDoc && ctxt->myDoc->intSubset)
1059  ctxt->valid &= xmlValidateDocumentFinal(&ctxt->vctxt, ctxt->myDoc);
1060 #endif /* LIBXML_VALID_ENABLED */
1061 
1062  /*
1063  * Grab the encoding if it was added on-the-fly
1064  */
1065  if ((ctxt->encoding != NULL) && (ctxt->myDoc != NULL) &&
1066  (ctxt->myDoc->encoding == NULL)) {
1067  ctxt->myDoc->encoding = ctxt->encoding;
1068  ctxt->encoding = NULL;
1069  }
1070  if ((ctxt->inputTab != NULL) &&
1071  (ctxt->inputNr > 0) && (ctxt->inputTab[0] != NULL) &&
1072  (ctxt->inputTab[0]->encoding != NULL) && (ctxt->myDoc != NULL) &&
1073  (ctxt->myDoc->encoding == NULL)) {
1074  ctxt->myDoc->encoding = xmlStrdup(ctxt->inputTab[0]->encoding);
1075  }
1076  if ((ctxt->charset != XML_CHAR_ENCODING_NONE) && (ctxt->myDoc != NULL) &&
1077  (ctxt->myDoc->charset == XML_CHAR_ENCODING_NONE)) {
1078  ctxt->myDoc->charset = ctxt->charset;
1079  }
1080 }
xmlParserInputPtr * inputTab
Definition: parser.h:202
struct _xmlDtd * intSubset
Definition: tree.h:570
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:346
smooth NULL
Definition: ftsmooth.c:416
int validate
Definition: parser.h:220
int wellFormed
Definition: parser.h:188
xmlDocPtr myDoc
Definition: parser.h:187
const xmlChar * encoding
Definition: parser.h:191
const xmlChar * encoding
Definition: tree.h:574
int charset
Definition: tree.h:578
xmlParserCtxt * xmlParserCtxtPtr
Definition: tree.h:39
const xmlChar * encoding
Definition: parser.h:73
xmlValidCtxt vctxt
Definition: parser.h:221
XMLPUBFUN xmlChar *XMLCALL xmlStrdup(const xmlChar *cur)
Definition: xmlstring.c:66
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:362

Referenced by xmlSAXVersion().

◆ xmlSAX2EndElementNs()

XMLPUBFUN void XMLCALL xmlSAX2EndElementNs ( void ctx,
const xmlChar localname,
const xmlChar prefix,
const xmlChar URI 
)

◆ xmlSAX2EntityDecl()

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

Definition at line 664 of file SAX2.c.

666 {
667  xmlEntityPtr ent;
668  xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
669 
670  if (ctx == NULL) return;
671 #ifdef DEBUG_SAX
673  "SAX.xmlSAX2EntityDecl(%s, %d, %s, %s, %s)\n",
674  name, type, publicId, systemId, content);
675 #endif
676  if (ctxt->inSubset == 1) {
677  ent = xmlAddDocEntity(ctxt->myDoc, name, type, publicId,
678  systemId, content);
679  if ((ent == NULL) && (ctxt->pedantic))
680  xmlWarnMsg(ctxt, XML_WAR_ENTITY_REDEFINED,
681  "Entity(%s) already defined in the internal subset\n",
682  name);
683  if ((ent != NULL) && (ent->URI == NULL) && (systemId != NULL)) {
684  xmlChar *URI;
685  const char *base = NULL;
686 
687  if (ctxt->input != NULL)
688  base = ctxt->input->filename;
689  if (base == NULL)
690  base = ctxt->directory;
691 
692  URI = xmlBuildURI(systemId, (const xmlChar *) base);
693  ent->URI = URI;
694  }
695  } else if (ctxt->inSubset == 2) {
696  ent = xmlAddDtdEntity(ctxt->myDoc, name, type, publicId,
697  systemId, content);
698  if ((ent == NULL) && (ctxt->pedantic) &&
699  (ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
700  ctxt->sax->warning(ctxt->userData,
701  "Entity(%s) already defined in the external subset\n", name);
702  if ((ent != NULL) && (ent->URI == NULL) && (systemId != NULL)) {
703  xmlChar *URI;
704  const char *base = NULL;
705 
706  if (ctxt->input != NULL)
707  base = ctxt->input->filename;
708  if (base == NULL)
709  base = ctxt->directory;
710 
711  URI = xmlBuildURI(systemId, (const xmlChar *) base);
712  ent->URI = URI;
713  }
714  } else {
715  xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_PROCESSING,
716  "SAX.xmlSAX2EntityDecl(%s) called while not in subset\n",
717  name, NULL);
718  }
719 }
int pedantic
Definition: parser.h:255
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
const xmlChar * URI
Definition: entities.h:57
xmlParserInputPtr input
Definition: parser.h:199
content
Definition: atl_ax.c:994
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:346
XMLPUBFUN xmlChar *XMLCALL xmlBuildURI(const xmlChar *URI, const xmlChar *base)
Definition: uri.c:1882
smooth NULL
Definition: ftsmooth.c:416
XMLPUBFUN xmlEntityPtr XMLCALL xmlAddDtdEntity(xmlDocPtr doc, const xmlChar *name, int type, const xmlChar *ExternalID, const xmlChar *SystemID, const xmlChar *content)
xmlDocPtr myDoc
Definition: parser.h:187
unsigned char xmlChar
Definition: xmlstring.h:28
struct _xmlSAXHandler * sax
Definition: parser.h:185
const char * filename
Definition: parser.h:58
int inSubset
Definition: parser.h:238
XMLPUBFUN xmlEntityPtr XMLCALL xmlAddDocEntity(xmlDocPtr doc, const xmlChar *name, int type, const xmlChar *ExternalID, const xmlChar *SystemID, const xmlChar *content)
char * directory
Definition: parser.h:226
xmlParserCtxt * xmlParserCtxtPtr
Definition: tree.h:39
Definition: name.c:36
void * userData
Definition: parser.h:186
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:362

Referenced by xmlParseEntityDecl(), and xmlSAXVersion().

◆ xmlSAX2ExternalSubset()

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

Definition at line 392 of file SAX2.c.

394 {
395  xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
396  if (ctx == NULL) return;
397 #ifdef DEBUG_SAX
399  "SAX.xmlSAX2ExternalSubset(%s, %s, %s)\n",
400  name, ExternalID, SystemID);
401 #endif
402  if (((ExternalID != NULL) || (SystemID != NULL)) &&
403  (((ctxt->validate) || (ctxt->loadsubset != 0)) &&
404  (ctxt->wellFormed && ctxt->myDoc))) {
405  /*
406  * Try to fetch and parse the external subset.
407  */
408  xmlParserInputPtr oldinput;
409  int oldinputNr;
410  int oldinputMax;
411  xmlParserInputPtr *oldinputTab;
413  xmlCharEncoding enc;
414  int oldcharset;
415  const xmlChar *oldencoding;
416 
417  /*
418  * Ask the Entity resolver to load the damn thing
419  */
420  if ((ctxt->sax != NULL) && (ctxt->sax->resolveEntity != NULL))
421  input = ctxt->sax->resolveEntity(ctxt->userData, ExternalID,
422  SystemID);
423  if (input == NULL) {
424  return;
425  }
426 
427  xmlNewDtd(ctxt->myDoc, name, ExternalID, SystemID);
428 
429  /*
430  * make sure we won't destroy the main document context
431  */
432  oldinput = ctxt->input;
433  oldinputNr = ctxt->inputNr;
434  oldinputMax = ctxt->inputMax;
435  oldinputTab = ctxt->inputTab;
436  oldcharset = ctxt->charset;
437  oldencoding = ctxt->encoding;
438  ctxt->encoding = NULL;
439 
440  ctxt->inputTab = (xmlParserInputPtr *)
441  xmlMalloc(5 * sizeof(xmlParserInputPtr));
442  if (ctxt->inputTab == NULL) {
443  xmlSAX2ErrMemory(ctxt, "xmlSAX2ExternalSubset");
444  ctxt->input = oldinput;
445  ctxt->inputNr = oldinputNr;
446  ctxt->inputMax = oldinputMax;
447  ctxt->inputTab = oldinputTab;
448  ctxt->charset = oldcharset;
449  ctxt->encoding = oldencoding;
450  return;
451  }
452  ctxt->inputNr = 0;
453  ctxt->inputMax = 5;
454  ctxt->input = NULL;
455  xmlPushInput(ctxt, input);
456 
457  /*
458  * On the fly encoding conversion if needed
459  */
460  if (ctxt->input->length >= 4) {
461  enc = xmlDetectCharEncoding(ctxt->input->cur, 4);
462  xmlSwitchEncoding(ctxt, enc);
463  }
464 
465  if (input->filename == NULL)
466  input->filename = (char *) xmlCanonicPath(SystemID);
467  input->line = 1;
468  input->col = 1;
469  input->base = ctxt->input->cur;
470  input->cur = ctxt->input->cur;
471  input->free = NULL;
472 
473  /*
474  * let's parse that entity knowing it's an external subset.
475  */
476  xmlParseExternalSubset(ctxt, ExternalID, SystemID);
477 
478  /*
479  * Free up the external entities
480  */
481 
482  while (ctxt->inputNr > 1)
483  xmlPopInput(ctxt);
484  xmlFreeInputStream(ctxt->input);
485  xmlFree(ctxt->inputTab);
486 
487  /*
488  * Restore the parsing context of the main entity
489  */
490  ctxt->input = oldinput;
491  ctxt->inputNr = oldinputNr;
492  ctxt->inputMax = oldinputMax;
493  ctxt->inputTab = oldinputTab;
494  ctxt->charset = oldcharset;
495  if ((ctxt->encoding != NULL) &&
496  ((ctxt->dict == NULL) ||
497  (!xmlDictOwns(ctxt->dict, ctxt->encoding))))
498  xmlFree((xmlChar *) ctxt->encoding);
499  ctxt->encoding = oldencoding;
500  /* ctxt->wellFormed = oldwellFormed; */
501  }
502 }
XMLPUBFUN xmlDtdPtr XMLCALL xmlNewDtd(xmlDocPtr doc, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID)
xmlParserInputPtr * inputTab
Definition: parser.h:202
XMLPUBFUN int XMLCALL xmlPushInput(xmlParserCtxtPtr ctxt, xmlParserInputPtr input)
Definition: parser.c:2241
const xmlChar * cur
Definition: parser.h:61
xmlCharEncoding
Definition: encoding.h:58
xmlParserInputPtr input
Definition: parser.h:199
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:346
XMLPUBFUN xmlChar *XMLCALL xmlCanonicPath(const xmlChar *path)
Definition: uri.c:2370
smooth NULL
Definition: ftsmooth.c:416
XMLPUBFUN void XMLCALL xmlFreeInputStream(xmlParserInputPtr input)
xmlDictPtr dict
Definition: parser.h:263
XMLPUBFUN xmlChar XMLCALL xmlPopInput(xmlParserCtxtPtr ctxt)
Definition: parser.c:2216
int validate
Definition: parser.h:220
int inputMax
Definition: parser.h:201
XMLPUBFUN void XMLCALL xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const xmlChar *ExternalID, const xmlChar *SystemID)
Definition: parser.c:6916
int wellFormed
Definition: parser.h:188
XMLPUBVAR xmlFreeFunc xmlFree
Definition: globals.h:250
XMLPUBFUN xmlCharEncoding XMLCALL xmlDetectCharEncoding(const unsigned char *in, int len)
Definition: encoding.c:932
xmlDocPtr myDoc
Definition: parser.h:187
const xmlChar * encoding
Definition: parser.h:191
unsigned char xmlChar
Definition: xmlstring.h:28
struct _xmlSAXHandler * sax
Definition: parser.h:185
int loadsubset
Definition: parser.h:258
GLenum GLenum GLenum input
Definition: glext.h:9031
XMLPUBFUN int XMLCALL xmlDictOwns(xmlDictPtr dict, const xmlChar *str)
Definition: dict.c:1211
XMLPUBFUN int XMLCALL xmlSwitchEncoding(xmlParserCtxtPtr ctxt, xmlCharEncoding enc)
XMLPUBVAR xmlMallocFunc xmlMalloc
Definition: globals.h:247
xmlParserCtxt * xmlParserCtxtPtr
Definition: tree.h:39
Definition: name.c:36
void * userData
Definition: parser.h:186
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:362

Referenced by xmlSAXVersion().

◆ xmlSAX2GetColumnNumber()

XMLPUBFUN int XMLCALL 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 289 of file SAX2.c.

290 {
291  xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
292  if ((ctx == NULL) || (ctxt->input == NULL)) return(0);
293  return(ctxt->input->col);
294 }
xmlParserInputPtr input
Definition: parser.h:199
smooth NULL
Definition: ftsmooth.c:416
xmlParserCtxt * xmlParserCtxtPtr
Definition: tree.h:39

Referenced by xmlInitializeGlobalState().

◆ xmlSAX2GetEntity()

XMLPUBFUN xmlEntityPtr XMLCALL xmlSAX2GetEntity ( void ctx,
const xmlChar name 
)

Definition at line 556 of file SAX2.c.

557 {
558  xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
560 
561  if (ctx == NULL) return(NULL);
562 #ifdef DEBUG_SAX
564  "SAX.xmlSAX2GetEntity(%s)\n", name);
565 #endif
566 
567  if (ctxt->inSubset == 0) {
569  if (ret != NULL)
570  return(ret);
571  }
572  if ((ctxt->myDoc != NULL) && (ctxt->myDoc->standalone == 1)) {
573  if (ctxt->inSubset == 2) {
574  ctxt->myDoc->standalone = 0;
575  ret = xmlGetDocEntity(ctxt->myDoc, name);
576  ctxt->myDoc->standalone = 1;
577  } else {
578  ret = xmlGetDocEntity(ctxt->myDoc, name);
579  if (ret == NULL) {
580  ctxt->myDoc->standalone = 0;
581  ret = xmlGetDocEntity(ctxt->myDoc, name);
582  if (ret != NULL) {
583  xmlFatalErrMsg(ctxt, XML_ERR_NOT_STANDALONE,
584  "Entity(%s) document marked standalone but requires external subset\n",
585  name, NULL);
586  }
587  ctxt->myDoc->standalone = 1;
588  }
589  }
590  } else {
591  ret = xmlGetDocEntity(ctxt->myDoc, name);
592  }
593  if ((ret != NULL) &&
594  ((ctxt->validate) || (ctxt->replaceEntities)) &&
595  (ret->children == NULL) &&
597  int val;
598 
599  /*
600  * for validation purposes we really need to fetch and
601  * parse the external entity
602  */
603  xmlNodePtr children;
604  unsigned long oldnbent = ctxt->nbentities;
605 
606  val = xmlParseCtxtExternalEntity(ctxt, ret->URI,
607  ret->ExternalID, &children);
608  if (val == 0) {
609  xmlAddChildList((xmlNodePtr) ret, children);
610  } else {
611  xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_PROCESSING,
612  "Failure to process entity %s\n", name, NULL);
613  ctxt->validate = 0;
614  return(NULL);
615  }
616  ret->owner = 1;
617  if (ret->checked == 0) {
618  ret->checked = (ctxt->nbentities - oldnbent + 1) * 2;
619  if ((ret->content != NULL) && (xmlStrchr(ret->content, '<')))
620  ret->checked |= 1;
621  }
622  }
623  return(ret);
624 }
XMLPUBFUN int XMLCALL xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL, const xmlChar *ID, xmlNodePtr *lst)
Definition: parser.c:12867
XMLPUBFUN const xmlChar *XMLCALL xmlStrchr(const xmlChar *str, xmlChar val)
Definition: xmlstring.c:321
int standalone
Definition: tree.h:564
int replaceEntities
Definition: parser.h:189
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:346
smooth NULL
Definition: ftsmooth.c:416
int validate
Definition: parser.h:220
GLuint GLfloat * val
Definition: glext.h:7180
XMLPUBFUN xmlEntityPtr XMLCALL xmlGetPredefinedEntity(const xmlChar *name)
Definition: tree.h:489
XMLPUBFUN xmlEntityPtr XMLCALL xmlGetDocEntity(const xmlDoc *doc, const xmlChar *name)
int ret
xmlDocPtr myDoc
Definition: parser.h:187
int inSubset
Definition: parser.h:238
xmlParserCtxt * xmlParserCtxtPtr
Definition: tree.h:39
Definition: name.c:36
XMLPUBFUN xmlNodePtr XMLCALL xmlAddChildList(xmlNodePtr parent, xmlNodePtr cur)
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:362
unsigned long nbentities
Definition: parser.h:303

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

◆ xmlSAX2GetLineNumber()

XMLPUBFUN int XMLCALL 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 273 of file SAX2.c.

274 {
275  xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
276  if ((ctx == NULL) || (ctxt->input == NULL)) return(0);
277  return(ctxt->input->line);
278 }
xmlParserInputPtr input
Definition: parser.h:199
smooth NULL
Definition: ftsmooth.c:416
xmlParserCtxt * xmlParserCtxtPtr
Definition: tree.h:39

Referenced by xmlInitializeGlobalState().

◆ xmlSAX2GetParameterEntity()

XMLPUBFUN xmlEntityPtr XMLCALL xmlSAX2GetParameterEntity ( void ctx,
const xmlChar name 
)

Definition at line 636 of file SAX2.c.

637 {
638  xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
640 
641  if (ctx == NULL) return(NULL);
642 #ifdef DEBUG_SAX
644  "SAX.xmlSAX2GetParameterEntity(%s)\n", name);
645 #endif
646 
648  return(ret);
649 }
XMLPUBFUN xmlEntityPtr XMLCALL xmlGetParameterEntity(xmlDocPtr doc, const xmlChar *name)
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:346
smooth NULL
Definition: ftsmooth.c:416
int ret
xmlDocPtr myDoc
Definition: parser.h:187
xmlParserCtxt * xmlParserCtxtPtr
Definition: tree.h:39
Definition: name.c:36
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:362

Referenced by xmlSAXVersion().

◆ xmlSAX2GetPublicId()

XMLPUBFUN const xmlChar* XMLCALL xmlSAX2GetPublicId ( void ctx)

◆ xmlSAX2GetSystemId()

XMLPUBFUN const xmlChar* XMLCALL 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 257 of file SAX2.c.

258 {
259  xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
260  if ((ctx == NULL) || (ctxt->input == NULL)) return(NULL);
261  return((const xmlChar *) ctxt->input->filename);
262 }
xmlParserInputPtr input
Definition: parser.h:199
smooth NULL
Definition: ftsmooth.c:416
unsigned char xmlChar
Definition: xmlstring.h:28
const char * filename
Definition: parser.h:58
xmlParserCtxt * xmlParserCtxtPtr
Definition: tree.h:39

Referenced by xmlInitializeGlobalState().

◆ xmlSAX2HasExternalSubset()

XMLPUBFUN int XMLCALL 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 337 of file SAX2.c.

338 {
339  xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
340  if ((ctxt == NULL) || (ctxt->myDoc == NULL)) return(0);
341  return(ctxt->myDoc->extSubset != NULL);
342 }
smooth NULL
Definition: ftsmooth.c:416
xmlDocPtr myDoc
Definition: parser.h:187
xmlParserCtxt * xmlParserCtxtPtr
Definition: tree.h:39
struct _xmlDtd * extSubset
Definition: tree.h:571

Referenced by xmlSAXVersion().

◆ xmlSAX2HasInternalSubset()

XMLPUBFUN int XMLCALL 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 321 of file SAX2.c.

322 {
323  xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
324  if ((ctxt == NULL) || (ctxt->myDoc == NULL)) return(0);
325  return(ctxt->myDoc->intSubset != NULL);
326 }
struct _xmlDtd * intSubset
Definition: tree.h:570
smooth NULL
Definition: ftsmooth.c:416
xmlDocPtr myDoc
Definition: parser.h:187
xmlParserCtxt * xmlParserCtxtPtr
Definition: tree.h:39

Referenced by xmlSAXVersion().

◆ xmlSAX2IgnorableWhitespace()

XMLPUBFUN void XMLCALL xmlSAX2IgnorableWhitespace ( void ctx,
const xmlChar ch,
int  len 
)

◆ xmlSAX2InitDefaultSAXHandler()

XMLPUBFUN void XMLCALL 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 2921 of file SAX2.c.

2922 {
2923  if ((hdlr == NULL) || (hdlr->initialized != 0))
2924  return;
2925 
2927  if (warning == 0)
2928  hdlr->warning = NULL;
2929  else
2930  hdlr->warning = xmlParserWarning;
2931 }
int xmlSAXVersion(xmlSAXHandler *hdlr, int version)
Definition: SAX2.c:2866
warningSAXFunc warning
Definition: parser.h:741
unsigned int initialized
Definition: parser.h:747
static int xmlSAX2DefaultVersionValue
Definition: SAX2.c:2829
smooth NULL
Definition: ftsmooth.c:416
XMLPUBFUN void XMLCDECL XMLPUBFUN void XMLCDECL xmlParserWarning(void *ctx, const char *msg,...) LIBXML_ATTR_FORMAT(2
#define warning(s)
Definition: debug.h:71

◆ xmlSAX2InternalSubset()

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

Definition at line 354 of file SAX2.c.

356 {
357  xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
358  xmlDtdPtr dtd;
359  if (ctx == NULL) return;
360 #ifdef DEBUG_SAX
362  "SAX.xmlSAX2InternalSubset(%s, %s, %s)\n",
363  name, ExternalID, SystemID);
364 #endif
365 
366  if (ctxt->myDoc == NULL)
367  return;
368  dtd = xmlGetIntSubset(ctxt->myDoc);
369  if (dtd != NULL) {
370  if (ctxt->html)
371  return;
372  xmlUnlinkNode((xmlNodePtr) dtd);
373  xmlFreeDtd(dtd);
374  ctxt->myDoc->intSubset = NULL;
375  }
376  ctxt->myDoc->intSubset =
377  xmlCreateIntSubset(ctxt->myDoc, name, ExternalID, SystemID);
378  if (ctxt->myDoc->intSubset == NULL)
379  xmlSAX2ErrMemory(ctxt, "xmlSAX2InternalSubset");
380 }
struct _xmlDtd * intSubset
Definition: tree.h:570
Definition: tree.h:406
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:346
smooth NULL
Definition: ftsmooth.c:416
XMLPUBFUN void XMLCALL xmlFreeDtd(xmlDtdPtr cur)
XMLPUBFUN void XMLCALL xmlUnlinkNode(xmlNodePtr cur)
Definition: tree.h:489
xmlDocPtr myDoc
Definition: parser.h:187
XMLPUBFUN xmlDtdPtr XMLCALL xmlCreateIntSubset(xmlDocPtr doc, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID)
xmlParserCtxt * xmlParserCtxtPtr
Definition: tree.h:39
XMLPUBFUN xmlDtdPtr XMLCALL xmlGetIntSubset(const xmlDoc *doc)
Definition: name.c:36
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:362

Referenced by xmlSAXVersion().

◆ xmlSAX2IsStandalone()

XMLPUBFUN int XMLCALL xmlSAX2IsStandalone ( void ctx)

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

Is this document tagged standalone ?

Returns 1 if true

Definition at line 305 of file SAX2.c.

306 {
307  xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
308  if ((ctx == NULL) || (ctxt->myDoc == NULL)) return(0);
309  return(ctxt->myDoc->standalone == 1);
310 }
int standalone
Definition: tree.h:564
smooth NULL
Definition: ftsmooth.c:416
xmlDocPtr myDoc
Definition: parser.h:187
xmlParserCtxt * xmlParserCtxtPtr
Definition: tree.h:39

Referenced by xmlSAXVersion().

◆ xmlSAX2NotationDecl()

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

Definition at line 848 of file SAX2.c.

850 {
851  xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
852  xmlNotationPtr nota = NULL;
853 
854  if ((ctxt == NULL) || (ctxt->myDoc == NULL))
855  return;
856 
857 #ifdef DEBUG_SAX
859  "SAX.xmlSAX2NotationDecl(%s, %s, %s)\n", name, publicId, systemId);
860 #endif
861 
862  if ((publicId == NULL) && (systemId == NULL)) {
863  xmlFatalErrMsg(ctxt, XML_ERR_NOTATION_PROCESSING,
864  "SAX.xmlSAX2NotationDecl(%s) externalID or PublicID missing\n",
865  name, NULL);
866  return;
867  } else if (ctxt->inSubset == 1)
868  nota = xmlAddNotationDecl(&ctxt->vctxt, ctxt->myDoc->intSubset, name,
869  publicId, systemId);
870  else if (ctxt->inSubset == 2)
871  nota = xmlAddNotationDecl(&ctxt->vctxt, ctxt->myDoc->extSubset, name,
872  publicId, systemId);
873  else {
874  xmlFatalErrMsg(ctxt, XML_ERR_NOTATION_PROCESSING,
875  "SAX.xmlSAX2NotationDecl(%s) called while not in subset\n",
876  name, NULL);
877  return;
878  }
879 #ifdef LIBXML_VALID_ENABLED
880  if (nota == NULL) ctxt->valid = 0;
881  if ((ctxt->validate) && (ctxt->wellFormed) &&
882  (ctxt->myDoc->intSubset != NULL))
883  ctxt->valid &= xmlValidateNotationDecl(&ctxt->vctxt, ctxt->myDoc,
884  nota);
885 #endif /* LIBXML_VALID_ENABLED */
886 }
XMLPUBFUN xmlNotationPtr XMLCALL xmlAddNotationDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *name, const xmlChar *PublicID, const xmlChar *SystemID)
Definition: valid.c:2365
struct _xmlDtd * intSubset
Definition: tree.h:570
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:346
smooth NULL
Definition: ftsmooth.c:416
int validate
Definition: parser.h:220
int wellFormed
Definition: parser.h:188
xmlDocPtr myDoc
Definition: parser.h:187
int inSubset
Definition: parser.h:238
xmlParserCtxt * xmlParserCtxtPtr
Definition: tree.h:39
struct _xmlDtd * extSubset
Definition: tree.h:571
Definition: name.c:36
xmlValidCtxt vctxt
Definition: parser.h:221
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:362

Referenced by xmlSAXVersion().

◆ xmlSAX2ProcessingInstruction()

XMLPUBFUN void XMLCALL 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 2678 of file SAX2.c.

2680 {
2681  xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
2682  xmlNodePtr ret;
2684 
2685  if (ctx == NULL) return;
2686  parent = ctxt->node;
2687 #ifdef DEBUG_SAX
2689  "SAX.xmlSAX2ProcessingInstruction(%s, %s)\n", target, data);
2690 #endif
2691 
2692  ret = xmlNewDocPI(ctxt->myDoc, target, data);
2693  if (ret == NULL) return;
2694 
2695  if (ctxt->linenumbers) {
2696  if (ctxt->input != NULL) {
2697  if (ctxt->input->line < 65535)
2698  ret->line = (short) ctxt->input->line;
2699  else
2700  ret->line = 65535;
2701  }
2702  }
2703  if (ctxt->inSubset == 1) {
2705  return;
2706  } else if (ctxt->inSubset == 2) {
2708  return;
2709  }
2710  if (parent == NULL) {
2711 #ifdef DEBUG_SAX_TREE
2713  "Setting PI %s as root\n", target);
2714 #endif
2716  return;
2717  }
2718  if (parent->type == XML_ELEMENT_NODE) {
2719 #ifdef DEBUG_SAX_TREE
2721  "adding PI %s child to %s\n", target, parent->name);
2722 #endif
2724  } else {
2725 #ifdef DEBUG_SAX_TREE
2727  "adding PI %s sibling to ", target);
2728  xmlDebugDumpOneNode(stderr, parent, 0);
2729 #endif
2731  }
2732 }
struct _xmlDtd * intSubset
Definition: tree.h:570
XMLPUBFUN xmlNodePtr XMLCALL xmlAddSibling(xmlNodePtr cur, xmlNodePtr elem)
xmlParserInputPtr input
Definition: parser.h:199
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:93
int linenumbers
Definition: parser.h:259
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:346
smooth NULL
Definition: ftsmooth.c:416
XMLPUBFUN xmlNodePtr XMLCALL xmlAddChild(xmlNodePtr parent, xmlNodePtr cur)
xmlNodePtr node
Definition: parser.h:205
r parent
Definition: btrfs.c:2677
XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocPI(xmlDocPtr doc, const xmlChar *name, const xmlChar *content)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
Definition: tree.h:489
int ret
xmlDocPtr myDoc
Definition: parser.h:187
int inSubset
Definition: parser.h:238
xmlParserCtxt * xmlParserCtxtPtr
Definition: tree.h:39
struct _xmlDtd * extSubset
Definition: tree.h:571
GLenum target
Definition: glext.h:7315
FILE * stderr
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:362

Referenced by xmlSAXVersion().

◆ xmlSAX2Reference()

XMLPUBFUN void XMLCALL xmlSAX2Reference ( void ctx,
const xmlChar name 
)

Definition at line 2500 of file SAX2.c.

2501 {
2502  xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
2503  xmlNodePtr ret;
2504 
2505  if (ctx == NULL) return;
2506 #ifdef DEBUG_SAX
2508  "SAX.xmlSAX2Reference(%s)\n", name);
2509 #endif
2510  if (name[0] == '#')
2511  ret = xmlNewCharRef(ctxt->myDoc, name);
2512  else
2513  ret = xmlNewReference(ctxt->myDoc, name);
2514 #ifdef DEBUG_SAX_TREE
2516  "add xmlSAX2Reference %s to %s \n", name, ctxt->node->name);
2517 #endif
2518  if (xmlAddChild(ctxt->node, ret) == NULL) {
2519  xmlFreeNode(ret);
2520  }
2521 }
const xmlChar * name
Definition: tree.h:492
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:346
smooth NULL
Definition: ftsmooth.c:416
XMLPUBFUN xmlNodePtr XMLCALL xmlAddChild(xmlNodePtr parent, xmlNodePtr cur)
xmlNodePtr node
Definition: parser.h:205
Definition: tree.h:489
int ret
xmlDocPtr myDoc
Definition: parser.h:187
XMLPUBFUN xmlNodePtr XMLCALL xmlNewCharRef(xmlDocPtr doc, const xmlChar *name)
xmlParserCtxt * xmlParserCtxtPtr
Definition: tree.h:39
XMLPUBFUN void XMLCALL xmlFreeNode(xmlNodePtr cur)
Definition: name.c:36
XMLPUBFUN xmlNodePtr XMLCALL xmlNewReference(const xmlDoc *doc, const xmlChar *name)
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:362

Referenced by xmlSAXVersion().

◆ xmlSAX2ResolveEntity()

XMLPUBFUN xmlParserInputPtr XMLCALL 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 519 of file SAX2.c.

520 {
521  xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
523  xmlChar *URI;
524  const char *base = NULL;
525 
526  if (ctx == NULL) return(NULL);
527  if (ctxt->input != NULL)
528  base = ctxt->input->filename;
529  if (base == NULL)
530  base = ctxt->directory;
531 
532  URI = xmlBuildURI(systemId, (const xmlChar *) base);
533 
534 #ifdef DEBUG_SAX
536  "SAX.xmlSAX2ResolveEntity(%s, %s)\n", publicId, systemId);
537 #endif
538 
539  ret = xmlLoadExternalEntity((const char *) URI,
540  (const char *) publicId, ctxt);
541  if (URI != NULL)
542  xmlFree(URI);
543  return(ret);
544 }
xmlParserInputPtr input
Definition: parser.h:199
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:346
XMLPUBFUN xmlChar *XMLCALL xmlBuildURI(const xmlChar *URI, const xmlChar *base)
Definition: uri.c:1882
smooth NULL
Definition: ftsmooth.c:416
XMLPUBVAR xmlFreeFunc xmlFree
Definition: globals.h:250
int ret
unsigned char xmlChar
Definition: xmlstring.h:28
XMLPUBFUN xmlParserInputPtr XMLCALL xmlLoadExternalEntity(const char *URL, const char *ID, xmlParserCtxtPtr ctxt)
const char * filename
Definition: parser.h:58
char * directory
Definition: parser.h:226
xmlParserCtxt * xmlParserCtxtPtr
Definition: tree.h:39
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:362

Referenced by xmlSAXVersion().

◆ xmlSAX2SetDocumentLocator()

XMLPUBFUN void XMLCALL xmlSAX2SetDocumentLocator ( void ctx,
xmlSAXLocatorPtr  loc 
)

◆ xmlSAX2StartDocument()

XMLPUBFUN void XMLCALL xmlSAX2StartDocument ( void ctx)

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

called when the document start being processed.

Definition at line 983 of file SAX2.c.

984 {
985  xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
986  xmlDocPtr doc;
987 
988  if (ctx == NULL) return;
989 
990 #ifdef DEBUG_SAX
992  "SAX.xmlSAX2StartDocument()\n");
993 #endif
994  if (ctxt->html) {
995 #ifdef LIBXML_HTML_ENABLED
996  if (ctxt->myDoc == NULL)
997  ctxt->myDoc = htmlNewDocNoDtD(NULL, NULL);
998  if (ctxt->myDoc == NULL) {
999  xmlSAX2ErrMemory(ctxt, "xmlSAX2StartDocument");
1000  return;
1001  }
1002  ctxt->myDoc->properties = XML_DOC_HTML;
1003  ctxt->myDoc->parseFlags = ctxt->options;
1004 #else
1006  "libxml2 built without HTML support\n");
1007  ctxt->errNo = XML_ERR_INTERNAL_ERROR;
1008  ctxt->instate = XML_PARSER_EOF;
1009  ctxt->disableSAX = 1;
1010  return;
1011 #endif
1012  } else {
1013  doc = ctxt->myDoc = xmlNewDoc(ctxt->version);
1014  if (doc != NULL) {
1015  doc->properties = 0;
1016  if (ctxt->options & XML_PARSE_OLD10)
1017  doc->properties |= XML_DOC_OLD10;
1018  doc->parseFlags = ctxt->options;
1019  if (ctxt->encoding != NULL)
1020  doc->encoding = xmlStrdup(ctxt->encoding);
1021  else
1022  doc->encoding = NULL;
1023  doc->standalone = ctxt->standalone;
1024  } else {
1025  xmlSAX2ErrMemory(ctxt, "xmlSAX2StartDocument");
1026  return;
1027  }
1028  if ((ctxt->dictNames) && (doc != NULL)) {
1029  doc->dict = ctxt->dict;
1030  xmlDictReference(doc->dict);
1031  }
1032  }
1033  if ((ctxt->myDoc != NULL) && (ctxt->myDoc->URL == NULL) &&
1034  (ctxt->input != NULL) && (ctxt->input->filename != NULL)) {
1035  ctxt->myDoc->URL = xmlPathToURI((const xmlChar *)ctxt->input->filename);
1036  if (ctxt->myDoc->URL == NULL)
1037  xmlSAX2ErrMemory(ctxt, "xmlSAX2StartDocument");
1038  }
1039 }
XMLPUBFUN xmlChar *XMLCALL xmlPathToURI(const xmlChar *path)
Definition: uri.c:2511
XMLPUBFUN int XMLCALL xmlDictReference(xmlDictPtr dict)
Definition: dict.c:638
xmlParserInputState instate
Definition: parser.h:223
int properties
Definition: tree.h:584
const xmlChar * URL
Definition: tree.h:577
xmlParserInputPtr input
Definition: parser.h:199
int disableSAX
Definition: parser.h:237
int standalone
Definition: tree.h:564
int standalone
Definition: parser.h:192
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:346
smooth NULL
Definition: ftsmooth.c:416
xmlDictPtr dict
Definition: parser.h:263
xmlDocPtr myDoc
Definition: parser.h:187
const xmlChar * encoding
Definition: parser.h:191
unsigned char xmlChar
Definition: xmlstring.h:28
const xmlChar * version
Definition: parser.h:190
int dictNames
Definition: parser.h:292
const xmlChar * encoding
Definition: tree.h:574
const char * filename
Definition: parser.h:58
int parseFlags
Definition: tree.h:582
xmlParserCtxt * xmlParserCtxtPtr
Definition: tree.h:39
Definition: tree.h:551
XMLPUBFUN xmlDocPtr XMLCALL xmlNewDoc(const xmlChar *version)
struct _xmlDict * dict
Definition: tree.h:580
XMLPUBFUN xmlChar *XMLCALL xmlStrdup(const xmlChar *cur)
Definition: xmlstring.c:66
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:362

Referenced by xmlSAXVersion().

◆ xmlSAX2StartElementNs()

XMLPUBFUN void XMLCALL 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 informations for the element, as well as the new namespace declarations on the element.

Definition at line 2208 of file SAX2.c.

2217 {
2218  xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
2219  xmlNodePtr ret;
2221  xmlNsPtr last = NULL, ns;
2222  const xmlChar *uri, *pref;
2223  xmlChar *lname = NULL;
2224  int i, j;
2225 
2226  if (ctx == NULL) return;
2227  parent = ctxt->node;
2228  /*
2229  * First check on validity:
2230  */
2231  if (ctxt->validate && (ctxt->myDoc->extSubset == NULL) &&
2232  ((ctxt->myDoc->intSubset == NULL) ||
2233  ((ctxt->myDoc->intSubset->notations == NULL) &&
2234  (ctxt->myDoc->intSubset->elements == NULL) &&
2235  (ctxt->myDoc->intSubset->attributes == NULL) &&
2236  (ctxt->myDoc->intSubset->entities == NULL)))) {
2237  xmlErrValid(ctxt, XML_DTD_NO_DTD,
2238  "Validation failed: no DTD found !", NULL, NULL);
2239  ctxt->validate = 0;
2240  }
2241 
2242  /*
2243  * Take care of the rare case of an undefined namespace prefix
2244  */
2245  if ((prefix != NULL) && (URI == NULL)) {
2246  if (ctxt->dictNames) {
2247  const xmlChar *fullname;
2248 
2249  fullname = xmlDictQLookup(ctxt->dict, prefix, localname);
2250  if (fullname != NULL)
2251  localname = fullname;
2252  } else {
2253  lname = xmlBuildQName(localname, prefix, NULL, 0);
2254  }
2255  }
2256  /*
2257  * allocate the node
2258  */
2259  if (ctxt->freeElems != NULL) {
2260  ret = ctxt->freeElems;
2261  ctxt->freeElems = ret->next;
2262  ctxt->freeElemsNr--;
2263  memset(ret, 0, sizeof(xmlNode));
2264  ret->doc = ctxt->myDoc;
2265  ret->type = XML_ELEMENT_NODE;
2266 
2267  if (ctxt->dictNames)
2268  ret->name = localname;
2269  else {
2270  if (lname == NULL)
2271  ret->name = xmlStrdup(localname);
2272  else
2273  ret->name = lname;
2274  if (ret->name == NULL) {
2275  xmlSAX2ErrMemory(ctxt, "xmlSAX2StartElementNs");
2276  return;
2277  }
2278  }
2281  } else {
2282  if (ctxt->dictNames)
2284  (xmlChar *) localname, NULL);
2285  else if (lname == NULL)
2286  ret = xmlNewDocNode(ctxt->myDoc, NULL, localname, NULL);
2287  else
2289  (xmlChar *) lname, NULL);
2290  if (ret == NULL) {
2291  xmlSAX2ErrMemory(ctxt, "xmlSAX2StartElementNs");
2292  return;
2293  }
2294  }
2295  if (ctxt->linenumbers) {
2296  if (ctxt->input != NULL) {
2297  if (ctxt->input->line < 65535)
2298  ret->line = (short) ctxt->input->line;
2299  else
2300  ret->line = 65535;
2301  }
2302  }
2303 
2304  if (parent == NULL) {
2306  }
2307  /*
2308  * Build the namespace list
2309  */
2310  for (i = 0,j = 0;j < nb_namespaces;j++) {
2311  pref = namespaces[i++];
2312  uri = namespaces[i++];
2313  ns = xmlNewNs(NULL, uri, pref);
2314  if (ns != NULL) {
2315  if (last == NULL) {
2316  ret->nsDef = last = ns;
2317  } else {
2318  last->next = ns;
2319  last = ns;
2320  }
2321  if ((URI != NULL) && (prefix == pref))
2322  ret->ns = ns;
2323  } else {
2324  /*
2325  * any out of memory error would already have been raised
2326  * but we can't be guaranteed it's the actual error due to the
2327  * API, best is to skip in this case
2328  */
2329  continue;
2330  }
2331 #ifdef LIBXML_VALID_ENABLED
2332  if ((!ctxt->html) && ctxt->validate && ctxt->wellFormed &&
2333  ctxt->myDoc && ctxt->myDoc->intSubset) {
2334  ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc,
2335  ret, prefix, ns, uri);
2336  }
2337 #endif /* LIBXML_VALID_ENABLED */
2338  }
2339  ctxt->nodemem = -1;
2340 
2341  /*
2342  * We are parsing a new node.
2343  */
2344  if (nodePush(ctxt, ret) < 0) {
2345  xmlUnlinkNode(ret);
2346  xmlFreeNode(ret);
2347  return;
2348  }
2349 
2350  /*
2351  * Link the child element
2352  */
2353  if (parent != NULL) {
2354  if (parent->type == XML_ELEMENT_NODE) {
2356  } else {
2358  }
2359  }
2360 
2361  /*
2362  * Insert the defaulted attributes from the DTD only if requested:
2363  */
2364  if ((nb_defaulted != 0) &&
2365  ((ctxt->loadsubset & XML_COMPLETE_ATTRS) == 0))
2366  nb_attributes -= nb_defaulted;
2367 
2368  /*
2369  * Search the namespace if it wasn't already found
2370  * Note that, if prefix is NULL, this searches for the default Ns
2371  */
2372  if ((URI != NULL) && (ret->ns == NULL)) {
2373  ret->ns = xmlSearchNs(ctxt->myDoc, parent, prefix);
2374  if ((ret->ns == NULL) && (xmlStrEqual(prefix, BAD_CAST "xml"))) {
2375  ret->ns = xmlSearchNs(ctxt->myDoc, ret, prefix);
2376  }
2377  if (ret->ns == NULL) {
2378  ns = xmlNewNs(ret, NULL, prefix);
2379  if (ns == NULL) {
2380 
2381  xmlSAX2ErrMemory(ctxt, "xmlSAX2StartElementNs");
2382  return;
2383  }
2384  if (prefix != NULL)
2385  xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
2386  "Namespace prefix %s was not found\n",
2387  prefix, NULL);
2388  else
2389  xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
2390  "Namespace default prefix was not found\n",
2391  NULL, NULL);
2392  }
2393  }
2394 
2395  /*
2396  * process all the other attributes
2397  */
2398  if (nb_attributes > 0) {
2399  for (j = 0,i = 0;i < nb_attributes;i++,j+=5) {
2400  /*
2401  * Handle the rare case of an undefined atribute prefix
2402  */
2403  if ((attributes[j+1] != NULL) && (attributes[j+2] == NULL)) {
2404  if (ctxt->dictNames) {
2405  const xmlChar *fullname;
2406 
2407  fullname = xmlDictQLookup(ctxt->dict, attributes[j+1],
2408  attributes[j]);
2409  if (fullname != NULL) {
2410  xmlSAX2AttributeNs(ctxt, fullname, NULL,
2411  attributes[j+3], attributes[j+4]);
2412  continue;
2413  }
2414  } else {
2415  lname = xmlBuildQName(attributes[j], attributes[j+1],
2416  NULL, 0);
2417  if (lname != NULL) {
2418  xmlSAX2AttributeNs(ctxt, lname, NULL,
2419  attributes[j+3], attributes[j+4]);
2420  xmlFree(lname);
2421  continue;
2422  }
2423  }
2424  }
2425  xmlSAX2AttributeNs(ctxt, attributes[j], attributes[j+1],
2426  attributes[j+3], attributes[j+4]);
2427  }
2428  }
2429 
2430 #ifdef LIBXML_VALID_ENABLED
2431  /*
2432  * If it's the Document root, finish the DTD validation and
2433  * check the document root element for validity
2434  */
2435  if ((ctxt->validate) && (ctxt->vctxt.finishDtd == XML_CTXT_FINISH_DTD_0)) {
2436  int chk;
2437 
2438  chk = xmlValidateDtdFinal(&ctxt->vctxt, ctxt->myDoc);
2439  if (chk <= 0)
2440  ctxt->valid = 0;
2441  if (chk < 0)
2442  ctxt->wellFormed = 0;
2443  ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
2444  ctxt->vctxt.finishDtd = XML_CTXT_FINISH_DTD_1;
2445  }
2446 #endif /* LIBXML_VALID_ENABLED */
2447 }
XMLPUBFUN xmlChar *XMLCALL xmlBuildQName(const xmlChar *ncname, const xmlChar *prefix, xmlChar *memory, int len)
struct _xmlDtd * intSubset
Definition: tree.h:570
unsigned int finishDtd
Definition: valid.h:93
POINT last
Definition: font.c:46
const char * uri
Definition: sec_mgr.c:1594
Definition: tree.h:389
static void xmlSAX2AttributeNs(xmlParserCtxtPtr ctxt, const xmlChar *localname, const xmlChar *prefix, const xmlChar *value, const xmlChar *valueend)
Definition: SAX2.c:1978
XMLPUBFUN xmlNodePtr XMLCALL xmlAddSibling(xmlNodePtr cur, xmlNodePtr elem)
XMLPUBVAR xmlRegisterNodeFunc xmlRegisterNodeDefaultValue
Definition: globals.h:476
XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocNodeEatName(xmlDocPtr doc, xmlNsPtr ns, xmlChar *name, const xmlChar *content)
xmlParserInputPtr input
Definition: parser.h:199
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:93
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
int linenumbers
Definition: parser.h:259
XMLPUBFUN xmlNsPtr XMLCALL xmlSearchNs(xmlDocPtr doc, xmlNodePtr node, const xmlChar *nameSpace)
int __xmlRegisterCallbacks
Definition: tree.c:53
smooth NULL
Definition: ftsmooth.c:416
#define BAD_CAST
Definition: xmlstring.h:35
xmlDictPtr dict
Definition: parser.h:263
int validate
Definition: parser.h:220
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
XMLPUBFUN xmlNodePtr XMLCALL xmlAddChild(xmlNodePtr parent, xmlNodePtr cur)
int wellFormed
Definition: parser.h:188
xmlNodePtr node
Definition: parser.h:205
r parent
Definition: btrfs.c:2677
int freeElemsNr
Definition: parser.h:293
XMLPUBFUN void XMLCALL xmlUnlinkNode(xmlNodePtr cur)
XMLPUBVAR xmlFreeFunc xmlFree
Definition: globals.h:250
XMLPUBFUN int XMLCALL nodePush(xmlParserCtxtPtr ctxt, xmlNodePtr value)
Definition: parser.c:1767
Definition: tree.h:489
int ret
xmlDocPtr myDoc
Definition: parser.h:187
Definition: mxnamespace.c:44
unsigned char xmlChar
Definition: xmlstring.h:28
int loadsubset
Definition: parser.h:258
XMLPUBFUN const xmlChar *XMLCALL xmlDictQLookup(xmlDictPtr dict, const xmlChar *prefix, const xmlChar *name)
Definition: dict.c:1106
int dictNames
Definition: parser.h:292
XMLPUBFUN xmlNsPtr XMLCALL xmlNewNs(xmlNodePtr node, const xmlChar *href, const xmlChar *prefix)
#define XML_COMPLETE_ATTRS
Definition: parser.h:148
XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocNode(xmlDocPtr doc, xmlNsPtr ns, const xmlChar *name, const xmlChar *content)
xmlParserCtxt * xmlParserCtxtPtr
Definition: tree.h:39
XMLPUBFUN void XMLCALL xmlFreeNode(xmlNodePtr cur)
struct _xmlDtd * extSubset
Definition: tree.h:571
XMLPUBFUN int XMLCALL xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
Definition: xmlstring.c:157
xmlValidCtxt vctxt
Definition: parser.h:221
#define memset(x, y, z)
Definition: compat.h:39
XMLPUBFUN xmlChar *XMLCALL xmlStrdup(const xmlChar *cur)
Definition: xmlstring.c:66
xmlNodePtr freeElems
Definition: parser.h:294

Referenced by xmlSAXVersion().

◆ xmlSAX2UnparsedEntityDecl()

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

Definition at line 899 of file SAX2.c.

902 {
903  xmlEntityPtr ent;
904  xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
905  if (ctx == NULL) return;
906 #ifdef DEBUG_SAX
908  "SAX.xmlSAX2UnparsedEntityDecl(%s, %s, %s, %s)\n",
909  name, publicId, systemId, notationName);
910 #endif
911  if (ctxt->inSubset == 1) {
912  ent = xmlAddDocEntity(ctxt->myDoc, name,
914  publicId, systemId, notationName);
915  if ((ent == NULL) && (ctxt->pedantic) &&
916  (ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
917  ctxt->sax->warning(ctxt->userData,
918  "Entity(%s) already defined in the internal subset\n", name);
919  if ((ent != NULL) && (ent->URI == NULL) && (systemId != NULL)) {
920  xmlChar *URI;
921  const char *base = NULL;
922 
923  if (ctxt->input != NULL)
924  base = ctxt->input->filename;
925  if (base == NULL)
926  base = ctxt->directory;
927 
928  URI = xmlBuildURI(systemId, (const xmlChar *) base);
929  ent->URI = URI;
930  }
931  } else if (ctxt->inSubset == 2) {
932  ent = xmlAddDtdEntity(ctxt->myDoc, name,
934  publicId, systemId, notationName);
935  if ((ent == NULL) && (ctxt->pedantic) &&
936  (ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
937  ctxt->sax->warning(ctxt->userData,
938  "Entity(%s) already defined in the external subset\n", name);
939  if ((ent != NULL) && (ent->URI == NULL) && (systemId != NULL)) {
940  xmlChar *URI;
941  const char *base = NULL;
942 
943  if (ctxt->input != NULL)
944  base = ctxt->input->filename;
945  if (base == NULL)
946  base = ctxt->directory;
947 
948  URI = xmlBuildURI(systemId, (const xmlChar *) base);
949  ent->URI = URI;
950  }
951  } else {
952  xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
953  "SAX.xmlSAX2UnparsedEntityDecl(%s) called while not in subset\n",
954  name, NULL);
955  }
956 }
int pedantic
Definition: parser.h:255
const xmlChar * URI
Definition: entities.h:57
xmlParserInputPtr input
Definition: parser.h:199
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:346
XMLPUBFUN xmlChar *XMLCALL xmlBuildURI(const xmlChar *URI, const xmlChar *base)
Definition: uri.c:1882
smooth NULL
Definition: ftsmooth.c:416
XMLPUBFUN xmlEntityPtr XMLCALL xmlAddDtdEntity(xmlDocPtr doc, const xmlChar *name, int type, const xmlChar *ExternalID, const xmlChar *SystemID, const xmlChar *content)
xmlDocPtr myDoc
Definition: parser.h:187
unsigned char xmlChar
Definition: xmlstring.h:28
struct _xmlSAXHandler * sax
Definition: parser.h:185
const char * filename
Definition: parser.h:58
int inSubset
Definition: parser.h:238
XMLPUBFUN xmlEntityPtr XMLCALL xmlAddDocEntity(xmlDocPtr doc, const xmlChar *name, int type, const xmlChar *ExternalID, const xmlChar *SystemID, const xmlChar *content)
char * directory
Definition: parser.h:226
xmlParserCtxt * xmlParserCtxtPtr
Definition: tree.h:39
Definition: name.c:36
void * userData
Definition: parser.h:186
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:362

Referenced by xmlSAXVersion().

◆ xmlSAXVersion()

XMLPUBFUN int XMLCALL 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 2866 of file SAX2.c.

2867 {
2868  if (hdlr == NULL) return(-1);
2869  if (version == 2) {
2870  hdlr->startElement = NULL;
2871  hdlr->endElement = NULL;
2874  hdlr->serror = NULL;
2875  hdlr->initialized = XML_SAX2_MAGIC;
2876 #ifdef LIBXML_SAX1_ENABLED
2877  } else if (version == 1) {
2878  hdlr->startElement = xmlSAX2StartElement;
2879  hdlr->endElement = xmlSAX2EndElement;
2880  hdlr->initialized = 1;
2881 #endif /* LIBXML_SAX1_ENABLED */
2882  } else
2883  return(-1);
2890  hdlr->getEntity = xmlSAX2GetEntity;
2892  hdlr->entityDecl = xmlSAX2EntityDecl;
2900  hdlr->reference = xmlSAX2Reference;
2901  hdlr->characters = xmlSAX2Characters;
2902  hdlr->cdataBlock = xmlSAX2CDataBlock;
2905  hdlr->comment = xmlSAX2Comment;
2906  hdlr->warning = xmlParserWarning;
2907  hdlr->error = xmlParserError;
2908  hdlr->fatalError = xmlParserError;
2909 
2910  return(0);
2911 }
internalSubsetSAXFunc internalSubset
Definition: parser.h:720
processingInstructionSAXFunc processingInstruction
Definition: parser.h:739
endElementNsSAX2Func endElementNs
Definition: parser.h:751
xmlEntityPtr xmlSAX2GetEntity(void *ctx, const xmlChar *name)
Definition: SAX2.c:556
xmlParserInputPtr xmlSAX2ResolveEntity(void *ctx, const xmlChar *publicId, const xmlChar *systemId)
Definition: SAX2.c:519
void xmlSAX2EndElementNs(void *ctx, const xmlChar *localname ATTRIBUTE_UNUSED, const xmlChar *prefix ATTRIBUTE_UNUSED, const xmlChar *URI ATTRIBUTE_UNUSED)
Definition: SAX2.c:2460
endDocumentSAXFunc endDocument
Definition: parser.h:733
#define XML_SAX2_MAGIC
Definition: parser.h:671
setDocumentLocatorSAXFunc setDocumentLocator
Definition: parser.h:731
entityDeclSAXFunc entityDecl
Definition: parser.h:726
void xmlSAX2NotationDecl(void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId)
Definition: SAX2.c:848
void xmlSAX2SetDocumentLocator(void *ctx ATTRIBUTE_UNUSED, xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED)
Definition: SAX2.c:967
void xmlSAX2CDataBlock(void *ctx, const xmlChar *value, int len)
Definition: SAX2.c:2804
int xmlSAX2IsStandalone(void *ctx)
Definition: SAX2.c:305
warningSAXFunc warning
Definition: parser.h:741
resolveEntitySAXFunc resolveEntity
Definition: parser.h:724
unsigned int initialized
Definition: parser.h:747
isStandaloneSAXFunc isStandalone
Definition: parser.h:721
void xmlSAX2AttributeDecl(void *ctx, const xmlChar *elem, const xmlChar *fullname, int type, int def, const xmlChar *defaultValue, xmlEnumerationPtr tree)
Definition: SAX2.c:734
void xmlSAX2ElementDecl(void *ctx, const xmlChar *name, int type, xmlElementContentPtr content)
Definition: SAX2.c:802
startElementSAXFunc startElement
Definition: parser.h:734
void xmlSAX2Comment(void *ctx, const xmlChar *value)
Definition: SAX2.c:2742
attributeDeclSAXFunc attributeDecl
Definition: parser.h:728
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR version[]
Definition: asmname.c:64
void xmlSAX2ExternalSubset(void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID)
Definition: SAX2.c:392
cdataBlockSAXFunc cdataBlock
Definition: parser.h:745
endElementSAXFunc endElement
Definition: parser.h:735
void xmlSAX2Reference(void *ctx, const xmlChar *name)
Definition: SAX2.c:2500
ignorableWhitespaceSAXFunc ignorableWhitespace
Definition: parser.h:738
void xmlSAX2InternalSubset(void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID)
Definition: SAX2.c:354
hasInternalSubsetSAXFunc hasInternalSubset
Definition: parser.h:722
XMLPUBFUN void XMLCDECL xmlParserError(void *ctx, const char *msg,...) LIBXML_ATTR_FORMAT(2
unparsedEntityDeclSAXFunc unparsedEntityDecl
Definition: parser.h:730
void xmlSAX2Characters(void *ctx, const xmlChar *ch, int len)
Definition: SAX2.c:2532
void xmlSAX2EntityDecl(void *ctx, const xmlChar *name, int type, const xmlChar *publicId, const xmlChar *systemId, xmlChar *content)
Definition: SAX2.c:664
void xmlSAX2ProcessingInstruction(void *ctx, const xmlChar *target, const xmlChar *data)
Definition: SAX2.c:2678
void xmlSAX2EndDocument(void *ctx)
Definition: SAX2.c:1048
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:2208
void xmlSAX2StartDocument(void *ctx)
Definition: SAX2.c:983
xmlEntityPtr xmlSAX2GetParameterEntity(void *ctx, const xmlChar *name)
Definition: SAX2.c:636
xmlStructuredErrorFunc serror
Definition: parser.h:752
fatalErrorSAXFunc fatalError
Definition: parser.h:743
errorSAXFunc error
Definition: parser.h:742
getEntitySAXFunc getEntity
Definition: parser.h:725
notationDeclSAXFunc notationDecl
Definition: parser.h:727
elementDeclSAXFunc elementDecl
Definition: parser.h:729
XMLPUBFUN void XMLCDECL XMLPUBFUN void XMLCDECL xmlParserWarning(void *ctx, const char *msg,...) LIBXML_ATTR_FORMAT(2
externalSubsetSAXFunc externalSubset
Definition: parser.h:746
startDocumentSAXFunc startDocument
Definition: parser.h:732
getParameterEntitySAXFunc getParameterEntity
Definition: parser.h:744
commentSAXFunc comment
Definition: parser.h:740
charactersSAXFunc characters
Definition: parser.h:737
int xmlSAX2HasInternalSubset(void *ctx)
Definition: SAX2.c:321
int xmlSAX2HasExternalSubset(void *ctx)
Definition: SAX2.c:337
hasExternalSubsetSAXFunc hasExternalSubset
Definition: parser.h:723
void xmlSAX2UnparsedEntityDecl(void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId, const xmlChar *notationName)
Definition: SAX2.c:899
referenceSAXFunc reference
Definition: parser.h:736
startElementNsSAX2Func startElementNs
Definition: parser.h:750

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