* Update to v2.9.2.
CORE-8642
svn path=/trunk/; revision=64779
xmlSAX2StartDocument (void *ctx);
XMLPUBFUN void XMLCALL
xmlSAX2EndDocument (void *ctx);
-#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
+#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || \
+ defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || \
+ defined(LIBXML_LEGACY_ENABLED)
XMLPUBFUN void XMLCALL
xmlSAX2StartElement (void *ctx,
const xmlChar *fullname,
XMLPUBFUN void XMLCALL
xmlSAX2EndElement (void *ctx,
const xmlChar *name);
-#endif /* LIBXML_SAX1_ENABLED or LIBXML_HTML_ENABLED */
+#endif /* LIBXML_SAX1_ENABLED or LIBXML_HTML_ENABLED or LIBXML_LEGACY_ENABLED */
XMLPUBFUN void XMLCALL
xmlSAX2StartElementNs (void *ctx,
const xmlChar *localname,
const xmlChar *URI; /* the full URI as computed */
int owner; /* does the entity own the childrens */
int checked; /* was the entity content checked */
- /* this is also used to count entites
+ /* this is also used to count entities
* references done from that entity
* and if it contains '<' */
};
XMLPUBFUN xmlEntityPtr XMLCALL
xmlGetPredefinedEntity (const xmlChar *name);
XMLPUBFUN xmlEntityPtr XMLCALL
- xmlGetDocEntity (xmlDocPtr doc,
+ xmlGetDocEntity (const xmlDoc *doc,
const xmlChar *name);
XMLPUBFUN xmlEntityPtr XMLCALL
xmlGetDtdEntity (xmlDocPtr doc,
xmlEncodeEntitiesReentrant(xmlDocPtr doc,
const xmlChar *input);
XMLPUBFUN xmlChar * XMLCALL
- xmlEncodeSpecialChars (xmlDocPtr doc,
+ xmlEncodeSpecialChars (const xmlDoc *doc,
const xmlChar *input);
XMLPUBFUN xmlEntitiesTablePtr XMLCALL
xmlCreateEntitiesTable (void);
* Returns the new xmlParserInputBufferPtr in case of success or NULL if no
* method was found.
*/
-typedef xmlParserInputBufferPtr (*xmlParserInputBufferCreateFilenameFunc) (const char *URI, xmlCharEncoding enc);
+typedef xmlParserInputBufferPtr (*xmlParserInputBufferCreateFilenameFunc) (const char *URI,
+ xmlCharEncoding enc);
+
/**
* xmlOutputBufferCreateFilenameFunc:
* Returns the new xmlOutputBufferPtr in case of success or NULL if no
* method was found.
*/
-typedef xmlOutputBufferPtr (*xmlOutputBufferCreateFilenameFunc) (const char *URI, xmlCharEncodingHandlerPtr encoder, int compression);
+typedef xmlOutputBufferPtr (*xmlOutputBufferCreateFilenameFunc) (const char *URI,
+ xmlCharEncodingHandlerPtr encoder,
+ int compression);
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc
XMLCALL xmlParserInputBufferCreateFilenameDefault (xmlParserInputBufferCreateFilenameFunc func);
XMLPUBFUN xmlOutputBufferCreateFilenameFunc XMLCALL
xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func);
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc XMLCALL
- xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func);
+ xmlThrDefParserInputBufferCreateFilenameDefault(
+ xmlParserInputBufferCreateFilenameFunc func);
/** DOC_DISABLE */
/*
#else
XMLPUBVAR xmlBufferAllocationScheme xmlBufferAllocScheme;
#endif
-XMLPUBFUN xmlBufferAllocationScheme XMLCALL xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v);
+XMLPUBFUN xmlBufferAllocationScheme XMLCALL
+ xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v);
XMLPUBFUN int * XMLCALL __xmlDefaultBufferSize(void);
#ifdef LIBXML_THREAD_ENABLED
XMLPUBVAR xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue;
#endif
-XMLPUBFUN xmlParserInputBufferCreateFilenameFunc * XMLCALL __xmlParserInputBufferCreateFilenameValue(void);
+XMLPUBFUN xmlParserInputBufferCreateFilenameFunc * XMLCALL \
+ __xmlParserInputBufferCreateFilenameValue(void);
#ifdef LIBXML_THREAD_ENABLED
#define xmlParserInputBufferCreateFilenameValue \
(*(__xmlParserInputBufferCreateFilenameValue()))
*
* Signature of an error callback from a Relax-NG validation
*/
-typedef void (XMLCDECL *xmlRelaxNGValidityErrorFunc) (void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
+typedef void (XMLCDECL *xmlRelaxNGValidityErrorFunc) (void *ctx,
+ const char *msg,
+ ...) LIBXML_ATTR_FORMAT(2,3);
/**
* xmlRelaxNGValidityWarningFunc:
*
* Signature of a warning callback from a Relax-NG validation
*/
-typedef void (XMLCDECL *xmlRelaxNGValidityWarningFunc) (void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
+typedef void (XMLCDECL *xmlRelaxNGValidityWarningFunc) (void *ctx,
+ const char *msg,
+ ...) LIBXML_ATTR_FORMAT(2,3);
/**
* A schemas validation context
* A few public routines for xmlBuf. As those are expected to be used
* mostly internally the bulk of the routines are internal in buf.h
*/
-XMLPUBFUN xmlChar* XMLCALL xmlBufContent (const xmlBufPtr buf);
-XMLPUBFUN xmlChar* XMLCALL xmlBufEnd (const xmlBufPtr buf);
+XMLPUBFUN xmlChar* XMLCALL xmlBufContent (const xmlBuf* buf);
+XMLPUBFUN xmlChar* XMLCALL xmlBufEnd (xmlBufPtr buf);
XMLPUBFUN size_t XMLCALL xmlBufUse (const xmlBufPtr buf);
XMLPUBFUN size_t XMLCALL xmlBufShrink (xmlBufPtr buf, size_t len);
/*
* Some helper functions
*/
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
+#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || \
+ defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || \
+ defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || \
+ defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || \
+ defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
XMLPUBFUN int XMLCALL
xmlValidateNCName (const xmlChar *value,
int space);
XMLPUBFUN void XMLCALL
xmlBufferEmpty (xmlBufferPtr buf);
XMLPUBFUN const xmlChar* XMLCALL
- xmlBufferContent (const xmlBufferPtr buf);
+ xmlBufferContent (const xmlBuffer *buf);
XMLPUBFUN xmlChar* XMLCALL
xmlBufferDetach (xmlBufferPtr buf);
XMLPUBFUN void XMLCALL
xmlBufferSetAllocationScheme(xmlBufferPtr buf,
xmlBufferAllocationScheme scheme);
XMLPUBFUN int XMLCALL
- xmlBufferLength (const xmlBufferPtr buf);
+ xmlBufferLength (const xmlBuffer *buf);
/*
* Creating/freeing new structures.
const xmlChar *ExternalID,
const xmlChar *SystemID);
XMLPUBFUN xmlDtdPtr XMLCALL
- xmlGetIntSubset (xmlDocPtr doc);
+ xmlGetIntSubset (const xmlDoc *doc);
XMLPUBFUN void XMLCALL
xmlFreeDtd (xmlDtdPtr cur);
#ifdef LIBXML_LEGACY_ENABLED
const xmlChar *content);
#endif
XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewDocText (xmlDocPtr doc,
+ xmlNewDocText (const xmlDoc *doc,
const xmlChar *content);
XMLPUBFUN xmlNodePtr XMLCALL
xmlNewText (const xmlChar *content);
xmlNewCharRef (xmlDocPtr doc,
const xmlChar *name);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlNewReference (xmlDocPtr doc,
+ xmlNewReference (const xmlDoc *doc,
const xmlChar *name);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlCopyNode (const xmlNodePtr node,
+ xmlCopyNode (xmlNodePtr node,
int recursive);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlDocCopyNode (const xmlNodePtr node,
+ xmlDocCopyNode (xmlNodePtr node,
xmlDocPtr doc,
int recursive);
XMLPUBFUN xmlNodePtr XMLCALL
xmlDocCopyNodeList (xmlDocPtr doc,
- const xmlNodePtr node);
+ xmlNodePtr node);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlCopyNodeList (const xmlNodePtr node);
+ xmlCopyNodeList (xmlNodePtr node);
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN xmlNodePtr XMLCALL
xmlNewTextChild (xmlNodePtr parent,
* Navigating.
*/
XMLPUBFUN long XMLCALL
- xmlGetLineNo (xmlNodePtr node);
+ xmlGetLineNo (const xmlNode *node);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
XMLPUBFUN xmlChar * XMLCALL
- xmlGetNodePath (xmlNodePtr node);
+ xmlGetNodePath (const xmlNode *node);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) */
XMLPUBFUN xmlNodePtr XMLCALL
- xmlDocGetRootElement (xmlDocPtr doc);
+ xmlDocGetRootElement (const xmlDoc *doc);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlGetLastChild (xmlNodePtr parent);
+ xmlGetLastChild (const xmlNode *parent);
XMLPUBFUN int XMLCALL
- xmlNodeIsText (xmlNodePtr node);
+ xmlNodeIsText (const xmlNode *node);
XMLPUBFUN int XMLCALL
- xmlIsBlankNode (xmlNodePtr node);
+ xmlIsBlankNode (const xmlNode *node);
/*
* Changing the structure.
xmlNodePtr cur);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \
- defined(LIBXML_SCHEMAS_ENABLED)
+ defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
XMLPUBFUN xmlNodePtr XMLCALL
xmlAddPrevSibling (xmlNodePtr cur,
xmlNodePtr elem);
xmlSearchNsByHref (xmlDocPtr doc,
xmlNodePtr node,
const xmlChar *href);
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
+#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || \
+ defined(LIBXML_SCHEMAS_ENABLED)
XMLPUBFUN xmlNsPtr * XMLCALL
- xmlGetNsList (xmlDocPtr doc,
- xmlNodePtr node);
+ xmlGetNsList (const xmlDoc *doc,
+ const xmlNode *node);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) */
XMLPUBFUN void XMLCALL
/*
* Changing the content.
*/
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
+#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || \
+ defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
XMLPUBFUN xmlAttrPtr XMLCALL
xmlSetProp (xmlNodePtr node,
const xmlChar *name,
xmlNsPtr ns,
const xmlChar *name,
const xmlChar *value);
-#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) */
+#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || \
+ defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) */
XMLPUBFUN xmlChar * XMLCALL
- xmlGetNoNsProp (xmlNodePtr node,
+ xmlGetNoNsProp (const xmlNode *node,
const xmlChar *name);
XMLPUBFUN xmlChar * XMLCALL
- xmlGetProp (xmlNodePtr node,
+ xmlGetProp (const xmlNode *node,
const xmlChar *name);
XMLPUBFUN xmlAttrPtr XMLCALL
- xmlHasProp (xmlNodePtr node,
+ xmlHasProp (const xmlNode *node,
const xmlChar *name);
XMLPUBFUN xmlAttrPtr XMLCALL
- xmlHasNsProp (xmlNodePtr node,
+ xmlHasNsProp (const xmlNode *node,
const xmlChar *name,
const xmlChar *nameSpace);
XMLPUBFUN xmlChar * XMLCALL
- xmlGetNsProp (xmlNodePtr node,
+ xmlGetNsProp (const xmlNode *node,
const xmlChar *name,
const xmlChar *nameSpace);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlStringGetNodeList (xmlDocPtr doc,
+ xmlStringGetNodeList (const xmlDoc *doc,
const xmlChar *value);
XMLPUBFUN xmlNodePtr XMLCALL
- xmlStringLenGetNodeList (xmlDocPtr doc,
+ xmlStringLenGetNodeList (const xmlDoc *doc,
const xmlChar *value,
int len);
XMLPUBFUN xmlChar * XMLCALL
xmlNodeListGetString (xmlDocPtr doc,
- xmlNodePtr list,
+ const xmlNode *list,
int inLine);
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN xmlChar * XMLCALL
- xmlNodeListGetRawString (xmlDocPtr doc,
- xmlNodePtr list,
+ xmlNodeListGetRawString (const xmlDoc *doc,
+ const xmlNode *list,
int inLine);
#endif /* LIBXML_TREE_ENABLED */
XMLPUBFUN void XMLCALL
const xmlChar *content,
int len);
XMLPUBFUN xmlChar * XMLCALL
- xmlNodeGetContent (xmlNodePtr cur);
+ xmlNodeGetContent (const xmlNode *cur);
XMLPUBFUN int XMLCALL
xmlNodeBufGetContent (xmlBufferPtr buffer,
- xmlNodePtr cur);
+ const xmlNode *cur);
XMLPUBFUN int XMLCALL
xmlBufGetNodeContent (xmlBufPtr buf,
- xmlNodePtr cur);
+ const xmlNode *cur);
XMLPUBFUN xmlChar * XMLCALL
- xmlNodeGetLang (xmlNodePtr cur);
+ xmlNodeGetLang (const xmlNode *cur);
XMLPUBFUN int XMLCALL
- xmlNodeGetSpacePreserve (xmlNodePtr cur);
+ xmlNodeGetSpacePreserve (const xmlNode *cur);
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN void XMLCALL
xmlNodeSetLang (xmlNodePtr cur,
int val);
#endif /* LIBXML_TREE_ENABLED */
XMLPUBFUN xmlChar * XMLCALL
- xmlNodeGetBase (xmlDocPtr doc,
- xmlNodePtr cur);
+ xmlNodeGetBase (const xmlDoc *doc,
+ const xmlNode *cur);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
XMLPUBFUN void XMLCALL
xmlNodeSetBase (xmlNodePtr cur,
* Compression.
*/
XMLPUBFUN int XMLCALL
- xmlGetDocCompressMode (xmlDocPtr doc);
+ xmlGetDocCompressMode (const xmlDoc *doc);
XMLPUBFUN void XMLCALL
xmlSetDocCompressMode (xmlDocPtr doc,
int mode);
xmlParserInputBufferPtr
__xmlParserInputBufferCreateFilename(const char *URI,
- xmlCharEncoding enc);
+ xmlCharEncoding enc);
#ifdef LIBXML_OUTPUT_ENABLED
/*
char *str2; /* extra string information */
char *str3; /* extra string information */
int int1; /* extra number information */
- int int2; /* column number of the error or 0 if N/A (todo: rename this field when we would break ABI) */
+ int int2; /* error column # or 0 if N/A (todo: rename field when we would brk ABI) */
void *ctxt; /* the parser context if available */
void *node; /* the node in the tree */
};
*
* the version string like "1.2.3"
*/
-#define LIBXML_DOTTED_VERSION "2.9.1"
+#define LIBXML_DOTTED_VERSION "2.9.2"
/**
* LIBXML_VERSION:
*
* the version number: 1.2.3 value is 10203
*/
-#define LIBXML_VERSION 20901
+#define LIBXML_VERSION 20902
/**
* LIBXML_VERSION_STRING:
*
* the version number string, 1.2.3 value is "10203"
*/
-#define LIBXML_VERSION_STRING "20901"
+#define LIBXML_VERSION_STRING "20902"
/**
* LIBXML_VERSION_EXTRA:
* Macro to check that the libxml version in use is compatible with
* the version the software has been compiled against
*/
-#define LIBXML_TEST_VERSION xmlCheckVersion(20901);
+#define LIBXML_TEST_VERSION xmlCheckVersion(20902);
#ifndef VMS
#if 0
list.c and the trio files, which are covered by a similar licence but
with different Copyright notices) all the files are:
- Copyright (C) 1998-2003 Daniel Veillard. All Rights Reserved.
+ Copyright (C) 1998-2012 Daniel Veillard. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
-NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of Daniel Veillard shall not
-be used in advertising or otherwise to promote the sale, use or other deal-
-ings in this Software without prior written authorization from him.
-
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
Tue Dec 9 23:50:23 CET 2003 Daniel Veillard <daniel@veillard.com>
- * entities.c: fixed an XML entites content serialization
+ * entities.c: fixed an XML entities content serialization
potentially triggered by XInclude, see #126817
Tue Dec 9 16:12:50 CET 2003 Daniel Veillard <daniel@veillard.com>
"onfocus",
"onblur",
"onsubmit",
- "onrest",
+ "onreset",
"onchange",
"onselect"
};
int i;
int discardtag = 0;
- if (ctxt->instate == XML_PARSER_EOF)
- return(-1);
if ((ctxt == NULL) || (ctxt->input == NULL)) {
htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR,
"htmlParseStartTag: context error\n", NULL, NULL);
return -1;
}
+ if (ctxt->instate == XML_PARSER_EOF)
+ return(-1);
if (CUR != '<') return -1;
NEXT;
htmlParseElementInternal(htmlParserCtxtPtr ctxt) {
const xmlChar *name;
const htmlElemDesc * info;
- htmlParserNodeInfo node_info;
+ htmlParserNodeInfo node_info = { 0, };
int failed;
if ((ctxt == NULL) || (ctxt->input == NULL)) {
ctxt->sax->endDocument(ctxt->userData);
}
}
- if ((ctxt->myDoc != NULL) &&
+ if ((!(ctxt->options & HTML_PARSE_NODEFDTD)) && (ctxt->myDoc != NULL) &&
((terminate) || (ctxt->instate == XML_PARSER_EOF) ||
(ctxt->instate == XML_PARSER_EPILOG))) {
xmlDtdPtr dtd;
/* set encoding */
if (encoding) {
- content = xmlMallocAtomic (xmlStrlen(content_line) + strlen(encoding) + 1);
- if (content) {
- strcpy ((char *)content, (char *)content_line);
- strcat ((char *)content, (char *)encoding);
- htmlCheckEncoding (ctxt, content);
- xmlFree (content);
+ size_t l = strlen(encoding);
+
+ if (l < 1000) {
+ content = xmlMallocAtomic (xmlStrlen(content_line) + l + 1);
+ if (content) {
+ strcpy ((char *)content, (char *)content_line);
+ strcat ((char *)content, (char *)encoding);
+ htmlCheckEncoding (ctxt, content);
+ xmlFree (content);
+ }
}
}
if (fd < 0)
return (NULL);
+ xmlInitParser();
xmlInitParser();
input = xmlParserInputBufferCreateFd(fd, XML_CHAR_ENCODING_NONE);
return (NULL);
if (ctxt == NULL)
return (NULL);
+ xmlInitParser();
htmlCtxtReset(ctxt);
return (NULL);
if (ctxt == NULL)
return (NULL);
+ xmlInitParser();
htmlCtxtReset(ctxt);
return (NULL);
if (buffer == NULL)
return (NULL);
+ xmlInitParser();
htmlCtxtReset(ctxt);
return (NULL);
if (ctxt == NULL)
return (NULL);
+ xmlInitParser();
htmlCtxtReset(ctxt);
return (NULL);
if (ctxt == NULL)
return (NULL);
+ xmlInitParser();
htmlCtxtReset(ctxt);
(!xmlStrcasecmp(cur->name, BAD_CAST "src")) ||
((!xmlStrcasecmp(cur->name, BAD_CAST "name")) &&
(!xmlStrcasecmp(cur->parent->name, BAD_CAST "a"))))) {
- xmlChar *escaped;
xmlChar *tmp = value;
+ /* xmlURIEscapeStr() escapes '"' so it can be safely used. */
+ xmlBufCCat(buf->buffer, "\"");
while (IS_BLANK_CH(*tmp)) tmp++;
- /*
- * the < and > have already been escaped at the entity level
- * And doing so here breaks server side includes
- */
- escaped = xmlURIEscapeStr(tmp, BAD_CAST"@/:=?;#%&,+<>");
- if (escaped != NULL) {
- xmlBufWriteQuotedString(buf->buffer, escaped);
- xmlFree(escaped);
- } else {
- xmlBufWriteQuotedString(buf->buffer, value);
+ /* URI Escape everything, except server side includes. */
+ for ( ; ; ) {
+ xmlChar *escaped;
+ xmlChar endChar;
+ xmlChar *end = NULL;
+ xmlChar *start = (xmlChar *)xmlStrstr(tmp, BAD_CAST "<!--");
+ if (start != NULL) {
+ end = (xmlChar *)xmlStrstr(tmp, BAD_CAST "-->");
+ if (end != NULL) {
+ *start = '\0';
+ }
+ }
+
+ /* Escape the whole string, or until start (set to '\0'). */
+ escaped = xmlURIEscapeStr(tmp, BAD_CAST"@/:=?;#%&,+");
+ if (escaped != NULL) {
+ xmlBufCat(buf->buffer, escaped);
+ xmlFree(escaped);
+ } else {
+ xmlBufCat(buf->buffer, tmp);
+ }
+
+ if (end == NULL) { /* Everything has been written. */
+ break;
+ }
+
+ /* Do not escape anything within server side includes. */
+ *start = '<'; /* Restore the first character of "<!--". */
+ end += 3; /* strlen("-->") */
+ endChar = *end;
+ *end = '\0';
+ xmlBufCat(buf->buffer, start);
+ *end = endChar;
+ tmp = end;
}
+
+ xmlBufCCat(buf->buffer, "\"");
} else {
xmlBufWriteQuotedString(buf->buffer, value);
}
Note that this is automatically generated from the news webpage at:
http://xmlsoft.org/news.html
-Items not finished and worked on, get in touch with the list if you want
-to help those - More testing on RelaxNG
- - Finishing up XML
- Schemas
-
The change log at
ChangeLog.html
describes the recents commits
-to the SVN at
-http://svn.gnome.org/viewvc/libxml2/trunk/
+to the GIT at
+http://git.gnome.org/browse/libxml2/
code base.Here is the list of public releases:
+2.9.2: Oct 16 2014:
+ - Security:
+ Fix for CVE-2014-3660 billion laugh variant (Daniel Veillard),
+ CVE-2014-0191 Do not fetch external parameter entities (Daniel Veillard)
+
+ - Bug Fixes:
+ fix memory leak xml header encoding field with XML_PARSE_IGNORE_ENC (Bart De Schuymer),
+ xmlmemory: handle realloc properly (Yegor Yefremov),
+ Python generator bug raised by the const change (Daniel Veillard),
+ Windows Critical sections not released correctly (Daniel Veillard),
+ Parser error on repeated recursive entity expansion containing < (Daniel Veillard),
+ xpointer : fixing Null Pointers (Gaurav Gupta),
+ Remove Unnecessary Null check in xpointer.c (Gaurav Gupta),
+ parser bug on misformed namespace attributes (Dennis Filder),
+ Pointer dereferenced before null check (Daniel Veillard),
+ Leak of struct addrinfo in xmlNanoFTPConnect() (Gaurav Gupta),
+ Possible overflow in HTMLParser.c (Daniel Veillard),
+ python/tests/sync.py assumes Python dictionaries are ordered (John Beck),
+ Fix Enum check and missing break (Gaurav Gupta),
+ xmlIO: Handle error returns from dup() (Philip Withnall),
+ Fix a problem properly saving URIs (Daniel Veillard),
+ wrong error column in structured error when parsing attribute values (Juergen Keil),
+ wrong error column in structured error when skipping whitespace in xml decl (Juergen Keil),
+ no error column in structured error handler for xml schema validation errors (Juergen Keil),
+ Couple of Missing Null checks (Gaurav Gupta),
+ Add couple of missing Null checks (Daniel Veillard),
+ xmlschemastypes: Fix potential array overflow (Philip Withnall),
+ runtest: Fix a memory leak on parse failure (Philip Withnall),
+ xmlIO: Fix an FD leak on gzdopen() failure (Philip Withnall),
+ xmlcatalog: Fix a memory leak on quit (Philip Withnall),
+ HTMLparser: Correctly initialise a stack allocated structure (Philip Withnall),
+ Check for tmon in _xmlSchemaDateAdd() is incorrect (David Kilzer),
+ Avoid Possible Null Pointer in trio.c (Gaurav Gupta),
+ Fix processing in SAX2 in case of an allocation failure (Daniel Veillard),
+ XML Shell command "cd" does not handle "/" at end of path (Daniel Veillard),
+ Fix various Missing Null checks (Gaurav Gupta),
+ Fix a potential NULL dereference (Daniel Veillard),
+ Add a couple of misisng check in xmlRelaxNGCleanupTree (Gaurav Gupta),
+ Add a missing argument check (Gaurav Gupta),
+ Adding a check in case of allocation error (Gaurav Gupta),
+ xmlSaveUri() incorrectly recomposes URIs with rootless paths (Dennis Filder),
+ Adding some missing NULL checks (Gaurav),
+ Fixes for xmlInitParserCtxt (Daniel Veillard),
+ Fix regressions introduced by CVE-2014-0191 patch (Daniel Veillard),
+ erroneously ignores a validation error if no error callback set (Daniel Veillard),
+ xmllint was not parsing the --c14n11 flag (Sérgio Batista),
+ Avoid Possible null pointer dereference in memory debug mode (Gaurav),
+ Avoid Double Null Check (Gaurav),
+ Restore context size and position after XPATH_OP_ARG (Nick Wellnhofer),
+ Fix xmlParseInNodeContext() if node is not element (Daniel Veillard),
+ Avoid a possible NULL pointer dereference (Gaurav),
+ Fix xmlTextWriterWriteElement when a null content is given (Daniel Veillard),
+ Fix an typo 'onrest' in htmlScriptAttributes (Daniel Veillard),
+ fixing a ptotential uninitialized access (Daniel Veillard),
+ Fix an fd leak in an error case (Daniel Veillard),
+ Missing initialization for the catalog module (Daniel Veillard),
+ Handling of XPath function arguments in error case (Nick Wellnhofer),
+ Fix a couple of missing NULL checks (Gaurav),
+ Avoid a possibility of dangling encoding handler (Gaurav),
+ Fix HTML push parser to accept HTML_PARSE_NODEFDTD (Arnold Hendriks),
+ Fix a bug loading some compressed files (Mike Alexander),
+ Fix XPath node comparison bug (Gaurav),
+ Type mismatch in xmlschemas.c (Gaurav),
+ Type mismatch in xmlschemastypes.c (Gaurav),
+ Avoid a deadcode in catalog.c (Daniel Veillard),
+ run close socket on Solaris, same as we do on other platforms (Denis Pauk),
+ Fix pointer dereferenced before null check (Gaurav),
+ Fix a potential NULL dereference in tree code (Daniel Veillard),
+ Fix potential NULL pointer dereferences in regexp code (Gaurav),
+ xmllint --pretty crashed without following numeric argument (Tim Galeckas),
+ Fix XPath expressions of the form '@ns:*' (Nick Wellnhofer),
+ Fix XPath '//' optimization with predicates (Nick Wellnhofer),
+ Clear up a potential NULL dereference (Daniel Veillard),
+ Fix a possible NULL dereference (Gaurav),
+ Avoid crash if allocation fails (Daniel Veillard),
+ Remove occasional leading space in XPath number formatting (Daniel Veillard),
+ Fix handling of mmap errors (Daniel Veillard),
+ Catch malloc error and exit accordingly (Daniel Veillard),
+ missing else in xlink.c (Ami Fischman),
+ Fix a parsing bug on non-ascii element and CR/LF usage (Daniel Veillard),
+ Fix a regression in xmlGetDocCompressMode() (Daniel Veillard),
+ properly quote the namespace uris written out during c14n (Aleksey Sanin),
+ Remove premature XInclude check on URI being relative (Alexey Neyman),
+ Fix missing break on last() function for attributes (dcb),
+ Do not URI escape in server side includes (Romain Bondue),
+ Fix an error in xmlCleanupParser (Alexander Pastukhov)
+
+ - Documentation:
+ typo in error messages "colon are forbidden from..." (Daniel Veillard),
+ Fix a link to James SAX documentation old page (Daniel Veillard),
+ Fix typos in relaxng.c (Jan Pokorný),
+ Fix a doc typo (Daniel Veillard),
+ Fix typos in {tree,xpath}.c (errror) (Jan Pokorný),
+ Add limitations about encoding conversion (Daniel Veillard),
+ Fix typos in xmlschemas{,types}.c (Jan Pokorný),
+ Fix incorrect spelling entites->entities (Jan Pokorný),
+ Forgot to document 2.9.1 release, regenerate docs (Daniel Veillard)
+
+ - Portability:
+ AC_CONFIG_FILES and executable bit (Roumen Petrov),
+ remove HAVE_CONFIG_H dependency in testlimits.c (Roumen Petrov),
+ fix some tabs mixing incompatible with python3 (Roumen Petrov),
+ Visual Studio 14 CTP defines snprintf() (Francis Dupont),
+ OS400: do not try to copy unexisting doc files (Patrick Monnerat),
+ OS400: use either configure.ac or configure.in. (Patrick Monnerat),
+ os400: make-src.sh: create physical file with target CCSID (Patrick Monnerat),
+ OS400: Add some more C macros equivalent procedures. (Patrick Monnerat),
+ OS400: use C macros to implement equivalent RPG support procedures. (Patrick Monnerat),
+ OS400: implement XPath macros as procedures for ILE/RPG support. (Patrick Monnerat),
+ OS400: include in distribution tarball. (Patrick Monnerat),
+ OS400: Add README: compilation directives and OS/400 specific stuff. (Patrick Monnerat),
+ OS400: Add compilation scripts. (Patrick Monnerat),
+ OS400: ILE RPG language header files. (Patrick Monnerat),
+ OS400: implement some macros as functions for ILE/RPG language support (that as no macros). (Patrick Monnerat),
+ OS400: UTF8<-->EBCDIC wrappers for system and external library calls (Patrick Monnerat),
+ OS400: Easy character transcoding support (Patrick Monnerat),
+ OS400: iconv functions compatibility wrappers and table builder. (Patrick Monnerat),
+ OS400: create architecture directory. Implement dlfcn emulation. (Patrick Monnerat),
+ Fix building when configuring without xpath and xptr (Daniel Veillard),
+ configure: Add --with-python-install-dir (Jonas Eriksson),
+ Fix compilation with minimum and xinclude. (Nicolas Le Cam),
+ Compile out use of xmlValidateNCName() when not available. (Nicolas Le Cam),
+ Fix compilation with minimum and schematron. (Nicolas Le Cam),
+ Legacy needs xmlSAX2StartElement() and xmlSAX2EndElement(). (Nicolas Le Cam),
+ Don't use xmlValidateName() when not available. (Nicolas Le Cam),
+ Fix a portability issue on Windows (Longstreth Jon),
+ Various portability patches for OpenVMS (Jacob (Jouk) Jansen),
+ Use specific macros for portability to OS/400 (Patrick Monnerat),
+ Add macros needed for OS/400 portability (Patrick Monnerat),
+ Portability patch for fopen on OS/400 (Patrick Monnerat),
+ Portability fixes for OS/400 (Patrick Monnerat),
+ Improve va_list portability (Patrick Monnerat),
+ Portability fix (Patrick Monnerat),
+ Portability fix (Patrick Monnerat),
+ Generic portability fix (Patrick Monnerat),
+ Shortening lines in headers (Patrick Monnerat),
+ build: Use pkg-config to find liblzma in preference to AC_CHECK_LIB (Philip Withnall),
+ build: Add @LZMA_LIBS@ to libxml’s pkg-config files (Philip Withnall),
+ fix some tabs mixing incompatible with python3 (Daniel Veillard),
+ add additional defines checks for support "./configure --with-minimum" (Denis Pauk),
+ Another round of fixes for older versions of Python (Arfrever Frehtes Taifersar Arahesis),
+ python: fix drv_libxml2.py for python3 compatibility (Alexandre Rostovtsev),
+ python: Fix compiler warnings when building python3 bindings (Armin K),
+ Fix for compilation with python 2.6.8 (Petr Sumbera)
+
+ - Improvements:
+ win32/libxml2.def.src after rebuild in doc (Roumen Petrov),
+ elfgcchack.h: more legacy needs xmlSAX2StartElement() and xmlSAX2EndElement() (Roumen Petrov),
+ elfgcchack.h: add xmlXPathNodeEval and xmlXPathSetContextNode (Roumen Petrov),
+ Provide cmake module (Samuel Martin),
+ Fix a couple of issues raised by make dist (Daniel Veillard),
+ Fix and add const qualifiers (Kurt Roeckx),
+ Preparing for upcoming release of 2.9.2 (Daniel Veillard),
+ Fix zlib and lzma libraries check via command line (Dmitriy),
+ wrong error column in structured error when parsing end tag (Juergen Keil),
+ doc/news.html: small update to avoid line join while generating NEWS. (Patrick Monnerat),
+ Add methods for python3 iterator (Ron Angeles),
+ Support element node traversal in document fragments. (Kyle VanderBeek),
+ xmlNodeSetName: Allow setting the name to a substring of the currently set name (Tristan Van Berkom),
+ Added macros for argument casts (Eric Zurcher),
+ adding init calls to xml and html Read parsing entry points (Daniel Veillard),
+ Get rid of 'REPLACEMENT CHARACTER' Unicode chars in xmlschemas.c (Jan Pokorný),
+ Implement choice for name classes on attributes (Shaun McCance),
+ Two small namespace tweaks (Daniel Veillard),
+ xmllint --memory should fail on empty files (Daniel Veillard),
+ Cast encoding name to char pointer to match arg type (Nikolay Sivov)
+
+ - Cleanups:
+ Removal of old configure.in (Daniel Veillard),
+ Unreachable code in tree.c (Gaurav Gupta),
+ Remove a couple of dead conditions (Gaurav Gupta),
+ Avoid some dead code and cleanup in relaxng.c (Gaurav),
+ Drop not needed checks (Denis Pauk),
+ Fix a wrong test (Daniel Veillard)
+
+
+
+2.9.1: Apr 19 2013:
+ - Features:
+ Support for Python3 (Daniel Veillard),
+ Add xmlXPathSetContextNode and xmlXPathNodeEval (Alex Bligh)
+
+ - Documentation:
+ Add documentation for xmllint --xpath (Daniel Veillard),
+ Fix the URL of the SAX documentation from James (Daniel Veillard),
+ Fix spelling of "length". (Michael Wood)
+
+ - Portability:
+ Fix python bindings with versions older than 2.7 (Daniel Veillard),
+ rebuild docs:Makefile.am (Roumen Petrov),
+ elfgcchack.h after rebuild in doc (Roumen Petrov),
+ elfgcchack for buf module (Roumen Petrov),
+ Fix a uneeded and wrong extra link parameter (Daniel Veillard),
+ Few cleanup patches for Windows (Denis Pauk),
+ Fix rpmbuild --nocheck (Mark Salter),
+ Fix for win32/configure.js and WITH_THREAD_ALLOC (Daniel Richard),
+ Fix Broken multi-arch support in xml2-config (Daniel Veillard),
+ Fix a portability issue for GCC < 3.4.0 (Daniel Veillard),
+ Windows build fixes (Daniel Richard),
+ Fix a thread portability problem (Friedrich Haubensak),
+ Downgrade autoconf requirement to 2.63 (Daniel Veillard)
+
+ - Bug Fixes:
+ Fix a linking error for python bindings (Daniel Veillard),
+ Fix a couple of return without value (Jüri Aedla),
+ Improve the hashing functions (Daniel Franke),
+ Improve handling of xmlStopParser() (Daniel Veillard),
+ Remove risk of lockup in dictionary initialization (Daniel Veillard),
+ Activate detection of encoding in external subset (Daniel Veillard),
+ Fix an output buffer flushing conversion bug (Mikhail Titov),
+ Fix an old bug in xmlSchemaValidateOneElement (Csaba László),
+ Fix configure cannot remove messages (Gilles Espinasse),
+ fix schema validation in combination with xsi:nil (Daniel Veillard),
+ xmlCtxtReadFile doesn't work with literal IPv6 URLs (Steve Wolf),
+ Fix a few problems with setEntityLoader (Alexey Neyman),
+ Detect excessive entities expansion upon replacement (Daniel Veillard),
+ Fix the flushing out of raw buffers on encoding conversions (Daniel,
+Veillard),
+ Fix some buffer conversion issues (Daniel Veillard),
+ When calling xmlNodeDump make sure we grow the buffer quickly (Daniel,
+Veillard),
+ Fix an error in the progressive DTD parsing code (Dan Winship),
+ xmllint should not load DTD by default when using the reader (Daniel,
+Veillard),
+ Try IBM-037 when looking for EBCDIC handlers (Petr Sumbera),
+ Fix potential out of bound access (Daniel Veillard),
+ Fix large parse of file from memory (Daniel Veillard),
+ Fix a bug in the nsclean option of the parser (Daniel Veillard),
+ Fix a regression in 2.9.0 breaking validation while streaming (Daniel,
+Veillard),
+ Remove potential calls to exit() (Daniel Veillard)
+
+ - Improvements:
+ Regenerated API, and testapi, rebuild documentation (Daniel Veillard),
+ Fix tree iterators broken by 2to3 script (Daniel Veillard),
+ update all tests for Python3 and Python2 (Daniel Veillard),
+ A few more fixes for python 3 affecting libxml2.py (Daniel Veillard),
+ Fix compilation on Python3 (Daniel Veillard),
+ Converting apibuild.py to python3 (Daniel Veillard),
+ First pass at starting porting to python3 (Daniel Veillard),
+ updated configure.in for python3 (Daniel Veillard),
+ Add support for xpathRegisterVariable in Python (Shaun McCance),
+ Added a regression tests from bug 694228 data (Daniel Veillard),
+ Cache presence of '<' in entities content (Daniel Veillard),
+ Avoid extra processing on entities (Daniel Veillard),
+ Python binding for xmlRegisterInputCallback (Alexey Neyman),
+ Python bindings: DOM casts everything to xmlNode (Alexey Neyman),
+ Define LIBXML_THREAD_ALLOC_ENABLED via xmlversion.h (Tim Starling),
+ Adding streaming validation to runtest checks (Daniel Veillard),
+ Add a --pushsmall option to xmllint (Daniel Veillard)
+
+ - Cleanups:
+ Switched comment in file to UTF-8 encoding (Daniel Veillard),
+ Extend gitignore (Daniel Veillard),
+ Silent the new python test on input (Alexey Neyman),
+ Cleanup of a duplicate test (Daniel Veillard),
+ Cleanup on duplicate test expressions (Daniel Veillard),
+ Fix compiler warning after 153cf15905cf4ec080612ada6703757d10caba1e (Patrick,
+Gansterer),
+ Spec cleanups and a fix for multiarch support (Daniel Veillard),
+ Silence a clang warning (Daniel Veillard),
+ Cleanup the Copyright to be pure MIT Licence wording (Daniel Veillard),
+ rand_seed should be static in dict.c (Wouter Van Rooy),
+ Fix typos in parser comments (Jan Pokorný)
+
+
+
+2.9.0: Sep 11 2012:
+ - Features:
+ A few new API entry points,
+ More resilient push parser mode,
+ A lot of portability improvement,
+ Faster XPath evaluation
+
+ - Documentation:
+ xml2-config.1 markup error (Christian Weisgerber),
+ libxml(3) manpage typo fix (John Bradshaw),
+ More cleanups to the documentation part of libxml2 (Daniel Richard G)
+
+ - Portability:
+ Bug 676544 - fails to build with --without-sax1 (Akira TAGOH),
+ fix builds not having stdint.h (Rob Richards),
+ GetProcAddressA is available only on WinCE (Daniel Veillard),
+ More updates and cleanups on autotools and Makefiles (Daniel Richard G),
+ More changes for Win32 compilation (Eric Zurcher),
+ Basic changes for Win32 builds of release 2.9.0: compile buf.c (Eric Zurcher),
+ Bundles all generated files for python into the distribution (Daniel Richard G),
+ Fix compiler warnings of wincecompat.c (Patrick Gansterer),
+ Fix non __GNUC__ build (Patrick Gansterer),
+ Fix windows unicode build (Patrick Gansterer),
+ clean redefinition of {v}snprintf in C-source (Roumen Petrov),
+ use xmlBuf... if DEBUG_INPUT is defined (Roumen Petrov),
+ fix runtests to use pthreads support for various Unix platforms (Daniel Richard G),
+ Various "make distcheck" and portability fixups 2nd part (Daniel Richard G),
+ Various "make distcheck" and portability fixups (Daniel Richard G),
+ Fix compilation on older Visual Studio (Daniel Veillard)
+
+ - Bug Fixes:
+ Change the XPath code to percolate allocation errors (Daniel Veillard),
+ Fix reuse of xmlInitParser (Daniel Veillard),
+ Fix potential crash on entities errors (Daniel Veillard),
+ initialize var (Rob Richards),
+ Fix the XPath arity check to also check the XPath stack limits (Daniel Veillard),
+ Fix problem with specific and generic error handlers (Pietro Cerutti),
+ Avoid a potential infinite recursion (Daniel Veillard),
+ Fix an XSD error when generating internal automata (Daniel Veillard),
+ Patch for xinclude of text using multibyte characters (Vitaly Ostanin),
+ Fix a segfault on XSD validation on pattern error (Daniel Veillard),
+ Fix missing xmlsave.h module which was ignored in recent builds (Daniel Veillard),
+ Add a missing element check (Daniel Veillard),
+ Adding various checks on node type though the API (Daniel Veillard),
+ Namespace nodes can't be unlinked with xmlUnlinkNode (Daniel Veillard),
+ Fix make dist to include new private header files (Daniel Veillard),
+ More fixups on the push parser behaviour (Daniel Veillard),
+ Strengthen behaviour of the push parser in problematic situations (Daniel Veillard),
+ Enforce XML_PARSER_EOF state handling through the parser (Daniel Veillard),
+ Fixup limits parser (Daniel Veillard),
+ Do not fetch external parsed entities (Daniel Veillard),
+ Fix an error in previous commit (Aron Xu),
+ Fix entities local buffers size problems (Daniel Veillard),
+ Fix parser local buffers size problems (Daniel Veillard),
+ Fix a failure to report xmlreader parsing failures (Daniel Veillard)
+
+ - Improvements:
+ Keep libxml2.syms when running "make distclean" (Daniel Veillard),
+ Allow to set the quoting character of an xmlWriter (Csaba Raduly),
+ Keep non-significant blanks node in HTML parser (Daniel Veillard),
+ Add a forbidden variable error number and message to XPath (Daniel Veillard),
+ Support long path names on WNT (Michael Stahl),
+ Improve HTML escaping of attribute on output (Daniel Veillard),
+ Handle ICU_LIBS as LIBADD, not LDFLAGS to prevent linking errors (Arfrever Frehtes Taifersar Arahesis),
+ Switching XPath node sorting to Timsort (Vojtech Fried),
+ Optimizing '//' in XPath expressions (Nick Wellnhofer),
+ Expose xmlBufShrink in the public tree API (Daniel Veillard),
+ Visible HTML elements close the head tag (Conrad Irwin),
+ Fix file and line report for XSD SAX and reader streaming validation (Daniel Veillard),
+ Fix const qualifyer to definition of xmlBufferDetach (Daniel Veillard),
+ minimize use of HAVE_CONFIG_H (Roumen Petrov),
+ fixup regression in Various "make distcheck" and portability fixups (Roumen Petrov),
+ Add support for big line numbers in error reporting (Daniel Veillard),
+ Avoid using xmlBuffer for serialization (Daniel Veillard),
+ Improve compatibility between xmlBuf and xmlBuffer (Daniel Veillard),
+ Provide new accessors for xmlOutputBuffer (Daniel Veillard),
+ Improvements for old buffer compatibility (Daniel Veillard),
+ Expand the limit test program (Daniel Veillard),
+ Improve error reporting on parser errors (Daniel Veillard),
+ Implement some default limits in the XPath module (Daniel Veillard),
+ Introduce some default parser limits (Daniel Veillard),
+ Cleanups and new limit APIs for dictionaries (Daniel Veillard),
+ Fixup for buf.c (Daniel Veillard),
+ Cleanup URI module memory allocation code (Daniel Veillard),
+ Extend testlimits (Daniel Veillard),
+ More avoid quadratic behaviour (Daniel Veillard),
+ Impose a reasonable limit on PI size (Daniel Veillard),
+ first version of testlimits new test (Daniel Veillard),
+ Avoid quadratic behaviour in some push parsing cases (Daniel Veillard),
+ Impose a reasonable limit on comment size (Daniel Veillard),
+ Impose a reasonable limit on attribute size (Daniel Veillard),
+ Harden the buffer code and make it more compatible (Daniel Veillard),
+ More cleanups for input/buffers code (Daniel Veillard),
+ Cleanup function xmlBufResetInput(), to set input from Buffer (Daniel Veillard)
+ Swicth the test program for characters to new input buffers (Daniel Veillard),
+ Convert the HTML tree module to the new buffers (Daniel Veillard),
+ Convert of the HTML parser to new input buffers (Daniel Veillard),
+ Convert the writer to new output buffer and save APIs (Daniel Veillard),
+ Convert XMLReader to the new input buffers (Daniel Veillard),
+ New saving functions using xmlBuf and conversion (Daniel Veillard),
+ Provide new xmlBuf based saving functions (Daniel Veillard),
+ Convert XInclude to the new input buffers (Daniel Veillard),
+ Convert catalog code to the new input buffers (Daniel Veillard),
+ Convert C14N to the new Input buffer (Daniel Veillard),
+ Convert xmlIO.c to the new input and output buffers (Daniel Veillard),
+ Convert XML parser to the new input buffers (Daniel Veillard),
+ Incompatible change to the Input and Output buffers (Daniel Veillard),
+ Adding new encoding function to deal with the new structures (Daniel Veillard),
+ Convert XPath to xmlBuf (Daniel Veillard),
+ Adding a new buf module for buffers (Daniel Veillard),
+ Memory error within SAX2 reuse common framework (Daniel Veillard),
+ Fix xmllint --xpath node initialization (Daniel Veillard)
+
+ - Cleanups:
+ Various cleanups to avoid compiler warnings (Daniel Veillard),
+ Big space and tab cleanup (Daniel Veillard),
+ Followup to LibXML2 docs/examples cleanup patch (Daniel Veillard),
+ Second round of cleanups for LibXML2 docs/examples (Daniel Richard),
+ Remove all .cvsignore as they are not used anymore (Daniel Veillard),
+ Fix a Timsort function helper comment (Daniel Veillard),
+ Small cleanup for valgrind target (Daniel Veillard),
+ Patch for portability of latin characters in C files (Daniel Veillard),
+ Cleanup some of the parser code (Daniel Veillard),
+ Fix a variable name in comment (Daniel Veillard),
+ Regenerated testapi.c (Daniel Veillard),
+ Regenerating docs and API files (Daniel Veillard),
+ Small cleanup of unused variables in test (Daniel Veillard),
+ Expand .gitignore with more files (Daniel Veillard)
+
+
+
+2.8.0: May 23 2012:
+ - Features:
+ add lzma compression support (Anders F Bjorklund)
+
+ - Documentation:
+ xmlcatalog: Add uri and delegateURI to possible add types in man page. (Ville Skyttä),
+ Update README.tests (Daniel Veillard),
+ URI handling code is not OOM resilient (Daniel Veillard),
+ Fix an error in comment (Daniel Veillard),
+ Fixed bug #617016 (Daniel Mustieles),
+ Fixed two typos in the README document (Daniel Neel),
+ add generated html files (Anders F Bjorklund),
+ Clarify the need to use xmlFreeNode after xmlUnlinkNode (Daniel Veillard),
+ Improve documentation a bit (Daniel Veillard),
+ Updated URL for lxml python bindings (Daniel Veillard)
+
+ - Portability:
+ Restore code for Windows compilation (Daniel Veillard),
+ Remove git error message during configure (Christian Dywan),
+ xmllint: Build fix for endTimer if !defined(HAVE_GETTIMEOFDAY) (Patrick R. Gansterer),
+ remove a bashism in confgure.in (John Hein),
+ undef ERROR if already defined (Patrick R. Gansterer),
+ Fix library problems with mingw-w64 (Michael Cronenworth),
+ fix windows build. ifdef addition from bug 666491 makes no sense (Rob Richards),
+ prefer native threads on win32 (Sam Thursfield),
+ Allow to compile with Visual Studio 2010 (Thomas Lemm),
+ Fix mingw's snprintf configure check (Andoni Morales),
+ fixed a 64bit big endian issue (Marcus Meissner),
+ Fix portability failure if netdb.h lacks NO_ADDRESS (Daniel Veillard),
+ Fix windows build from lzma addition (Rob Richards),
+ autogen: Only check for libtoolize (Colin Walters),
+ Fix the Windows build files (Patrick von Reth),
+ 634846 Remove a linking option breaking Windows VC10 (Daniel Veillard),
+ 599241 fix an initialization problem on Win64 (Andrew W. Nosenko),
+ fix win build (Rob Richards)
+
+ - Bug fixes:
+ Part for rand_r checking missing (Daniel Veillard),
+ Cleanup on randomization (Daniel Veillard),
+ Fix undefined reference in python module (Pacho Ramos),
+ Fix a race in xmlNewInputStream (Daniel Veillard),
+ Fix weird streaming RelaxNG errors (Noam),
+ Fix various bugs in new code raised by the API checking (Daniel Veillard),
+ Fix various problems with "make dist" (Daniel Veillard),
+ Fix a memory leak in the xzlib code (Daniel Veillard),
+ HTML parser error with <noscript> in the <head> (Denis Pauk),
+ XSD: optional element in complex type extension (Remi Gacogne),
+ Fix html serialization error and htmlSetMetaEncoding() (Daniel Veillard),
+ Fix a wrong return value in previous patch (Daniel Veillard),
+ Fix an uninitialized variable use (Daniel Veillard),
+ Fix a compilation problem with --minimum (Brandon Slack),
+ Remove redundant and ungarded include of resolv.h (Daniel Veillard),
+ xinclude with parse="text" does not use the entity loader (Shaun McCance),
+ Allow to parse 1 byte HTML files (Denis Pauk),
+ Patch that fixes the skipping of the HTML_PARSE_NOIMPLIED flag (Martin Schröder),
+ Avoid memory leak if xmlParserInputBufferCreateIO fails (Lin Yi-Li),
+ Prevent an infinite loop when dumping a node with encoding problems (Timothy Elliott),
+ xmlParseNodeInContext problems with an empty document (Tim Elliott),
+ HTML element position is not detected propperly (Pavel Andrejs),
+ Fix an off by one pointer access (Jüri Aedla),
+ Try to fix a problem with entities in SAX mode (Daniel Veillard),
+ Fix a crash with xmllint --path on empty results (Daniel Veillard),
+ Fixed bug #667946 (Daniel Mustieles),
+ Fix a logic error in Schemas Component Constraints (Ryan Sleevi),
+ Fix a wrong enum type use in Schemas Types (Nico Weber),
+ Fix SAX2 builder in case of undefined attributes namespace (Daniel Veillard),
+ Fix SAX2 builder in case of undefined element namespaces (Daniel Veillard),
+ fix reference to STDOUT_FILENO on MSVC (Tay Ray Chuan),
+ fix a pair of possible out of array char references (Daniel Veillard),
+ Fix an allocation error when copying entities (Daniel Veillard),
+ Make sure the parser returns when getting a Stop order (Chris Evans),
+ Fix some potential problems on reallocation failures(parser.c) (Xia Xinfeng),
+ Fix a schema type duration comparison overflow (Daniel Veillard),
+ Fix an unimplemented part in RNG value validation (Daniel Veillard),
+ Fix missing error status in XPath evaluation (Daniel Veillard),
+ Hardening of XPath evaluation (Daniel Veillard),
+ Fix an off by one error in encoding (Daniel Veillard),
+ Fix RELAX NG include bug #655288 (Shaun McCance),
+ Fix XSD validation bug #630130 (Toyoda Eizi),
+ Fix some potential problems on reallocation failures (Chris Evans),
+ __xmlRaiseError: fix use of the structured callback channel (Dmitry V. Levin),
+ __xmlRaiseError: fix the structured callback channel's data initialization (Dmitry V. Levin),
+ Fix memory corruption when xmlParseBalancedChunkMemoryInternal is called from xmlParseBalancedChunk (Rob Richards),
+ Small fix for previous commit (Daniel Veillard),
+ Fix a potential freeing error in XPath (Daniel Veillard),
+ Fix a potential memory access error (Daniel Veillard),
+ Reactivate the shared library versionning script (Daniel Veillard)
+
+ - Improvements:
+ use mingw C99 compatible functions {v}snprintf instead those from MSVC runtime (Roumen Petrov),
+ New symbols added for the next release (Daniel Veillard),
+ xmlTextReader bails too quickly on error (Andy Lutomirski),
+ Use a hybrid allocation scheme in xmlNodeSetContent (Conrad Irwin),
+ Use buffers when constructing string node lists. (Conrad Irwin),
+ Add HTML parser support for HTML5 meta charset encoding declaration (Denis Pauk),
+ wrong message for double hyphen in comment XML error (Bryan Henderson),
+ Fix "make tst" to grab lzma lib too (Daniel Veillard),
+ Add "whereis" command to xmllint shell (Ryan),
+ Improve xmllint shell (Ryan),
+ add function xmlTextReaderRelaxNGValidateCtxt() (Noam Postavsky),
+ Add --system support to autogen.sh (Daniel Veillard),
+ Add hash randomization to hash and dict structures (Daniel Veillard),
+ included xzlib in dist (Anders F Bjorklund),
+ move xz/lzma helpers to separate included files (Anders F Bjorklund),
+ add generated devhelp files (Anders F Bjorklund),
+ add XML_WITH_LZMA to api (Anders F Bjorklund),
+ autogen.sh: Honor NOCONFIGURE environment variable (Colin Walters),
+ Improve the error report on undefined REFs (Daniel Veillard),
+ Add exception for new W3C PI xml-model (Daniel Veillard),
+ Add options to ignore the internal encoding (Daniel Veillard),
+ testapi: use the right type for the check (Stefan Kost),
+ various: handle return values of write calls (Stefan Kost),
+ testWriter: xmlTextWriterWriteFormatElement wants an int instead of a long int (Stefan Kost),
+ runxmlconf: update to latest testsuite version (Stefan Kost),
+ configure: add -Wno-long-long to CFLAGS (Stefan Kost),
+ configure: support silent automake rules if possible (Stefan Kost),
+ xmlmemory: add a cast as size_t has no portable printf modifier (Stefan Kost),
+ __xmlRaiseError: remove redundant schannel initialization (Dmitry V. Levin),
+ __xmlRaiseError: do cheap code check early (Dmitry V. Levin)
+
+ - Cleanups:
+ Cleanups before 2.8.0-rc2 (Daniel Veillard),
+ Avoid an extra operation (Daniel Veillard),
+ Remove vestigial de-ANSI-fication support. (Javier Jardón),
+ autogen.sh: Fix typo (Javier Jardón),
+ Do not use unsigned but unsigned int (Daniel Veillard),
+ Remove two references to u_short (Daniel Veillard),
+ Fix -Wempty-body warning from clang (Nico Weber),
+ Cleanups of lzma support (Daniel Veillard),
+ Augment the list of ignored files (Daniel Veillard),
+ python: remove unused variable (Stefan Kost),
+ python: flag two unused args (Stefan Kost),
+ configure: acconfig.h is deprecated since autoconf-2.50 (Stefan Kost),
+ xpath: remove unused variable (Stefan Kost)
+
+
+
+2.7.8: Nov 4 2010:
+ - Features:
+ 480323 add code to plug in ICU converters by default (Giuseppe Iuculano),
+ Add xmlSaveOption XML_SAVE_WSNONSIG (Adam Spragg)
+
+ - Documentation:
+ Fix devhelp documentation installation (Mike Hommey),
+ Fix web site encoding problems (Daniel Veillard),
+ Fix a couple of typo in HTML parser error messages (Michael Day),
+ Forgot to update the news page for 0.7.7 (Daniel Veillard)
+
+ - Portability:
+ 607273 Fix python detection on MSys/Windows (LRN),
+ 614087 Fix Socket API usage to allow Windows64 compilation (Ozkan Sezer),
+ Fix compilation with Clang (Koop Mast),
+ Fix Win32 build (Rob Richards)
+
+ - Bug Fixes:
+ 595789 fix a remaining potential Solaris problem (Daniel Veillard),
+ 617468 fix progressive HTML parsing with style using "'" (Denis Pauk),
+ 616478 Fix xmllint shell write command (Gwenn Kahz),
+ 614005 Possible erroneous HTML parsing on unterminated script (Pierre Belzile),
+ 627987 Fix XSD IDC errors in imported schemas (Jim Panetta),
+ 629325 XPath rounding errors first cleanup (Phil Shafer),
+ 630140 fix iso995x encoding error (Daniel Veillard),
+ make sure htmlCtxtReset do reset the disableSAX field (Daniel Veillard),
+ Fix a change of semantic on XPath preceding and following axis (Daniel Veillard),
+ Fix a potential segfault due to weak symbols on pthreads (Mike Hommey),
+ Fix a leak in XPath compilation (Daniel Veillard),
+ Fix the semantic of XPath axis for namespace/attribute context nodes (Daniel Veillard),
+ Avoid a descriptor leak in catalog loading code (Carlo Bramini),
+ Fix a small bug in XPath evaluation code (Marius Wachtler),
+ Fix handling of XML-1.0 XML namespace declaration (Daniel Veillard),
+ Fix errors in XSD double validation check (Csaba Raduly),
+ Fix handling of apos in URIs (Daniel Veillard),
+ xmlTextReaderReadOuterXml should handle DTD (Rob Richards),
+ Autogen.sh needs to create m4 directory (Rob Richards)
+
+ - Improvements:
+ 606592 update language ID parser to RFC 5646 (Daniel Veillard),
+ Sort python generated stubs (Mike Hommey),
+ Add an HTML parser option to avoid a default doctype (Daniel Veillard)
+
+ - Cleanups:
+ 618831 don't ship generated files in git (Adrian Bunk),
+ Switch from the obsolete mkinstalldirs to AC_PROG_MKDIR_P (Adrian Bunk),
+ Various cleanups on encoding handling (Daniel Veillard),
+ Fix xmllint to use format=1 for default formatting (Adam Spragg),
+ Force _xmlSaveCtxt.format to be 0 or 1 (Adam Spragg),
+ Cleanup encoding pointer comparison (Nikolay Sivov),
+ Small code cleanup on previous patch (Daniel Veillard)
+
+
+
+2.7.7: Mar 15 2010:
+ - Improvements:
+ Adding a --xpath option to xmllint (Daniel Veillard),
+ Make HTML parser non-recursive (Eugene Pimenov)
+
+ - Portability:
+ relaxng.c: cast to allow compilation with sun studio 11 (Ben Walton),
+ Fix build failure on Sparc solaris (Roumen Petrov),
+ use autoreconf in autogen.sh (Daniel Veillard),
+ Fix build with mingw (Roumen Petrov),
+ Upgrade some of the configure and autogen (Daniel Veillard),
+ Fix relaxNG tests in runtest for Windows runtest.c: initialize ret (Rob Richards),
+ Fix a const warning in xmlNodeSetBase (Martin Trappel),
+ Fix python generator to not use deprecated xmllib (Daniel Veillard),
+ Update some automake files (Daniel Veillard),
+ 598785 Fix nanohttp on Windows (spadix)
+
+ - Bug Fixes:
+ libxml violates the zlib interface and crashes (Mark Adler),
+ Fix broken escape behaviour in regexp ranges (Daniel Veillard),
+ Fix missing win32 libraries in libxml-2.0.pc (Volker Grabsch),
+ Fix detection of python linker flags (Daniel Macks),
+ fix build error in libxml2/python (Paul Smith),
+ ChunkParser: Incorrect decoding of small xml files (Raul Hudea),
+ htmlCheckEncoding doesn't update input-end after shrink (Eugene Pimenov),
+ Fix a missing #ifdef (Daniel Veillard),
+ Fix encoding selection for xmlParseInNodeContext (Daniel Veillard),
+ xmlPreviousElementSibling mistake (François Delyon),
+ 608773 add a missing check in xmlGROW (Daniel Veillard),
+ Fix xmlParseInNodeContext for HTML content (Daniel Veillard),
+ Fix lost namespace when copying node * tree.c: reconcile namespace if not found (Rob Richards),
+ Fix some missing commas in HTML element lists (Eugene Pimenov),
+ Correct variable type to unsigned (Nikolay Sivov),
+ Recognize ID attribute in HTML without DOCTYPE (Daniel Veillard),
+ Fix memory leak in xmlXPathEvalExpression() (Martin),
+ Fix an init bug in global.c (Kai Henning),
+ Fix xmlNodeSetBase() comment (Daniel Veillard),
+ Fix broken escape behaviour in regexp ranges (Daniel Veillard),
+ Don't give default HTML boolean attribute values in parser (Daniel Veillard),
+ xmlCtxtResetLastError should reset ctxt-errNo (Daniel Veillard)
+
+ - Cleanups:
+ Cleanup a couple of weirdness in HTML parser (Eugene Pimenov)
+
+
+
2.7.6: Oct 6 2009:
- Bug Fixes:
Restore thread support in default configuration (Andrew W. Nosenko),
code, beware, all
interfaces are likely to change, there is huge holes, it is clearly a work in
progress and don't even think of putting this code in a production system,
-it's actually not compiled in by default. The real fixes are: - a couple of bugs or limitations introduced in 2.4.20
+it's actually not compiled in by default. The real fixes are:
+ - a couple of bugs or limitations introduced in 2.4.20
- patches for Borland C++ and MSC by Igor
- some fixes on XPath strings and conformance patches by Richard
Jinks
2.3.9: May 19 2001:
-Lots of bugfixes, and added a basic SGML catalog support: - HTML push bugfix #54891 and another patch from Jonas Borgström
+Lots of bugfixes, and added a basic SGML catalog support:
+ - HTML push bugfix #54891 and another patch from Jonas Borgstrom
- some serious speed optimization again
- some documentation cleanups
- trying to get better linking on Solaris (-R)
about & charref parsing
- 2.1.0 also ease the upgrade from libxml v1 to the recent version. it
also contains numerous fixes and enhancements:
- added xmlStopParser() to stop parsing
+
+ added xmlStopParser() to stop parsing
improved a lot parsing speed when there is large CDATA blocs
includes XPath patches provided by Picdar Technology
tried to fix as much as possible DTD validation and namespace
output to a given encoding has been added/tested
lot of various fixes
+
- added xmlStopParser() to stop parsing
- improved a lot parsing speed when there is large CDATA blocs
- includes XPath patches provided by Picdar Technology
upgrade page
- Some interfaces may changes (especially a bit about encoding).
- the updates includes:
- fix I18N support. ISO-Latin-x/UTF-8/UTF-16 (nearly) seems correctly
+
+ fix I18N support. ISO-Latin-x/UTF-8/UTF-16 (nearly) seems correctly
handled now
Better handling of entities, especially well-formedness checking
and proper PEref extensions in external subsets
change
structures to accommodate DOM
+
- fix I18N support. ISO-Latin-x/UTF-8/UTF-16 (nearly) seems correctly
handled now
- Better handling of entities, especially well-formedness checking
#ifdef LIBXML_HTML_ENABLED
if (ctxt->myDoc == NULL)
ctxt->myDoc = htmlNewDocNoDtD(NULL, NULL);
- ctxt->myDoc->properties = XML_DOC_HTML;
- ctxt->myDoc->parseFlags = ctxt->options;
if (ctxt->myDoc == NULL) {
xmlSAX2ErrMemory(ctxt, "xmlSAX2StartDocument");
return;
}
+ ctxt->myDoc->properties = XML_DOC_HTML;
+ ctxt->myDoc->parseFlags = ctxt->options;
#else
xmlGenericError(xmlGenericErrorContext,
"libxml2 built without HTML support\n");
}
}
-#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
+#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
/**
* xmlSAX2AttributeInternal:
* @ctx: the user data (XML parser context)
val = xmlStringDecodeEntities(ctxt, value, XML_SUBSTITUTE_REF,
0,0,0);
ctxt->depth--;
+ if (val == NULL) {
+ xmlSAX2ErrMemory(ctxt, "xmlSAX2StartElement");
+ if (name != NULL)
+ xmlFree(name);
+ return;
+ }
} else {
val = (xmlChar *) value;
}
#endif
nodePop(ctxt);
}
-#endif /* LIBXML_SAX1_ENABLED || LIBXML_HTML_ENABLE */
+#endif /* LIBXML_SAX1_ENABLED || LIBXML_HTML_ENABLED || LIBXML_LEGACY_ENABLED */
/*
* xmlSAX2TextNode:
*/
if (dup == NULL)
dup = xmlStrndup(value, valueend - value);
+#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
#ifdef LIBXML_VALID_ENABLED
if (xmlValidateNCName(dup, 1) != 0) {
xmlErrValid(ctxt, XML_DTD_XMLID_VALUE,
"xml:id : attribute value %s is not an NCName\n",
(const char *) dup, NULL);
}
+#endif
#endif
xmlAddID(&ctxt->vctxt, ctxt->myDoc, dup, ret);
} else if (xmlIsID(ctxt->myDoc, ctxt->node, ret)) {
(xmlDictOwns(ctxt->dict, lastChild->content))) {
lastChild->content = xmlStrdup(lastChild->content);
}
+ if (lastChild->content == NULL) {
+ xmlSAX2ErrMemory(ctxt, "xmlSAX2Characters: xmlStrdup returned NULL");
+ return;
+ }
if (((size_t)ctxt->nodelen + (size_t)len > XML_MAX_TEXT_LENGTH) &&
((ctxt->options & XML_PARSE_HUGE) == 0)) {
xmlSAX2ErrMemory(ctxt, "xmlSAX2Characters: huge text node");
*/
xmlChar *
-xmlBufContent(const xmlBufPtr buf)
+xmlBufContent(const xmlBuf *buf)
{
if ((!buf) || (buf->error))
return NULL;
*/
xmlChar *
-xmlBufEnd(const xmlBufPtr buf)
+xmlBufEnd(xmlBufPtr buf)
{
if ((!buf) || (buf->error))
return NULL;
int xmlBufAddLen(xmlBufPtr buf, size_t len);
int xmlBufErase(xmlBufPtr buf, size_t len);
-/* const xmlChar * xmlBufContent(const xmlBufPtr buf); */
-/* const xmlChar * xmlBufEnd(const xmlBufPtr buf); */
+/* const xmlChar * xmlBufContent(const xmlBuf *buf); */
+/* const xmlChar * xmlBufEnd(xmlBufPtr buf); */
xmlChar * xmlBufDetach(xmlBufPtr buf);
if (ns->prefix != NULL) {
xmlOutputBufferWriteString(ctx->buf, " xmlns:");
xmlOutputBufferWriteString(ctx->buf, (const char *) ns->prefix);
- xmlOutputBufferWriteString(ctx->buf, "=\"");
+ xmlOutputBufferWriteString(ctx->buf, "=");
} else {
- xmlOutputBufferWriteString(ctx->buf, " xmlns=\"");
+ xmlOutputBufferWriteString(ctx->buf, " xmlns=");
}
if(ns->href != NULL) {
- xmlOutputBufferWriteString(ctx->buf, (const char *) ns->href);
+ xmlBufWriteQuotedString(ctx->buf->buffer, ns->href);
+ } else {
+ xmlOutputBufferWriteString(ctx->buf, "\"\"");
}
- xmlOutputBufferWriteString(ctx->buf, "\"");
return (1);
}
content = (xmlChar*)xmlMallocAtomic(size + 10);
if (content == NULL) {
xmlCatalogErrMemory("allocating catalog data");
+#ifdef HAVE_STAT
+ close(fd);
+#else
+ fclose(fd);
+#endif
return (NULL);
}
#ifdef HAVE_STAT
xmlGenericError(xmlGenericErrorContext,
"Setting catalog preference to SYSTEM\n");
break;
- case XML_CATA_PREFER_NONE:
- break;
+ default:
+ return(ret);
}
}
xmlCatalogDefaultPrefer = prefer;
#define HAVE_VSPRINTF 1
/* Define to 1 if you have the <zlib.h> header file. */
-#define HAVE_ZLIB_H
+#define HAVE_ZLIB_H 1
/* Define to 1 if you have the `_stat' function. */
#define HAVE__STAT 1
/* Whether __va_copy() is available */
-/* #undef HAVE___VA_COPY */
+#define HAVE___VA_COPY 1
/* Define as const if the declaration of iconv() needs const. */
/* #undef ICONV_CONST */
/* #undef SUPPORT_IP6 */
/* Version number of package */
-#define VERSION "2.9.0"
+#define VERSION "2.9.2"
/* Determine what socket length (socklen_t) data type is */
#define XML_SOCKLEN_T int
#if defined(_MSC_VER)
#undef GetModuleHandleA
#endif
+
+#define SEND_ARG2_CAST
+#define GETHOSTBYNAME_ARG_CAST
xmlDebugErr(ctxt, XML_CHECK_NO_NAME, "Name is NULL");
return;
}
+#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
if (xmlValidateName(name, 0)) {
xmlDebugErr3(ctxt, XML_CHECK_NOT_NCNAME,
"Name is not an NCName '%s'", (const char *) name);
}
+#endif
if ((ctxt->dict != NULL) &&
(!xmlDictOwns(ctxt->dict, name)) &&
((ctxt->doc == NULL) ||
} else if (!strcmp(command, "save")) {
xmlShellSave(ctxt, arg, NULL, NULL);
} else if (!strcmp(command, "write")) {
- if ((arg == NULL) || (arg[0] == 0))
+ if (arg[0] == 0)
xmlGenericError(xmlGenericErrorContext,
"Write command requires a filename argument\n");
else
ctxt->node = (xmlNodePtr) ctxt->doc;
} else {
#ifdef LIBXML_XPATH_ENABLED
+ int l;
+
ctxt->pctxt->node = ctxt->node;
+ l = strlen(arg);
+ if ((l >= 2) && (arg[l - 1] == '/'))
+ arg[l - 1] = 0;
list = xmlXPathEval((xmlChar *) arg, ctxt->pctxt);
#else
list = NULL;
#endif
#endif
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
+#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
#ifdef bottom_tree
#undef xmlAddPrevSibling
extern __typeof (xmlAddPrevSibling) xmlAddPrevSibling __attribute((alias("xmlAddPrevSibling__internal_alias")));
#endif
#endif
-#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
+#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
#ifdef bottom_SAX2
#undef xmlSAX2EndElement
extern __typeof (xmlSAX2EndElement) xmlSAX2EndElement __attribute((alias("xmlSAX2EndElement__internal_alias")));
#endif
#endif
-#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
+#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
#ifdef bottom_SAX2
#undef xmlSAX2StartElement
extern __typeof (xmlSAX2StartElement) xmlSAX2StartElement __attribute((alias("xmlSAX2StartElement__internal_alias")));
#endif
#endif
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
+#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
#ifdef bottom_tree
#undef xmlValidateNCName
extern __typeof (xmlValidateNCName) xmlValidateNCName __attribute((alias("xmlValidateNCName__internal_alias")));
#endif
#endif
+#if defined(LIBXML_XPATH_ENABLED)
+#ifdef bottom_xpath
+#undef xmlXPathNodeEval
+extern __typeof (xmlXPathNodeEval) xmlXPathNodeEval __attribute((alias("xmlXPathNodeEval__internal_alias")));
+#else
+#ifndef xmlXPathNodeEval
+extern __typeof (xmlXPathNodeEval) xmlXPathNodeEval__internal_alias __attribute((visibility("hidden")));
+#define xmlXPathNodeEval xmlXPathNodeEval__internal_alias
+#endif
+#endif
+#endif
+
#if defined(LIBXML_XPATH_ENABLED)
#ifdef bottom_xpath
#undef xmlXPathNodeLeading
#endif
#endif
+#if defined(LIBXML_XPATH_ENABLED)
+#ifdef bottom_xpath
+#undef xmlXPathSetContextNode
+extern __typeof (xmlXPathSetContextNode) xmlXPathSetContextNode __attribute((alias("xmlXPathSetContextNode__internal_alias")));
+#else
+#ifndef xmlXPathSetContextNode
+extern __typeof (xmlXPathSetContextNode) xmlXPathSetContextNode__internal_alias __attribute((visibility("hidden")));
+#define xmlXPathSetContextNode xmlXPathSetContextNode__internal_alias
+#endif
+#endif
+#endif
+
#if defined(LIBXML_XPATH_ENABLED)
#ifdef bottom_xpath
#undef xmlXPathStartsWithFunction
return (written? written : ret);
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlCharEncOutput:
* @output: a parser output buffer
}
return(ret);
}
+#endif
/**
* xmlCharEncOutFunc:
xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) {
int ret = 0;
int tofree = 0;
+ int i, handler_in_list = 0;
+
if (handler == NULL) return(-1);
if (handler->name == NULL) return(-1);
+ if (handlers != NULL) {
+ for (i = 0;i < nbCharEncodingHandler; i++) {
+ if (handler == handlers[i]) {
+ handler_in_list = 1;
+ break;
+ }
+ }
+ }
#ifdef LIBXML_ICONV_ENABLED
/*
* Iconv handlers can be used only once, free the whole block.
* and the associated icon resources.
*/
- if ((handler->iconv_out != NULL) || (handler->iconv_in != NULL)) {
+ if ((handler_in_list == 0) &&
+ ((handler->iconv_out != NULL) || (handler->iconv_in != NULL))) {
tofree = 1;
if (handler->iconv_out != NULL) {
if (iconv_close(handler->iconv_out))
}
#endif /* LIBXML_ICONV_ENABLED */
#ifdef LIBXML_ICU_ENABLED
- if ((handler->uconv_out != NULL) || (handler->uconv_in != NULL)) {
+ if ((handler_in_list == 0) &&
+ ((handler->uconv_out != NULL) || (handler->uconv_in != NULL))) {
tofree = 1;
if (handler->uconv_out != NULL) {
closeIcuConverter(handler->uconv_out);
* Returns A pointer to the entity structure or NULL if not found.
*/
xmlEntityPtr
-xmlGetDocEntity(xmlDocPtr doc, const xmlChar *name) {
+xmlGetDocEntity(const xmlDoc *doc, const xmlChar *name) {
xmlEntityPtr cur;
xmlEntitiesTablePtr table;
* Returns A newly allocated string with the substitution done.
*/
xmlChar *
-xmlEncodeSpecialChars(xmlDocPtr doc ATTRIBUTE_UNUSED, const xmlChar *input) {
+xmlEncodeSpecialChars(const xmlDoc *doc ATTRIBUTE_UNUSED, const xmlChar *input) {
const xmlChar *cur = input;
xmlChar *buffer = NULL;
xmlChar *out = NULL;
return(NULL);
ret = xmlHashCreate(table->size);
+ if (ret == NULL)
+ return(NULL);
+
if (table->table) {
for(i = 0; i < table->size; i++) {
if (table->table[i].valid == 0)
#define HAVE_STDARG_H
#define HAVE_MALLOC_H
#define HAVE_ERRNO_H
+#define SEND_ARG2_CAST
+#define GETHOSTBYNAME_ARG_CAST
#if defined(_WIN32_WCE)
#undef HAVE_ERRNO_H
#if defined(_MSC_VER)
#define mkdir(p,m) _mkdir(p)
+#if _MSC_VER < 1900
#define snprintf _snprintf
+#endif
#if _MSC_VER < 1500
#define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a)
#endif
endElement(void *ctx, const xmlChar * name ATTRIBUTE_UNUSED)
{
DEPRECATED("endElement")
- xmlSAX2EndElement(ctx, name);
+ xmlSAX2EndElement(ctx, name);
}
/**
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
- res = send(ctxt->controlFd, buf, len, 0);
+ res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
return(res);
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
- res = send(ctxt->controlFd, buf, len, 0);
+ res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
return(res);
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf); /* Just to be consistent, even though we know it can't have a % in it */
#endif
- res = send(ctxt->controlFd, buf, len, 0);
+ res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
return(res);
return (-1);
}
if (tmp->ai_addrlen > sizeof(ctxt->ftpAddr)) {
+ if (result)
+ freeaddrinfo (result);
__xmlIOErr(XML_FROM_FTP, 0, "gethostbyname address mismatch");
return (-1);
}
#endif
{
if (proxy)
- hp = gethostbyname (proxy);
+ hp = gethostbyname (GETHOSTBYNAME_ARG_CAST proxy);
else
- hp = gethostbyname (ctxt->hostname);
+ hp = gethostbyname (GETHOSTBYNAME_ARG_CAST ctxt->hostname);
if (hp == NULL) {
__xmlIOErr(XML_FROM_FTP, 0, "gethostbyname failed");
return (-1);
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
- res = send(ctxt->controlFd, buf, len, 0);
+ res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
closesocket(ctxt->controlFd);
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
- res = send(ctxt->controlFd, buf, len, 0);
+ res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
closesocket(ctxt->controlFd);
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
- res = send(ctxt->controlFd, buf, len, 0);
+ res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
closesocket(ctxt->controlFd); ctxt->controlFd = INVALID_SOCKET;
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
- res = send(ctxt->controlFd, buf, len, 0);
+ res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
closesocket(ctxt->controlFd); ctxt->controlFd = INVALID_SOCKET;
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
- res = send(ctxt->controlFd, buf, len, 0);
+ res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
closesocket(ctxt->controlFd); ctxt->controlFd = INVALID_SOCKET;
if (port <= 0)
return(NULL);
ctxt = (xmlNanoFTPCtxtPtr) xmlNanoFTPNewCtxt(NULL);
+ if (ctxt == NULL)
+ return(NULL);
ctxt->hostname = xmlMemStrdup(server);
+ if (ctxt->hostname == NULL) {
+ xmlNanoFTPFreeCtxt(ctxt);
+ return(NULL);
+ }
if (port != 0)
ctxt->port = port;
res = xmlNanoFTPConnect(ctxt);
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
- res = send(ctxt->controlFd, buf, len, 0);
+ res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
return(res);
int len;
int res;
- if ((ctxt == NULL) || (ctxt->controlFd == INVALID_SOCKET) || (file == NULL)) return(-1);
- if (file == NULL) return (0);
+ if ((ctxt == NULL) || (ctxt->controlFd == INVALID_SOCKET) ||
+ (file == NULL)) return(-1);
/*
* Expected response code for DELE:
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
- res = send(ctxt->controlFd, buf, len, 0);
+ res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
return(res);
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
- res = send(ctxt->controlFd, buf, len, 0);
+ res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
closesocket(ctxt->dataFd); ctxt->dataFd = INVALID_SOCKET;
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
- res = send(ctxt->controlFd, buf, len, 0);
+ res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
closesocket(ctxt->dataFd); ctxt->dataFd = INVALID_SOCKET;
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
- res = send(ctxt->controlFd, buf, len, 0);
+ res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
closesocket(ctxt->dataFd); ctxt->dataFd = INVALID_SOCKET;
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
- res = send(ctxt->controlFd, buf, len, 0);
+ res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
closesocket(ctxt->dataFd); ctxt->dataFd = INVALID_SOCKET;
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
- res = send(ctxt->controlFd, buf, len, 0);
+ res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
closesocket(ctxt->dataFd); ctxt->dataFd = INVALID_SOCKET;
if ((ctxt->state & XML_NANO_HTTP_WRITE) && (xmt_ptr != NULL)) {
while (total_sent < outlen) {
- int nsent = send(ctxt->fd, xmt_ptr + total_sent,
+ int nsent = send(ctxt->fd, SEND_ARG2_CAST (xmt_ptr + total_sent),
outlen - total_sent, 0);
if (nsent > 0)
0) {
/* Solaris error code */
__xmlIOErr(XML_FROM_HTTP, 0, "getsockopt failed\n");
+ closesocket(s);
return INVALID_SOCKET;
}
#endif
#endif
#if !defined(HAVE_GETADDRINFO) || !defined(_WIN32)
{
- h = gethostbyname (host);
+ h = gethostbyname (GETHOSTBYNAME_ARG_CAST host);
if (h == NULL) {
/*
xmlNanoHTTPInit();
retry:
- if (redirURL == NULL)
+ if (redirURL == NULL) {
ctxt = xmlNanoHTTPNewCtxt(URL);
- else {
+ if (ctxt == NULL)
+ return(NULL);
+ } else {
ctxt = xmlNanoHTTPNewCtxt(redirURL);
+ if (ctxt == NULL)
+ return(NULL);
ctxt->location = xmlMemStrdup(redirURL);
}
- if ( ctxt == NULL ) {
- return ( NULL );
- }
-
if ((ctxt->protocol == NULL) || (strcmp(ctxt->protocol, "http"))) {
__xmlIOErr(XML_FROM_HTTP, XML_HTTP_URL_SYNTAX, "Not a valid HTTP URI");
xmlNanoHTTPFreeCtxt(ctxt);
return (0);
if (ctxt->lastError.code == XML_ERR_ENTITY_LOOP)
return (1);
+
+ /*
+ * This may look absurd but is needed to detect
+ * entities problems
+ */
+ if ((ent != NULL) && (ent->etype != XML_INTERNAL_PREDEFINED_ENTITY) &&
+ (ent->content != NULL) && (ent->checked == 0)) {
+ unsigned long oldnbent = ctxt->nbentities;
+ xmlChar *rep;
+
+ ent->checked = 1;
+
+ rep = xmlStringDecodeEntities(ctxt, ent->content,
+ XML_SUBSTITUTE_REF, 0, 0, 0);
+
+ ent->checked = (ctxt->nbentities - oldnbent + 1) * 2;
+ if (rep != NULL) {
+ if (xmlStrchr(rep, '<'))
+ ent->checked |= 1;
+ xmlFree(rep);
+ rep = NULL;
+ }
+ }
if (replacement != 0) {
if (replacement < XML_MAX_TEXT_LENGTH)
return(0);
return (0);
} else {
/*
- * strange we got no data for checking just return
+ * strange we got no data for checking
*/
- return (0);
+ if (((ctxt->lastError.code != XML_ERR_UNDECLARED_ENTITY) &&
+ (ctxt->lastError.code != XML_WAR_UNDECLARED_ENTITY)) ||
+ (ctxt->nbentities <= 10000))
+ return (0);
}
xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
return (1);
xmlGROW (ctxt);
static void xmlGROW (xmlParserCtxtPtr ctxt) {
- if ((((ctxt->input->end - ctxt->input->cur) > XML_MAX_LOOKUP_LIMIT) ||
- ((ctxt->input->cur - ctxt->input->base) > XML_MAX_LOOKUP_LIMIT)) &&
+ unsigned long curEnd = ctxt->input->end - ctxt->input->cur;
+ unsigned long curBase = ctxt->input->cur - ctxt->input->base;
+
+ if (((curEnd > (unsigned long) XML_MAX_LOOKUP_LIMIT) ||
+ (curBase > (unsigned long) XML_MAX_LOOKUP_LIMIT)) &&
((ctxt->input->buf) && (ctxt->input->buf->readcallback != (xmlInputReadCallback) xmlNop)) &&
((ctxt->options & XML_PARSE_HUGE) == 0)) {
xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "Huge input lookup");
while (IS_BLANK_CH(*cur)) {
if (*cur == '\n') {
ctxt->input->line++; ctxt->input->col = 1;
+ } else {
+ ctxt->input->col++;
}
cur++;
res++;
name, NULL);
ctxt->valid = 0;
}
+ xmlParserEntityCheck(ctxt, 0, NULL, 0);
} else if (ctxt->input->free != deallocblankswrapper) {
input = xmlNewBlanksWrapperInputStream(ctxt, entity);
if (xmlPushInput(ctxt, input) < 0)
xmlChar start[4];
xmlCharEncoding enc;
+ /*
+ * Note: external parameter entities will not be loaded, it
+ * is not required for a non-validating parser, unless the
+ * option of validating, or substituting entities were
+ * given. Doing so is far more secure as the parser will
+ * only process data coming from the document entity by
+ * default.
+ */
+ if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) &&
+ ((ctxt->options & XML_PARSE_NOENT) == 0) &&
+ ((ctxt->options & XML_PARSE_DTDVALID) == 0) &&
+ ((ctxt->options & XML_PARSE_DTDLOAD) == 0) &&
+ ((ctxt->options & XML_PARSE_DTDATTR) == 0) &&
+ (ctxt->replaceEntities == 0) &&
+ (ctxt->validate == 0))
+ return;
+
/*
* handle the extra spaces added before and after
* c.f. http://www.w3.org/TR/REC-xml#as-PE
if ((ctxt->lastError.code == XML_ERR_ENTITY_LOOP) ||
(ctxt->lastError.code == XML_ERR_INTERNAL_ERROR))
goto int_error;
+ xmlParserEntityCheck(ctxt, 0, ent, 0);
if (ent != NULL)
ctxt->nbentities += ent->checked / 2;
if ((ent != NULL) &&
ent = xmlParseStringPEReference(ctxt, &str);
if (ctxt->lastError.code == XML_ERR_ENTITY_LOOP)
goto int_error;
+ xmlParserEntityCheck(ctxt, 0, ent, 0);
if (ent != NULL)
ctxt->nbentities += ent->checked / 2;
if (ent != NULL) {
int len = 0, l;
int c;
int count = 0;
+ const xmlChar *end; /* needed because CUR_CHAR() can move cur on \r\n */
#ifdef DEBUG
nbParseNCNameComplex++;
* Handler for more complex cases
*/
GROW;
+ end = ctxt->input->cur;
c = CUR_CHAR(l);
if ((c == ' ') || (c == '>') || (c == '/') || /* accelerators */
(!xmlIsNameStartChar(ctxt, c) || (c == ':'))) {
}
len += l;
NEXTL(l);
+ end = ctxt->input->cur;
c = CUR_CHAR(l);
if (c == 0) {
count = 0;
GROW;
if (ctxt->instate == XML_PARSER_EOF)
return(NULL);
+ end = ctxt->input->cur;
c = CUR_CHAR(l);
}
}
xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName");
return(NULL);
}
- return(xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len));
+ return(xmlDictLookup(ctxt->dict, end - len, len));
}
/**
}
if ((name != NULL) && (xmlStrchr(name, ':') != NULL)) {
xmlNsErr(ctxt, XML_NS_ERR_COLON,
- "colon are forbidden from PI names '%s'\n", name, NULL, NULL);
+ "colons are forbidden from PI names '%s'\n", name, NULL, NULL);
}
return(name);
}
}
if (xmlStrchr(name, ':') != NULL) {
xmlNsErr(ctxt, XML_NS_ERR_COLON,
- "colon are forbidden from notation names '%s'\n",
+ "colons are forbidden from notation names '%s'\n",
name, NULL, NULL);
}
SKIP_BLANKS;
}
if (xmlStrchr(name, ':') != NULL) {
xmlNsErr(ctxt, XML_NS_ERR_COLON,
- "colon are forbidden from entities names '%s'\n",
+ "colons are forbidden from entities names '%s'\n",
name, NULL, NULL);
}
skipped = SKIP_BLANKS;
(ret != XML_WAR_UNDECLARED_ENTITY)) {
xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY,
"Entity '%s' failed to parse\n", ent->name);
+ xmlParserEntityCheck(ctxt, 0, ent, 0);
} else if (list != NULL) {
xmlFreeNodeList(list);
list = NULL;
/*
* We are copying here, make sure there is no abuse
*/
- ctxt->sizeentcopy += ent->length;
+ ctxt->sizeentcopy += ent->length + 5;
if (xmlParserEntityCheck(ctxt, 0, ent, ctxt->sizeentcopy))
return;
/*
* We are copying here, make sure there is no abuse
*/
- ctxt->sizeentcopy += ent->length;
+ ctxt->sizeentcopy += ent->length + 5;
if (xmlParserEntityCheck(ctxt, 0, ent, ctxt->sizeentcopy))
return;
ctxt->sax->reference(ctxt->userData, name);
}
}
+ xmlParserEntityCheck(ctxt, 0, ent, 0);
ctxt->valid = 0;
}
else if ((ctxt->instate == XML_PARSER_ATTRIBUTE_VALUE) &&
(ent != NULL) &&
(ent->etype != XML_INTERNAL_PREDEFINED_ENTITY)) {
- if ((ent->checked & 1) || ((ent->checked == 0) &&
- (ent->content != NULL) &&(xmlStrchr(ent->content, '<')))) {
+ if (((ent->checked & 1) || (ent->checked == 0)) &&
+ (ent->content != NULL) && (xmlStrchr(ent->content, '<'))) {
xmlFatalErrMsgStr(ctxt, XML_ERR_LT_IN_ATTRIBUTE,
"'<' in entity '%s' is not allowed in attributes values\n", name);
}
/*
- * Predefined entites override any extra definition
+ * Predefined entities override any extra definition
*/
if ((ctxt->options & XML_PARSE_OLDSAX) == 0) {
ent = xmlGetPredefinedEntity(name);
"Entity '%s' not defined\n",
name);
}
+ xmlParserEntityCheck(ctxt, 0, ent, 0);
/* TODO ? check regressions ctxt->valid = 0; */
}
name, NULL);
ctxt->valid = 0;
}
+ xmlParserEntityCheck(ctxt, 0, NULL, 0);
} else {
/*
* Internal checking in case the entity quest barfed
name, NULL);
ctxt->valid = 0;
}
+ xmlParserEntityCheck(ctxt, 0, NULL, 0);
} else {
/*
* Internal checking in case the entity quest barfed
xmlChar limit = 0;
const xmlChar *in = NULL, *start, *end, *last;
xmlChar *ret = NULL;
+ int line, col;
GROW;
in = (xmlChar *) CUR_PTR;
+ line = ctxt->input->line;
+ col = ctxt->input->col;
if (*in != '"' && *in != '\'') {
xmlFatalErr(ctxt, XML_ERR_ATTRIBUTE_NOT_STARTED, NULL);
return (NULL);
* pure ASCII.
*/
limit = *in++;
+ col++;
end = ctxt->input->end;
start = in;
if (in >= end) {
while ((in < end) && (*in != limit) &&
((*in == 0x20) || (*in == 0x9) ||
(*in == 0xA) || (*in == 0xD))) {
+ if (*in == 0xA) {
+ line++; col = 1;
+ } else {
+ col++;
+ }
in++;
start = in;
if (in >= end) {
}
while ((in < end) && (*in != limit) && (*in >= 0x20) &&
(*in <= 0x7f) && (*in != '&') && (*in != '<')) {
+ col++;
if ((*in++ == 0x20) && (*in == 0x20)) break;
if (in >= end) {
const xmlChar *oldbase = ctxt->input->base;
while ((in < end) && (*in != limit) &&
((*in == 0x20) || (*in == 0x9) ||
(*in == 0xA) || (*in == 0xD))) {
+ if (*in == 0xA) {
+ line++, col = 1;
+ } else {
+ col++;
+ }
in++;
if (in >= end) {
const xmlChar *oldbase = ctxt->input->base;
while ((in < end) && (*in != limit) && (*in >= 0x20) &&
(*in <= 0x7f) && (*in != '&') && (*in != '<')) {
in++;
+ col++;
if (in >= end) {
const xmlChar *oldbase = ctxt->input->base;
GROW;
if (*in != limit) goto need_complex;
}
in++;
+ col++;
if (len != NULL) {
*len = last - start;
ret = (xmlChar *) start;
ret = xmlStrndup(start, last - start);
}
CUR_PTR = in;
+ ctxt->input->line = line;
+ ctxt->input->col = col;
if (alloc) *alloc = 0;
return ret;
need_complex:
const xmlChar *URL = xmlDictLookup(ctxt->dict, attvalue, len);
xmlURIPtr uri;
+ if (URL == NULL) {
+ xmlErrMemory(ctxt, "dictionary allocation failure");
+ if ((attvalue != NULL) && (alloc != 0))
+ xmlFree(attvalue);
+ return(NULL);
+ }
if (*URL != 0) {
uri = xmlParseURI((const char *) URL);
if (uri == NULL) {
if (nsPush(ctxt, NULL, URL) > 0) nbNs++;
skip_default_ns:
if (alloc != 0) xmlFree(attvalue);
+ if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
+ break;
+ if (!IS_BLANK_CH(RAW)) {
+ xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
+ "attributes construct error\n");
+ break;
+ }
SKIP_BLANKS;
continue;
}
if (nsPush(ctxt, attname, URL) > 0) nbNs++;
skip_ns:
if (alloc != 0) xmlFree(attvalue);
+ if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
+ break;
+ if (!IS_BLANK_CH(RAW)) {
+ xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
+ "attributes construct error\n");
+ break;
+ }
SKIP_BLANKS;
if (ctxt->input->base != base) goto base_changed;
continue;
if ((tlen > 0) && (xmlStrncmp(ctxt->input->cur, ctxt->name, tlen) == 0)) {
if (ctxt->input->cur[tlen] == '>') {
ctxt->input->cur += tlen + 1;
+ ctxt->input->col += tlen + 1;
goto done;
}
ctxt->input->cur += tlen;
+ ctxt->input->col += tlen;
name = (xmlChar*)1;
} else {
if (prefix == NULL)
/*
* Non standard parsing, allowing the user to ignore encoding
*/
- if (ctxt->options & XML_PARSE_IGNORE_ENC)
- return(encoding);
+ if (ctxt->options & XML_PARSE_IGNORE_ENC) {
+ xmlFree((xmlChar *) encoding);
+ return(NULL);
+ }
/*
* UTF-16 encoding stwich has already taken place at this stage,
ctxt->sax->startDocument(ctxt->userData);
if (ctxt->instate == XML_PARSER_EOF)
return(-1);
+ if ((ctxt->myDoc != NULL) && (ctxt->input != NULL) &&
+ (ctxt->input->buf != NULL) && (ctxt->input->buf->compressed >= 0)) {
+ ctxt->myDoc->compression = ctxt->input->buf->compressed;
+ }
/*
* The Misc part of the Prolog
return(NULL);
}
+ /* We are loading a DTD */
+ ctxt->options |= XML_PARSE_DTDLOAD;
+
/*
* Set-up the SAX context
*/
return(NULL);
}
+ /* We are loading a DTD */
+ ctxt->options |= XML_PARSE_DTDLOAD;
+
/*
* Set-up the SAX context
*/
xmlFree((xmlChar *) ctxt->encoding);
ctxt->encoding = xmlStrdup((const xmlChar *) doc->encoding);
- hdlr = xmlFindCharEncodingHandler(doc->encoding);
+ hdlr = xmlFindCharEncodingHandler((const char *) doc->encoding);
if (hdlr != NULL) {
xmlSwitchToEncoding(ctxt, hdlr);
} else {
xmlCtxtUseOptionsInternal(ctxt, options, NULL);
xmlDetectSAX2(ctxt);
ctxt->myDoc = doc;
+ /* parsing in context, i.e. as within existing content */
+ ctxt->instate = XML_PARSER_CONTENT;
fake = xmlNewComment(NULL);
if (fake == NULL) {
}
cur = cur->parent;
}
- ctxt->instate = XML_PARSER_CONTENT;
}
if ((ctxt->validate) || (ctxt->replaceEntities != 0)) {
#endif
#ifdef LIBXML_XPATH_ENABLED
xmlXPathInit();
+#endif
+#ifdef LIBXML_CATALOG_ENABLED
+ xmlInitializeCatalog();
#endif
xmlParserInitialized = 1;
#ifdef LIBXML_THREAD_ENABLED
xmlSchemaCleanupTypes();
xmlRelaxNGCleanupTypes();
#endif
- xmlCleanupGlobals();
xmlResetLastError();
+ xmlCleanupGlobals();
xmlCleanupThreads(); /* must be last if called not from the main thread */
xmlCleanupMemory();
xmlParserInitialized = 0;
if (cur == NULL)
return (NULL);
+ xmlInitParser();
ctxt = xmlCreateDocParserCtxt(cur);
if (ctxt == NULL)
{
xmlParserCtxtPtr ctxt;
+ xmlInitParser();
ctxt = xmlCreateURLParserCtxt(filename, options);
if (ctxt == NULL)
return (NULL);
{
xmlParserCtxtPtr ctxt;
+ xmlInitParser();
ctxt = xmlCreateMemoryParserCtxt(buffer, size);
if (ctxt == NULL)
return (NULL);
if (fd < 0)
return (NULL);
+ xmlInitParser();
input = xmlParserInputBufferCreateFd(fd, XML_CHAR_ENCODING_NONE);
if (input == NULL)
if (ioread == NULL)
return (NULL);
+ xmlInitParser();
input = xmlParserInputBufferCreateIO(ioread, ioclose, ioctx,
XML_CHAR_ENCODING_NONE);
return (NULL);
if (ctxt == NULL)
return (NULL);
+ xmlInitParser();
xmlCtxtReset(ctxt);
return (NULL);
if (ctxt == NULL)
return (NULL);
+ xmlInitParser();
xmlCtxtReset(ctxt);
return (NULL);
if (buffer == NULL)
return (NULL);
+ xmlInitParser();
xmlCtxtReset(ctxt);
return (NULL);
if (ctxt == NULL)
return (NULL);
+ xmlInitParser();
xmlCtxtReset(ctxt);
return (NULL);
if (ctxt == NULL)
return (NULL);
+ xmlInitParser();
xmlCtxtReset(ctxt);
ctxt->nsWellFormed = 1;
ctxt->valid = 1;
ctxt->loadsubset = xmlLoadExtDtdDefaultValue;
+ if (ctxt->loadsubset) {
+ ctxt->options |= XML_PARSE_DTDLOAD;
+ }
ctxt->validate = xmlDoValidityCheckingDefaultValue;
ctxt->pedantic = xmlPedanticParserDefaultValue;
+ if (ctxt->pedantic) {
+ ctxt->options |= XML_PARSE_PEDANTIC;
+ }
ctxt->linenumbers = xmlLineNumbersDefaultValue;
ctxt->keepBlanks = xmlKeepBlanksDefaultValue;
- if (ctxt->keepBlanks == 0)
+ if (ctxt->keepBlanks == 0) {
ctxt->sax->ignorableWhitespace = xmlSAX2IgnorableWhitespace;
+ ctxt->options |= XML_PARSE_NOBLANKS;
+ }
ctxt->vctxt.finishDtd = XML_CTXT_FINISH_DTD_0;
ctxt->vctxt.userData = ctxt;
else
ctxt->vctxt.warning = xmlParserValidityWarning;
ctxt->vctxt.nodeMax = 0;
+ ctxt->options |= XML_PARSE_DTDVALID;
}
ctxt->replaceEntities = xmlSubstituteEntitiesDefaultValue;
+ if (ctxt->replaceEntities) {
+ ctxt->options |= XML_PARSE_NOENT;
+ }
ctxt->record_info = 0;
ctxt->nbChars = 0;
ctxt->checkIndex = 0;
/* Otherwise, we need to add new node to buffer */
else {
- if (ctxt->node_seq.length + 1 > ctxt->node_seq.maximum) {
+ if ((ctxt->node_seq.length + 1 > ctxt->node_seq.maximum) ||
+ (ctxt->node_seq.buffer == NULL)) {
xmlParserNodeInfo *tmp_buffer;
unsigned int byte_size;
{
int i;
- if (state == NULL) {
+ if (state == NULL || states == NULL) {
return (-1);
}
if (states->nbState >= states->maxState) {
}
ret = xmlSchemaValPredefTypeNode(typ, value2, &res2, ctxt2);
if (ret != 0) {
- if ((comp1 == NULL) && (res1 != NULL))
+ if (res1 != (xmlSchemaValPtr) comp1)
xmlSchemaFreeValue(res1);
return (-1);
}
- if (res1 == NULL) {
- return (-1);
- }
ret = xmlSchemaCompareValues(res1, res2);
if (res1 != (xmlSchemaValPtr) comp1)
xmlSchemaFreeValue(res1);
}
/*
- * Apply 4.17 mergingd rules to defines and starts
+ * Apply 4.17 merging rules to defines and starts
*/
xmlRelaxNGCombineStart(ctxt, ret);
if (ret->defs != NULL) {
ctxt->define = NULL;
if (IS_RELAXNG(node, "grammar")) {
schema->topgrammar = xmlRelaxNGParseGrammar(ctxt, node->children);
+ if (schema->topgrammar == NULL) {
+ xmlRelaxNGFree(schema);
+ return (NULL);
+ }
} else {
xmlRelaxNGGrammarPtr tmp, ret;
schema->topgrammar = ret = xmlRelaxNGNewGrammar(ctxt);
if (schema->topgrammar == NULL) {
- return (schema);
+ xmlRelaxNGFree(schema);
+ return (NULL);
}
/*
* Link the new grammar in the tree
}
}
/*
- * Thisd is not an else since "include" is transformed
+ * This is not an else since "include" is transformed
* into a div
*/
if (xmlStrEqual(cur->name, BAD_CAST "div")) {
if (ns != NULL)
xmlFree(ns);
/*
- * Since we are about to delete cur, if it's nsDef is non-NULL we
+ * Since we are about to delete cur, if its nsDef is non-NULL we
* need to preserve it (it contains the ns definitions for the
* children we just moved). We'll just stick it on to the end
* of cur->parent's list, since it's never going to be re-serialized
* (bug 143738).
*/
- if (cur->nsDef != NULL) {
+ if ((cur->nsDef != NULL) && (cur->parent != NULL)) {
xmlNsPtr parDef = (xmlNsPtr)&cur->parent->nsDef;
while (parDef->next != NULL)
parDef = parDef->next;
else if ((cur->type == XML_TEXT_NODE) ||
(cur->type == XML_CDATA_SECTION_NODE)) {
if (IS_BLANK_NODE(cur)) {
- if (cur->parent->type == XML_ELEMENT_NODE) {
+ if ((cur->parent != NULL) &&
+ (cur->parent->type == XML_ELEMENT_NODE)) {
if ((!xmlStrEqual(cur->parent->name, BAD_CAST "value"))
&&
(!xmlStrEqual
return (ret);
list = list->next;
}
+ } else if (define->type == XML_RELAXNG_CHOICE) {
+ xmlRelaxNGDefinePtr list;
+
+ list = define->nameClass;
+ while (list != NULL) {
+ ret = xmlRelaxNGAttributeMatch(ctxt, list, prop);
+ if (ret == 1)
+ return (1);
+ if (ret < 0)
+ return (ret);
+ list = list->next;
+ }
+ return (0);
} else {
TODO}
return (1);
oldstate = ctxt->state;
for (i = 0; i < nbgroups; i++) {
ctxt->state = xmlRelaxNGCopyValidState(ctxt, oldstate);
+ if (ctxt->state == NULL) {
+ ret = -1;
+ break;
+ }
group = partitions->groups[i];
if (lasts[i] != NULL) {
last = lasts[i]->next;
FILE *outputFile; /* if using XML_SCHEMATRON_OUT_FILE */
xmlBufferPtr outputBuffer; /* if using XML_SCHEMATRON_OUT_BUFFER */
+#ifdef LIBXML_OUTPUT_ENABLED
xmlOutputWriteCallback iowrite; /* if using XML_SCHEMATRON_OUT_IO */
xmlOutputCloseCallback ioclose;
+#endif
void *ioctx;
/* error reporting data */
pthread_mutex_unlock(&tok->lock);
#elif defined HAVE_WIN32_THREADS
EnterCriticalSection(&tok->cs);
- ++tok->count;
+ tok->count++;
#elif defined HAVE_BEOS_THREADS
if (tok->lock->tid == find_thread(NULL)) {
tok->count++;
}
pthread_mutex_unlock(&tok->lock);
#elif defined HAVE_WIN32_THREADS
- if (!--tok->count)
+ if (tok->count > 0) {
LeaveCriticalSection(&tok->cs);
+ tok->count--;
+ }
#elif defined HAVE_BEOS_THREADS
if (tok->lock->tid == find_thread(NULL)) {
tok->count--;
if (x == 0) return(64);
n = 0;
- if (x <= 0x00000000FFFFFFFFL) {n = n + 32; x = x << 32;}
- if (x <= 0x0000FFFFFFFFFFFFL) {n = n + 16; x = x << 16;}
- if (x <= 0x00FFFFFFFFFFFFFFL) {n = n + 8; x = x << 8;}
- if (x <= 0x0FFFFFFFFFFFFFFFL) {n = n + 4; x = x << 4;}
- if (x <= 0x3FFFFFFFFFFFFFFFL) {n = n + 2; x = x << 2;}
- if (x <= 0x7FFFFFFFFFFFFFFFL) {n = n + 1;}
+ if (x <= MK_UINT64(0x00000000FFFFFFFF)) {n = n + 32; x = x << 32;}
+ if (x <= MK_UINT64(0x0000FFFFFFFFFFFF)) {n = n + 16; x = x << 16;}
+ if (x <= MK_UINT64(0x00FFFFFFFFFFFFFF)) {n = n + 8; x = x << 8;}
+ if (x <= MK_UINT64(0x0FFFFFFFFFFFFFFF)) {n = n + 4; x = x << 4;}
+ if (x <= MK_UINT64(0x3FFFFFFFFFFFFFFF)) {n = n + 2; x = x << 2;}
+ if (x <= MK_UINT64(0x7FFFFFFFFFFFFFFF)) {n = n + 1;}
return n;
}
/* }}} */
static xmlNsPtr
xmlNewReconciliedNs(xmlDocPtr doc, xmlNodePtr tree, xmlNsPtr ns);
-static xmlChar* xmlGetPropNodeValueInternal(xmlAttrPtr prop);
+static xmlChar* xmlGetPropNodeValueInternal(const xmlAttr *prop);
/************************************************************************
* *
* Returns A pointer to the entity structure or NULL if not found.
*/
static xmlEntityPtr
-xmlGetEntityFromDtd(xmlDtdPtr dtd, const xmlChar *name) {
+xmlGetEntityFromDtd(const xmlDtd *dtd, const xmlChar *name) {
xmlEntitiesTablePtr table;
if((dtd != NULL) && (dtd->entities != NULL)) {
* Returns A pointer to the entity structure or NULL if not found.
*/
static xmlEntityPtr
-xmlGetParameterEntityFromDtd(xmlDtdPtr dtd, const xmlChar *name) {
+xmlGetParameterEntityFromDtd(const xmlDtd *dtd, const xmlChar *name) {
xmlEntitiesTablePtr table;
if ((dtd != NULL) && (dtd->pentities != NULL)) {
#define CUR_SCHAR(s, l) xmlStringCurrentChar(NULL, s, &l)
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
+#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
/**
* xmlValidateNCName:
* @value: the value to check
* Creation of a new Namespace. This function will refuse to create
* a namespace with a similar prefix than an existing one present on this
* node.
+ * Note that for a default namespace, @prefix should be NULL.
+ *
* We use href==NULL in the case of an element creation where the namespace
* was not defined.
+ *
* Returns a new namespace pointer or NULL
*/
xmlNsPtr
#endif
return;
}
- node->ns = ns;
+ if ((node->type == XML_ELEMENT_NODE) ||
+ (node->type == XML_ATTRIBUTE_NODE))
+ node->ns = ns;
}
/**
*/
xmlDtdPtr
-xmlGetIntSubset(xmlDocPtr doc) {
+xmlGetIntSubset(const xmlDoc *doc) {
xmlNodePtr cur;
if (doc == NULL)
* Returns a pointer to the first child
*/
xmlNodePtr
-xmlStringLenGetNodeList(xmlDocPtr doc, const xmlChar *value, int len) {
+xmlStringLenGetNodeList(const xmlDoc *doc, const xmlChar *value, int len) {
xmlNodePtr ret = NULL, last = NULL;
xmlNodePtr node;
xmlChar *val;
* Returns a pointer to the first child
*/
xmlNodePtr
-xmlStringGetNodeList(xmlDocPtr doc, const xmlChar *value) {
+xmlStringGetNodeList(const xmlDoc *doc, const xmlChar *value) {
xmlNodePtr ret = NULL, last = NULL;
xmlNodePtr node;
xmlChar *val;
* Returns a pointer to the string copy, the caller must free it with xmlFree().
*/
xmlChar *
-xmlNodeListGetString(xmlDocPtr doc, xmlNodePtr list, int inLine)
+xmlNodeListGetString(xmlDocPtr doc, const xmlNode *list, int inLine)
{
- xmlNodePtr node = list;
+ const xmlNode *node = list;
xmlChar *ret = NULL;
xmlEntityPtr ent;
int attr;
* Returns a pointer to the string copy, the caller must free it with xmlFree().
*/
xmlChar *
-xmlNodeListGetRawString(xmlDocPtr doc, xmlNodePtr list, int inLine)
+xmlNodeListGetRawString(const xmlDoc *doc, const xmlNode *list, int inLine)
{
- xmlNodePtr node = list;
+ const xmlNode *node = list;
xmlChar *ret = NULL;
xmlEntityPtr ent;
* Returns a pointer to the new node object.
*/
xmlNodePtr
-xmlNewReference(xmlDocPtr doc, const xmlChar *name) {
+xmlNewReference(const xmlDoc *doc, const xmlChar *name) {
xmlNodePtr cur;
xmlEntityPtr ent;
memset(cur, 0, sizeof(xmlNode));
cur->type = XML_ENTITY_REF_NODE;
- cur->doc = doc;
+ cur->doc = (xmlDoc *)doc;
if (name[0] == '&') {
int len;
name++;
* Returns a pointer to the new node object.
*/
xmlNodePtr
-xmlNewDocText(xmlDocPtr doc, const xmlChar *content) {
+xmlNewDocText(const xmlDoc *doc, const xmlChar *content) {
xmlNodePtr cur;
cur = xmlNewText(content);
- if (cur != NULL) cur->doc = doc;
+ if (cur != NULL) cur->doc = (xmlDoc *)doc;
return(cur);
}
}
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \
- defined(LIBXML_SCHEMAS_ENABLED)
+ defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
/**
* xmlAddPrevSibling:
* @cur: the child node
* Returns the last child or NULL if none.
*/
xmlNodePtr
-xmlGetLastChild(xmlNodePtr parent) {
+xmlGetLastChild(const xmlNode *parent) {
if ((parent == NULL) || (parent->type == XML_NAMESPACE_DECL)) {
#ifdef DEBUG_TREE
xmlGenericError(xmlGenericErrorContext,
case XML_ELEMENT_NODE:
case XML_ENTITY_NODE:
case XML_DOCUMENT_NODE:
+ case XML_DOCUMENT_FRAG_NODE:
case XML_HTML_DOCUMENT_NODE:
cur = parent->children;
break;
case XML_ELEMENT_NODE:
case XML_ENTITY_NODE:
case XML_DOCUMENT_NODE:
+ case XML_DOCUMENT_FRAG_NODE:
case XML_HTML_DOCUMENT_NODE:
cur = parent->children;
break;
case XML_ELEMENT_NODE:
case XML_ENTITY_NODE:
case XML_DOCUMENT_NODE:
+ case XML_DOCUMENT_FRAG_NODE:
case XML_HTML_DOCUMENT_NODE:
cur = parent->last;
break;
*/
static xmlNodePtr
-xmlStaticCopyNode(const xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent,
+xmlStaticCopyNode(xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent,
int extended) {
xmlNodePtr ret;
}
if (doc->intSubset == NULL) {
q = (xmlNodePtr) xmlCopyDtd( (xmlDtdPtr) node );
+ if (q == NULL) return(NULL);
q->doc = doc;
q->parent = parent;
doc->intSubset = (xmlDtdPtr) q;
} else
#endif /* LIBXML_TREE_ENABLED */
q = xmlStaticCopyNode(node, doc, parent, 1);
+ if (q == NULL) return(NULL);
if (ret == NULL) {
q->prev = NULL;
ret = p = q;
* Returns: a new #xmlNodePtr, or NULL in case of error.
*/
xmlNodePtr
-xmlCopyNode(const xmlNodePtr node, int extended) {
+xmlCopyNode(xmlNodePtr node, int extended) {
xmlNodePtr ret;
ret = xmlStaticCopyNode(node, NULL, NULL, extended);
* Returns: a new #xmlNodePtr, or NULL in case of error.
*/
xmlNodePtr
-xmlDocCopyNode(const xmlNodePtr node, xmlDocPtr doc, int extended) {
+xmlDocCopyNode(xmlNodePtr node, xmlDocPtr doc, int extended) {
xmlNodePtr ret;
ret = xmlStaticCopyNode(node, doc, NULL, extended);
*
* Returns: a new #xmlNodePtr, or NULL in case of error.
*/
-xmlNodePtr xmlDocCopyNodeList(xmlDocPtr doc, const xmlNodePtr node) {
+xmlNodePtr xmlDocCopyNodeList(xmlDocPtr doc, xmlNodePtr node) {
xmlNodePtr ret = xmlStaticCopyNodeList(node, doc, NULL);
return(ret);
}
*
* Returns: a new #xmlNodePtr, or NULL in case of error.
*/
-xmlNodePtr xmlCopyNodeList(const xmlNodePtr node) {
+xmlNodePtr xmlCopyNodeList(xmlNodePtr node) {
xmlNodePtr ret = xmlStaticCopyNodeList(node, NULL, NULL);
return(ret);
}
#ifdef LIBXML_TREE_ENABLED
if (doc->intSubset != NULL) {
ret->intSubset = xmlCopyDtd(doc->intSubset);
+ if (ret->intSubset == NULL) {
+ xmlFreeDoc(ret);
+ return(NULL);
+ }
xmlSetTreeDoc((xmlNodePtr)ret->intSubset, ret);
ret->intSubset->parent = ret;
}
* Returns the line number if successful, -1 otherwise
*/
static long
-xmlGetLineNoInternal(xmlNodePtr node, int depth)
+xmlGetLineNoInternal(const xmlNode *node, int depth)
{
long result = -1;
* Returns the line number if successful, -1 otherwise
*/
long
-xmlGetLineNo(xmlNodePtr node)
+xmlGetLineNo(const xmlNode *node)
{
return(xmlGetLineNoInternal(node, 0));
}
* the returned string
*/
xmlChar *
-xmlGetNodePath(xmlNodePtr node)
+xmlGetNodePath(const xmlNode *node)
{
- xmlNodePtr cur, tmp, next;
+ const xmlNode *cur, *tmp, *next;
xmlChar *buffer = NULL, *temp;
size_t buf_len;
xmlChar *buf;
* Returns the #xmlNodePtr for the root or NULL
*/
xmlNodePtr
-xmlDocGetRootElement(xmlDocPtr doc) {
+xmlDocGetRootElement(const xmlDoc *doc) {
xmlNodePtr ret;
if (doc == NULL) return(NULL);
* It's up to the caller to free the memory with xmlFree().
*/
xmlChar *
-xmlNodeGetLang(xmlNodePtr cur) {
+xmlNodeGetLang(const xmlNode *cur) {
xmlChar *lang;
if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
* Returns -1 if xml:space is not inherited, 0 if "default", 1 if "preserve"
*/
int
-xmlNodeGetSpacePreserve(xmlNodePtr cur) {
+xmlNodeGetSpacePreserve(const xmlNode *cur) {
xmlChar *space;
if ((cur == NULL) || (cur->type != XML_ELEMENT_NODE))
xmlNodeSetName(xmlNodePtr cur, const xmlChar *name) {
xmlDocPtr doc;
xmlDictPtr dict;
+ const xmlChar *freeme = NULL;
if (cur == NULL) return;
if (name == NULL) return;
dict = NULL;
if (dict != NULL) {
if ((cur->name != NULL) && (!xmlDictOwns(dict, cur->name)))
- xmlFree((xmlChar *) cur->name);
+ freeme = cur->name;
cur->name = xmlDictLookup(dict, name, -1);
} else {
- if (cur->name != NULL) xmlFree((xmlChar *) cur->name);
+ if (cur->name != NULL)
+ freeme = cur->name;
cur->name = xmlStrdup(name);
}
+
+ if (freeme)
+ xmlFree((xmlChar *) freeme);
}
#endif
* It's up to the caller to free the memory with xmlFree().
*/
xmlChar *
-xmlNodeGetBase(xmlDocPtr doc, xmlNodePtr cur) {
+xmlNodeGetBase(const xmlDoc *doc, const xmlNode *cur) {
xmlChar *oldbase = NULL;
xmlChar *base, *newbase;
* Returns 0 in case of success and -1 in case of error.
*/
int
-xmlNodeBufGetContent(xmlBufferPtr buffer, xmlNodePtr cur)
+xmlNodeBufGetContent(xmlBufferPtr buffer, const xmlNode *cur)
{
xmlBufPtr buf;
int ret;
* directly by this node if it's a TEXT node or the aggregate string
* of the values carried by this node child's (TEXT and ENTITY_REF).
* Entity references are substituted.
- * Fills up the buffer @buffer with this value
+ * Fills up the buffer @buf with this value
*
* Returns 0 in case of success and -1 in case of error.
*/
int
-xmlBufGetNodeContent(xmlBufPtr buf, xmlNodePtr cur)
+xmlBufGetNodeContent(xmlBufPtr buf, const xmlNode *cur)
{
if ((cur == NULL) || (buf == NULL)) return(-1);
switch (cur->type) {
break;
case XML_DOCUMENT_FRAG_NODE:
case XML_ELEMENT_NODE:{
- xmlNodePtr tmp = cur;
+ const xmlNode *tmp = cur;
while (tmp != NULL) {
switch (tmp->type) {
* It's up to the caller to free the memory with xmlFree().
*/
xmlChar *
-xmlNodeGetContent(xmlNodePtr cur)
+xmlNodeGetContent(const xmlNode *cur)
{
if (cur == NULL)
return (NULL);
* namespace if defined
*/
xmlNsPtr *
-xmlGetNsList(xmlDocPtr doc ATTRIBUTE_UNUSED, xmlNodePtr node)
+xmlGetNsList(const xmlDoc *doc ATTRIBUTE_UNUSED, const xmlNode *node)
{
xmlNsPtr cur;
xmlNsPtr *ret = NULL;
xmlSearchNs(xmlDocPtr doc, xmlNodePtr node, const xmlChar *nameSpace) {
xmlNsPtr cur;
- xmlNodePtr orig = node;
+ const xmlNode *orig = node;
if ((node == NULL) || (node->type == XML_NAMESPACE_DECL)) return(NULL);
if ((nameSpace != NULL) &&
#endif /* LIBXML_TREE_ENABLED */
static xmlAttrPtr
-xmlGetPropNodeInternal(xmlNodePtr node, const xmlChar *name,
+xmlGetPropNodeInternal(const xmlNode *node, const xmlChar *name,
const xmlChar *nsName, int useDTD)
{
xmlAttrPtr prop;
}
static xmlChar*
-xmlGetPropNodeValueInternal(xmlAttrPtr prop)
+xmlGetPropNodeValueInternal(const xmlAttr *prop)
{
if (prop == NULL)
return(NULL);
* neither was found.
*/
xmlAttrPtr
-xmlHasProp(xmlNodePtr node, const xmlChar *name) {
+xmlHasProp(const xmlNode *node, const xmlChar *name) {
xmlAttrPtr prop;
xmlDocPtr doc;
* if neither was found.
*/
xmlAttrPtr
-xmlHasNsProp(xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace) {
+xmlHasNsProp(const xmlNode *node, const xmlChar *name, const xmlChar *nameSpace) {
return(xmlGetPropNodeInternal(node, name, nameSpace, xmlCheckDTD));
}
* It's up to the caller to free the memory with xmlFree().
*/
xmlChar *
-xmlGetProp(xmlNodePtr node, const xmlChar *name) {
+xmlGetProp(const xmlNode *node, const xmlChar *name) {
xmlAttrPtr prop;
prop = xmlHasProp(node, name);
* It's up to the caller to free the memory with xmlFree().
*/
xmlChar *
-xmlGetNoNsProp(xmlNodePtr node, const xmlChar *name) {
+xmlGetNoNsProp(const xmlNode *node, const xmlChar *name) {
xmlAttrPtr prop;
prop = xmlGetPropNodeInternal(node, name, NULL, xmlCheckDTD);
* It's up to the caller to free the memory with xmlFree().
*/
xmlChar *
-xmlGetNsProp(xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace) {
+xmlGetNsProp(const xmlNode *node, const xmlChar *name, const xmlChar *nameSpace) {
xmlAttrPtr prop;
prop = xmlGetPropNodeInternal(node, name, nameSpace, xmlCheckDTD);
* Returns 1 yes, 0 no
*/
int
-xmlNodeIsText(xmlNodePtr node) {
+xmlNodeIsText(const xmlNode *node) {
if (node == NULL) return(0);
if (node->type == XML_TEXT_NODE) return(1);
* Returns 1 yes, 0 no
*/
int
-xmlIsBlankNode(xmlNodePtr node) {
+xmlIsBlankNode(const xmlNode *node) {
const xmlChar *cur;
if (node == NULL) return(0);
*/
const xmlChar *
-xmlBufferContent(const xmlBufferPtr buf)
+xmlBufferContent(const xmlBuffer *buf)
{
if(!buf)
return NULL;
*/
int
-xmlBufferLength(const xmlBufferPtr buf)
+xmlBufferLength(const xmlBuffer *buf)
{
if(!buf)
return 0;
* Returns 0 (uncompressed) to 9 (max compression)
*/
int
-xmlGetDocCompressMode (xmlDocPtr doc) {
+xmlGetDocCompressMode (const xmlDoc *doc) {
if (doc == NULL) return(-1);
return(doc->compression);
}
map->first->prev = ret;
ret->next = map->first;
map->first = ret;
- } else
- return(NULL);
+ }
ret->oldNs = oldNs;
ret->newNs = newNs;
*
* Allocates and initializes a new DOM-wrapper context.
*
-* Returns the xmlDOMWrapCtxtPtr or NULL in case of an internal errror.
+* Returns the xmlDOMWrapCtxtPtr or NULL in case of an internal error.
*/
xmlDOMWrapCtxtPtr
xmlDOMWrapNewCtxt(void)
if (clone->parent != NULL)
clone->parent->last = clone;
clone = clone->parent;
- parentClone = clone->parent;
+ if (clone != NULL)
+ parentClone = clone->parent;
/*
* Process parent --> next;
*/
* References of out-of scope ns-decls are remapped to point to @destDoc:
* 1) If @destParent is given, then nsDef entries on element-nodes are used
* 2) If *no* @destParent is given, then @destDoc->oldNs entries are used
-* This is the case when you have an unliked node and just want to move it
+* This is the case when you have an unlinked node and just want to move it
* to the context of
*
* If @destParent is given, it ensures that the tree is namespace
#endif
#include <stddef.h>
-#ifdef HAVE_ERRNO_H
+#if defined( HAVE_ERRNO_H ) || defined( __VMS )
#include <errno.h>
#endif
# define TRIO_ERROR_RETURN(x,y) (-1)
#endif
+#ifndef VA_LIST_IS_ARRAY
+#define TRIO_VA_LIST_PTR va_list *
+#define TRIO_VA_LIST_ADDR(l) (&(l))
+#define TRIO_VA_LIST_DEREF(l) (*(l))
+#else
+#define TRIO_VA_LIST_PTR va_list
+#define TRIO_VA_LIST_ADDR(l) (l)
+#define TRIO_VA_LIST_DEREF(l) (l)
+#endif
+
typedef unsigned long trio_flags_t;
/*************************************************************************
* Platform specific definitions
*/
-#if defined(TRIO_PLATFORM_UNIX)
+#if defined(TRIO_PLATFORM_UNIX) || defined(TRIO_PLATFORM_OS400)
# include <unistd.h>
# include <signal.h>
# include <locale.h>
#endif
/* Maximal and fixed integer types */
-#if defined(TRIO_COMPILER_SUPPORTS_C99)
+#if defined(TRIO_COMPILER_SUPPORTS_C99) && !defined( __VMS )
# include <stdint.h>
typedef intmax_t trio_intmax_t;
typedef uintmax_t trio_uintmax_t;
typedef int16_t trio_int16_t;
typedef int32_t trio_int32_t;
typedef int64_t trio_int64_t;
-#elif defined(TRIO_COMPILER_SUPPORTS_UNIX98)
+#elif defined(TRIO_COMPILER_SUPPORTS_UNIX98) || defined( __VMS )
# include <inttypes.h>
+#ifdef __VMS
+typedef long long int intmax_t;
+typedef unsigned long long int uintmax_t;
+#endif
typedef intmax_t trio_intmax_t;
typedef uintmax_t trio_uintmax_t;
typedef int8_t trio_int8_t;
#define NAN_UPPER "NAN"
#if !defined(HAVE_ISASCII) && !defined(isascii)
-# define isascii(x) ((unsigned int)(x) < 128)
+#ifndef __VMS
+# define isascii(x) ((unsigned int)(x) < 128)
+#endif
#endif
/* Various constants */
int type,
TRIO_CONST char *format,
trio_parameter_t *parameters,
- va_list *arglist,
+ TRIO_VA_LIST_PTR arglist,
trio_pointer_t *argarray)
{
/* Count the number of times a parameter is referenced */
if (flags & FLAGS_WIDECHAR)
{
parameters[i].data.wstring = (argarray == NULL)
- ? va_arg(*arglist, trio_wchar_t *)
+ ? va_arg(TRIO_VA_LIST_DEREF(arglist), trio_wchar_t *)
: (trio_wchar_t *)(argarray[num]);
}
else
#endif
{
parameters[i].data.string = (argarray == NULL)
- ? va_arg(*arglist, char *)
+ ? va_arg(TRIO_VA_LIST_DEREF(arglist), char *)
: (char *)(argarray[num]);
}
break;
case FORMAT_COUNT:
case FORMAT_UNKNOWN:
parameters[i].data.pointer = (argarray == NULL)
- ? va_arg(*arglist, trio_pointer_t )
+ ? va_arg(TRIO_VA_LIST_DEREF(arglist), trio_pointer_t )
: argarray[num];
break;
{
if (argarray == NULL)
parameters[i].data.pointer =
- (trio_pointer_t)va_arg(*arglist, trio_pointer_t);
+ (trio_pointer_t)va_arg(TRIO_VA_LIST_DEREF(arglist), trio_pointer_t);
else
{
if (parameters[i].type == FORMAT_CHAR)
#if defined(QUALIFIER_SIZE_T) || defined(QUALIFIER_SIZE_T_UPPER)
if (parameters[i].flags & FLAGS_SIZE_T)
parameters[i].data.number.as_unsigned = (argarray == NULL)
- ? (trio_uintmax_t)va_arg(*arglist, size_t)
+ ? (trio_uintmax_t)va_arg(TRIO_VA_LIST_DEREF(arglist), size_t)
: (trio_uintmax_t)(*((size_t *)argarray[num]));
else
#endif
#if defined(QUALIFIER_PTRDIFF_T)
if (parameters[i].flags & FLAGS_PTRDIFF_T)
parameters[i].data.number.as_unsigned = (argarray == NULL)
- ? (trio_uintmax_t)va_arg(*arglist, ptrdiff_t)
+ ? (trio_uintmax_t)va_arg(TRIO_VA_LIST_DEREF(arglist), ptrdiff_t)
: (trio_uintmax_t)(*((ptrdiff_t *)argarray[num]));
else
#endif
#if defined(QUALIFIER_INTMAX_T)
if (parameters[i].flags & FLAGS_INTMAX_T)
parameters[i].data.number.as_unsigned = (argarray == NULL)
- ? (trio_uintmax_t)va_arg(*arglist, trio_intmax_t)
+ ? (trio_uintmax_t)va_arg(TRIO_VA_LIST_DEREF(arglist), trio_intmax_t)
: (trio_uintmax_t)(*((trio_intmax_t *)argarray[num]));
else
#endif
if (parameters[i].flags & FLAGS_QUAD)
parameters[i].data.number.as_unsigned = (argarray == NULL)
- ? (trio_uintmax_t)va_arg(*arglist, trio_ulonglong_t)
+ ? (trio_uintmax_t)va_arg(TRIO_VA_LIST_DEREF(arglist), trio_ulonglong_t)
: (trio_uintmax_t)(*((trio_ulonglong_t *)argarray[num]));
else if (parameters[i].flags & FLAGS_LONG)
parameters[i].data.number.as_unsigned = (argarray == NULL)
- ? (trio_uintmax_t)va_arg(*arglist, long)
+ ? (trio_uintmax_t)va_arg(TRIO_VA_LIST_DEREF(arglist), long)
: (trio_uintmax_t)(*((long *)argarray[num]));
else
{
if (argarray == NULL)
- parameters[i].data.number.as_unsigned = (trio_uintmax_t)va_arg(*arglist, int);
+ parameters[i].data.number.as_unsigned = (trio_uintmax_t)va_arg(TRIO_VA_LIST_DEREF(arglist), int);
else
{
if (parameters[i].type == FORMAT_CHAR)
*/
if (parameters[i].flags & FLAGS_USER_DEFINED)
parameters[i].data.pointer = (argarray == NULL)
- ? va_arg(*arglist, trio_pointer_t )
+ ? va_arg(TRIO_VA_LIST_DEREF(arglist), trio_pointer_t )
: argarray[num];
else
parameters[i].data.number.as_unsigned = (argarray == NULL)
- ? (trio_uintmax_t)va_arg(*arglist, int)
+ ? (trio_uintmax_t)va_arg(TRIO_VA_LIST_DEREF(arglist), int)
: (trio_uintmax_t)(*((int *)argarray[num]));
break;
{
if (parameters[i].flags & FLAGS_LONGDOUBLE)
parameters[i].data.longdoublePointer = (argarray == NULL)
- ? va_arg(*arglist, trio_long_double_t *)
+ ? va_arg(TRIO_VA_LIST_DEREF(arglist), trio_long_double_t *)
: (trio_long_double_t *)argarray[num];
else
{
if (parameters[i].flags & FLAGS_LONG)
parameters[i].data.doublePointer = (argarray == NULL)
- ? va_arg(*arglist, double *)
+ ? va_arg(TRIO_VA_LIST_DEREF(arglist), double *)
: (double *)argarray[num];
else
parameters[i].data.doublePointer = (argarray == NULL)
- ? (double *)va_arg(*arglist, float *)
+ ? (double *)va_arg(TRIO_VA_LIST_DEREF(arglist), float *)
: (double *)((float *)argarray[num]);
}
}
{
if (parameters[i].flags & FLAGS_LONGDOUBLE)
parameters[i].data.longdoubleNumber = (argarray == NULL)
- ? va_arg(*arglist, trio_long_double_t)
+ ? va_arg(TRIO_VA_LIST_DEREF(arglist), trio_long_double_t)
: (trio_long_double_t)(*((trio_long_double_t *)argarray[num]));
else
{
if (argarray == NULL)
parameters[i].data.longdoubleNumber =
- (trio_long_double_t)va_arg(*arglist, double);
+ (trio_long_double_t)va_arg(TRIO_VA_LIST_DEREF(arglist), double);
else
{
if (parameters[i].flags & FLAGS_SHORT)
TRIO_ARGS4((reference, format, arglist, argarray),
trio_reference_t *reference,
TRIO_CONST char *format,
- va_list *arglist,
+ TRIO_VA_LIST_PTR arglist,
trio_pointer_t *argarray)
{
int status;
size_t destinationSize,
void (*OutStream) TRIO_PROTO((trio_class_t *, int)),
TRIO_CONST char *format,
- va_list *arglist,
+ TRIO_VA_LIST_PTR arglist,
trio_pointer_t *argarray)
{
int status;
assert(VALID(format));
TRIO_VA_START(args, format);
- status = TrioFormat(stdout, 0, TrioOutStreamFile, format, &args, NULL);
+ status = TrioFormat(stdout, 0, TrioOutStreamFile, format, TRIO_VA_LIST_ADDR(args), NULL);
TRIO_VA_END(args);
return status;
}
{
assert(VALID(format));
- return TrioFormat(stdout, 0, TrioOutStreamFile, format, &args, NULL);
+ return TrioFormat(stdout, 0, TrioOutStreamFile, format, TRIO_VA_LIST_ADDR(args), NULL);
}
/**
assert(VALID(format));
TRIO_VA_START(args, format);
- status = TrioFormat(file, 0, TrioOutStreamFile, format, &args, NULL);
+ status = TrioFormat(file, 0, TrioOutStreamFile, format, TRIO_VA_LIST_ADDR(args), NULL);
TRIO_VA_END(args);
return status;
}
assert(VALID(file));
assert(VALID(format));
- return TrioFormat(file, 0, TrioOutStreamFile, format, &args, NULL);
+ return TrioFormat(file, 0, TrioOutStreamFile, format, TRIO_VA_LIST_ADDR(args), NULL);
}
/**
assert(VALID(format));
TRIO_VA_START(args, format);
- status = TrioFormat(&fd, 0, TrioOutStreamFileDescriptor, format, &args, NULL);
+ status = TrioFormat(&fd, 0, TrioOutStreamFileDescriptor, format, TRIO_VA_LIST_ADDR(args), NULL);
TRIO_VA_END(args);
return status;
}
{
assert(VALID(format));
- return TrioFormat(&fd, 0, TrioOutStreamFileDescriptor, format, &args, NULL);
+ return TrioFormat(&fd, 0, TrioOutStreamFileDescriptor, format, TRIO_VA_LIST_ADDR(args), NULL);
}
/**
TRIO_VA_START(args, format);
data.stream.out = stream;
data.closure = closure;
- status = TrioFormat(&data, 0, TrioOutStreamCustom, format, &args, NULL);
+ status = TrioFormat(&data, 0, TrioOutStreamCustom, format, TRIO_VA_LIST_ADDR(args), NULL);
TRIO_VA_END(args);
return status;
}
data.stream.out = stream;
data.closure = closure;
- return TrioFormat(&data, 0, TrioOutStreamCustom, format, &args, NULL);
+ return TrioFormat(&data, 0, TrioOutStreamCustom, format, TRIO_VA_LIST_ADDR(args), NULL);
}
TRIO_PUBLIC int
assert(VALID(format));
TRIO_VA_START(args, format);
- status = TrioFormat(&buffer, 0, TrioOutStreamString, format, &args, NULL);
+ status = TrioFormat(&buffer, 0, TrioOutStreamString, format, TRIO_VA_LIST_ADDR(args), NULL);
*buffer = NIL; /* Terminate with NIL character */
TRIO_VA_END(args);
return status;
assert(VALID(buffer));
assert(VALID(format));
- status = TrioFormat(&buffer, 0, TrioOutStreamString, format, &args, NULL);
+ status = TrioFormat(&buffer, 0, TrioOutStreamString, format, TRIO_VA_LIST_ADDR(args), NULL);
*buffer = NIL;
return status;
}
TRIO_VA_START(args, format);
status = TrioFormat(&buffer, max > 0 ? max - 1 : 0,
- TrioOutStreamStringMax, format, &args, NULL);
+ TrioOutStreamStringMax, format, TRIO_VA_LIST_ADDR(args), NULL);
if (max > 0)
*buffer = NIL;
TRIO_VA_END(args);
assert(VALID(format));
status = TrioFormat(&buffer, max > 0 ? max - 1 : 0,
- TrioOutStreamStringMax, format, &args, NULL);
+ TrioOutStreamStringMax, format, TRIO_VA_LIST_ADDR(args), NULL);
if (max > 0)
*buffer = NIL;
return status;
buffer = &buffer[buf_len];
status = TrioFormat(&buffer, max - 1 - buf_len,
- TrioOutStreamStringMax, format, &args, NULL);
+ TrioOutStreamStringMax, format, TRIO_VA_LIST_ADDR(args), NULL);
TRIO_VA_END(args);
*buffer = NIL;
return status;
buf_len = trio_length(buffer);
buffer = &buffer[buf_len];
status = TrioFormat(&buffer, max - 1 - buf_len,
- TrioOutStreamStringMax, format, &args, NULL);
+ TrioOutStreamStringMax, format, TRIO_VA_LIST_ADDR(args), NULL);
*buffer = NIL;
return status;
}
{
TRIO_VA_START(args, format);
(void)TrioFormat(info, 0, TrioOutStreamStringDynamic,
- format, &args, NULL);
+ format, TRIO_VA_LIST_ADDR(args), NULL);
TRIO_VA_END(args);
trio_string_terminate(info);
if (info)
{
(void)TrioFormat(info, 0, TrioOutStreamStringDynamic,
- format, &args, NULL);
+ format, TRIO_VA_LIST_ADDR(args), NULL);
trio_string_terminate(info);
result = trio_string_extract(info);
trio_string_destroy(info);
{
TRIO_VA_START(args, format);
status = TrioFormat(info, 0, TrioOutStreamStringDynamic,
- format, &args, NULL);
+ format, TRIO_VA_LIST_ADDR(args), NULL);
TRIO_VA_END(args);
if (status >= 0)
{
else
{
status = TrioFormat(info, 0, TrioOutStreamStringDynamic,
- format, &args, NULL);
+ format, TRIO_VA_LIST_ADDR(args), NULL);
if (status >= 0)
{
trio_string_terminate(info);
assert(VALID(format));
TRIO_VA_START(arglist, format);
- status = TrioFormatRef((trio_reference_t *)ref, format, &arglist, NULL);
+ status = TrioFormatRef((trio_reference_t *)ref, format, TRIO_VA_LIST_ADDR(arglist), NULL);
TRIO_VA_END(arglist);
return status;
}
{
assert(VALID(format));
- return TrioFormatRef((trio_reference_t *)ref, format, &arglist, NULL);
+ return TrioFormatRef((trio_reference_t *)ref, format, TRIO_VA_LIST_ADDR(arglist), NULL);
}
/*************************************************************************
size_t sourceSize,
void (*InStream) TRIO_PROTO((trio_class_t *, int *)),
TRIO_CONST char *format,
- va_list *arglist,
+ TRIO_VA_LIST_PTR arglist,
trio_pointer_t *argarray)
{
int status;
trio_class_t *self,
int *intPointer)
{
- FILE *file = (FILE *)self->location;
+ FILE *file;
assert(VALID(self));
+ assert(VALID(self->location));
assert(VALID(file));
+ file = (FILE *)self->location;
+
self->current = fgetc(file);
if (self->current == EOF)
{
trio_class_t *self,
int *intPointer)
{
- int fd = *((int *)self->location);
+ int fd;
int size;
unsigned char input;
assert(VALID(self));
+ assert(VALID(self->location));
+
+ fd = *((int *)self->location);
size = read(fd, &input, sizeof(char));
if (size == -1)
TRIO_VA_START(args, format);
status = TrioScan((trio_pointer_t)stdin, 0,
TrioInStreamFile,
- format, &args, NULL);
+ format, TRIO_VA_LIST_ADDR(args), NULL);
TRIO_VA_END(args);
return status;
}
return TrioScan((trio_pointer_t)stdin, 0,
TrioInStreamFile,
- format, &args, NULL);
+ format, TRIO_VA_LIST_ADDR(args), NULL);
}
TRIO_PUBLIC int
TRIO_VA_START(args, format);
status = TrioScan((trio_pointer_t)file, 0,
TrioInStreamFile,
- format, &args, NULL);
+ format, TRIO_VA_LIST_ADDR(args), NULL);
TRIO_VA_END(args);
return status;
}
return TrioScan((trio_pointer_t)file, 0,
TrioInStreamFile,
- format, &args, NULL);
+ format, TRIO_VA_LIST_ADDR(args), NULL);
}
TRIO_PUBLIC int
TRIO_VA_START(args, format);
status = TrioScan((trio_pointer_t)&fd, 0,
TrioInStreamFileDescriptor,
- format, &args, NULL);
+ format, TRIO_VA_LIST_ADDR(args), NULL);
TRIO_VA_END(args);
return status;
}
return TrioScan((trio_pointer_t)&fd, 0,
TrioInStreamFileDescriptor,
- format, &args, NULL);
+ format, TRIO_VA_LIST_ADDR(args), NULL);
}
TRIO_PUBLIC int
TRIO_VA_START(args, format);
data.stream.in = stream;
data.closure = closure;
- status = TrioScan(&data, 0, TrioInStreamCustom, format, &args, NULL);
+ status = TrioScan(&data, 0, TrioInStreamCustom, format, TRIO_VA_LIST_ADDR(args), NULL);
TRIO_VA_END(args);
return status;
}
data.stream.in = stream;
data.closure = closure;
- return TrioScan(&data, 0, TrioInStreamCustom, format, &args, NULL);
+ return TrioScan(&data, 0, TrioInStreamCustom, format, TRIO_VA_LIST_ADDR(args), NULL);
}
TRIO_PUBLIC int
TRIO_VA_START(args, format);
status = TrioScan((trio_pointer_t)&buffer, 0,
TrioInStreamString,
- format, &args, NULL);
+ format, TRIO_VA_LIST_ADDR(args), NULL);
TRIO_VA_END(args);
return status;
}
return TrioScan((trio_pointer_t)&buffer, 0,
TrioInStreamString,
- format, &args, NULL);
+ format, TRIO_VA_LIST_ADDR(args), NULL);
}
TRIO_PUBLIC int
#ifdef TRIO_REPLACE_STDIO
/* Replace the <stdio.h> functions */
#ifndef HAVE_PRINTF
+# undef printf
# define printf trio_printf
#endif
#ifndef HAVE_VPRINTF
+# undef vprintf
# define vprintf trio_vprintf
#endif
#ifndef HAVE_FPRINTF
+# undef fprintf
# define fprintf trio_fprintf
#endif
#ifndef HAVE_VFPRINTF
+# undef vfprintf
# define vfprintf trio_vfprintf
#endif
#ifndef HAVE_SPRINTF
+# undef sprintf
# define sprintf trio_sprintf
#endif
#ifndef HAVE_VSPRINTF
+# undef vsprintf
# define vsprintf trio_vsprintf
#endif
#ifndef HAVE_SNPRINTF
+# undef snprintf
# define snprintf trio_snprintf
#endif
#ifndef HAVE_VSNPRINTF
+# undef vsnprintf
# define vsnprintf trio_vsnprintf
#endif
#ifndef HAVE_SCANF
+# undef scanf
# define scanf trio_scanf
#endif
#ifndef HAVE_VSCANF
+# undef vscanf
# define vscanf trio_vscanf
#endif
#ifndef HAVE_FSCANF
+# undef fscanf
# define fscanf trio_fscanf
#endif
#ifndef HAVE_VFSCANF
+# undef vfscanf
# define vfscanf trio_vfscanf
#endif
#ifndef HAVE_SSCANF
+# undef sscanf
# define sscanf trio_sscanf
#endif
#ifndef HAVE_VSSCANF
+# undef vsscanf
# define vsscanf trio_vsscanf
#endif
/* These aren't stdio functions, but we make them look similar */
* based on the DECC compiler later on.
*/
# define TRIO_PLATFORM_VMS
+#elif defined(__OS400__)
+# define TRIO_PLATFORM_OS400
#elif defined(unix) || defined(__unix) || defined(__unix__)
# define TRIO_PLATFORM_UNIX
#elif defined(TRIO_COMPILER_XLC) || defined(_AIX)
# define TRIO_COMPILER_SUPPORTS_C94
# endif
# endif
+#elif defined(TRIO_COMPILER_XLC) && defined(__EXTENDED__)
+# define TRIO_COMPILER_SUPPORTS_C89
+# define TRIO_COMPILER_SUPPORTS_C90
+# define TRIO_COMPILER_SUPPORTS_C94
#endif
#if defined(_XOPEN_SOURCE)
# define BOOLEAN_T int
#endif
-#if defined(TRIO_COMPILER_SUPPORTS_C99)
+#ifdef __VMS
+# define USE_STRTOD
+#elif defined(TRIO_COMPILER_SUPPORTS_C99)
# define USE_STRTOD
# define USE_STRTOF
#elif defined(TRIO_COMPILER_MSVC)
# else
# define strcasecmp(x,y) strcmpi(x,y)
# endif
+#elif defined(TRIO_PLATFORM_OS400)
+# define USE_STRCASECMP
+# define USE_STRNCASECMP
+# include <strings.h>
#endif
#if !(defined(TRIO_PLATFORM_SUNOS))
cur += 2;
ret = xmlParse3986Authority(uri, &cur);
if (ret != 0) return(ret);
+ if (uri->server == NULL)
+ uri->port = -1;
ret = xmlParse3986PathAbEmpty(uri, &cur);
if (ret != 0) return(ret);
*str = cur;
}
}
} else {
- if (uri->server != NULL) {
+ if ((uri->server != NULL) || (uri->port == -1)) {
if (len + 3 >= max) {
temp = xmlSaveUriRealloc(ret, &max);
if (temp == NULL) goto mem_error;
}
ret[len++] = '@';
}
- p = uri->server;
- while (*p != 0) {
- if (len >= max) {
- temp = xmlSaveUriRealloc(ret, &max);
- if (temp == NULL) goto mem_error;
- ret = temp;
+ if (uri->server != NULL) {
+ p = uri->server;
+ while (*p != 0) {
+ if (len >= max) {
+ temp = xmlSaveUriRealloc(ret, &max);
+ if (temp == NULL) goto mem_error;
+ ret = temp;
+ }
+ ret[len++] = *p++;
}
- ret[len++] = *p++;
- }
- if (uri->port > 0) {
- if (len + 10 >= max) {
- temp = xmlSaveUriRealloc(ret, &max);
- if (temp == NULL) goto mem_error;
- ret = temp;
+ if (uri->port > 0) {
+ if (len + 10 >= max) {
+ temp = xmlSaveUriRealloc(ret, &max);
+ if (temp == NULL) goto mem_error;
+ ret = temp;
+ }
+ len += snprintf((char *) &ret[len], max - len, ":%d", uri->port);
}
- len += snprintf((char *) &ret[len], max - len, ":%d", uri->port);
}
} else if (uri->authority != NULL) {
if (len + 3 >= max) {
if (temp == NULL) goto mem_error;
ret = temp;
}
- ret[len++] = '/';
- ret[len++] = '/';
}
if (uri->path != NULL) {
p = uri->path;
if (cur == NULL) return(NULL);
ret = xmlCreateEnumeration((xmlChar *) cur->name);
+ if (ret == NULL) return(NULL);
if (cur->next != NULL) ret->next = xmlCopyEnumeration(cur->next);
else ret->next = NULL;
/*
* The id is already defined in this DTD.
*/
- if ((ctxt != NULL) && (ctxt->error != NULL)) {
- xmlErrValidNode(ctxt, attr->parent, XML_DTD_ID_REDEFINED,
- "ID %s already defined\n",
- value, NULL, NULL);
- }
+ xmlErrValidNode(ctxt, attr->parent, XML_DTD_ID_REDEFINED,
+ "ID %s already defined\n", value, NULL, NULL);
#endif /* LIBXML_VALID_ENABLED */
xmlFreeID(ret);
return(NULL);
if (doc == NULL) return(-1);
if (attr == NULL) return(-1);
+
table = (xmlIDTablePtr) doc->ids;
if (table == NULL)
return(-1);
- if (attr == NULL)
- return(-1);
ID = xmlNodeListGetString(doc, attr->children, 1);
if (ID == NULL)
- return(-1);
+ return(-1);
+
id = xmlHashLookup(table, ID);
if (id == NULL || id->attr != attr) {
- xmlFree(ID);
- return(-1);
+ xmlFree(ID);
+ return(-1);
}
+
xmlHashRemoveEntry(table, ID, (xmlHashDeallocator) xmlFreeID);
xmlFree(ID);
- attr->atype = 0;
+ attr->atype = 0;
return(0);
}
if (doc == NULL) return(-1);
if (attr == NULL) return(-1);
+
table = (xmlRefTablePtr) doc->refs;
if (table == NULL)
return(-1);
- if (attr == NULL)
- return(-1);
ID = xmlNodeListGetString(doc, attr->children, 1);
if (ID == NULL)
return(-1);
- ref_list = xmlHashLookup(table, ID);
+ ref_list = xmlHashLookup(table, ID);
if(ref_list == NULL) {
xmlFree(ID);
return (-1);
}
+
/* At this point, ref_list refers to a list of references which
* have the same key as the supplied attr. Our list of references
* is ordered by reference address and we don't have that information
xmlElementContentPtr cont;
const xmlChar *name;
- if ((elemDecl == NULL) || (parent == NULL))
+ if ((elemDecl == NULL) || (parent == NULL) || (ctxt == NULL))
return(-1);
cont = elemDecl->content;
name = elemDecl->name;
int max) {
xmlValidCtxt vctxt;
int nb_valid_elements = 0;
- const xmlChar *elements[256];
+ const xmlChar *elements[256]={0};
int nb_elements = 0, i;
const xmlChar *name;
* Creates a dummy node and insert it into the tree
*/
test_node = xmlNewDocNode (ref_node->doc, NULL, BAD_CAST "<!dummy?>", NULL);
+ if (test_node == NULL)
+ return(-1);
+
test_node->parent = parent;
test_node->prev = prev;
test_node->next = next;
#include <libxml/tree.h>
#include <libxml/parser.h>
#include <libxml/uri.h>
+#include <libxml/xpath.h>
#include <libxml/xpointer.h>
#include <libxml/parserInternals.h>
#include <libxml/xmlerror.h>
}
break;
}
+#ifdef LIBXML_XPTR_ENABLED
case XPATH_LOCATIONSET: {
xmlLocationSetPtr set = (xmlLocationSetPtr) obj->user;
if (set == NULL)
}
break;
}
-#ifdef LIBXML_XPTR_ENABLED
case XPATH_RANGE:
return(xmlXIncludeCopyRange(ctxt, target, source, obj));
#endif
/*
* Do the xml:base fixup if needed
*/
- if ((doc != NULL) && (URL != NULL) && (xmlStrchr(URL, (xmlChar) '/')) &&
+ if ((doc != NULL) && (URL != NULL) &&
(!(ctxt->parseFlags & XML_PARSE_NOBASEFIX)) &&
(!(doc->parseFlags & XML_PARSE_NOBASEFIX))) {
xmlNodePtr node;
if (type != NULL) {
if (xmlStrEqual(type, BAD_CAST "simple")) {
ret = XLINK_TYPE_SIMPLE;
- } if (xmlStrEqual(type, BAD_CAST "extended")) {
+ } else if (xmlStrEqual(type, BAD_CAST "extended")) {
role = xmlGetNsProp(node, BAD_CAST "role", XLINK_NAMESPACE);
if (role != NULL) {
xmlNsPtr xlink;
return 1;
}
+/**
+ * xmlNop:
+ *
+ * No Operation function, does nothing, no input
+ *
+ * Returns zero
+ */
int
xmlNop(void) {
return(0);
*/
static void *
xmlFileOpen_real (const char *filename) {
- const char *path = NULL;
+ const char *path = filename;
FILE *fd;
if (filename == NULL)
#else
path = &filename[5];
#endif
- } else
- path = filename;
+ }
- if (path == NULL)
- return(NULL);
if (!xmlCheckFilename(path))
return(NULL);
gzFile fd;
if (!strcmp(filename, "-")) {
- fd = gzdopen(dup(0), "rb");
+ int duped_fd = dup(fileno(stdin));
+ fd = gzdopen(duped_fd, "rb");
+ if (fd == Z_NULL && duped_fd >= 0) {
+ close(duped_fd); /* gzdOpen() does not close on failure */
+ }
+
return((void *) fd);
}
snprintf(mode, sizeof(mode), "wb%d", compression);
if (!strcmp(filename, "-")) {
- fd = gzdopen(dup(1), mode);
+ int duped_fd = dup(fileno(stdout));
+ fd = gzdopen(duped_fd, "rb");
+ if (fd == Z_NULL && duped_fd >= 0) {
+ close(duped_fd); /* gzdOpen() does not close on failure */
+ }
+
return((void *) fd);
}
xzFile fd;
if (!strcmp(filename, "-")) {
- fd = __libxml2_xzdopen(dup(0), "rb");
+ fd = __libxml2_xzdopen(dup(fileno(stdin)), "rb");
return((void *) fd);
}
}
#endif
}
+#endif
+#ifdef HAVE_LZMA_H
+ if ((xmlInputCallbackTable[i].opencallback == xmlXzfileOpen) &&
+ (strcmp(URI, "-") != 0)) {
+ ret->compressed = __libxml2_xzcompressed(context);
+ }
#endif
}
else
if (res < 0) {
return(-1);
}
+
+ /*
+ * try to establish compressed status of input if not done already
+ */
+ if (in->compressed == -1) {
+#ifdef HAVE_LZMA_H
+ if (in->readcallback == xmlXzfileRead)
+ in->compressed = __libxml2_xzcompressed(in->context);
+#endif
+ }
+
len = res;
if (in->encoder != NULL) {
unsigned int use;
/*
* start interpreting the command
*/
- if (!strcmp(command, "exit"))
- break;
- if (!strcmp(command, "quit"))
- break;
- if (!strcmp(command, "bye"))
+ if (!strcmp(command, "exit") ||
+ !strcmp(command, "quit") ||
+ !strcmp(command, "bye")) {
+ free(cmdline);
break;
+ }
+
if (!strcmp(command, "public")) {
if (nbargs != 1) {
printf("public requires 1 arguments\n");
if ((fd = open(filename, O_RDONLY)) < 0)
return;
base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ;
- if (base == (void *) MAP_FAILED)
+ if (base == (void *) MAP_FAILED) {
+ close(fd);
+ fprintf(stderr, "mmap failure for file %s\n", filename);
+ progresult = XMLLINT_ERR_RDFILE;
return;
+ }
reader = xmlReaderForMemory(base, info.st_size, filename,
NULL, options);
#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
f = fopen(filename, "rb");
+#elif defined(__OS400__)
+ f = fopen(filename, "rb");
#else
f = fopen(filename, "r");
#endif
if (res > 0) {
ctxt = htmlCreatePushParserCtxt(NULL, NULL,
chars, res, filename, XML_CHAR_ENCODING_NONE);
+ xmlCtxtUseOptions(ctxt, options);
while ((res = fread(chars, 1, pushsize, f)) > 0) {
htmlParseChunk(ctxt, chars, res, 0);
}
if ((fd = open(filename, O_RDONLY)) < 0)
return;
base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ;
- if (base == (void *) MAP_FAILED)
+ if (base == (void *) MAP_FAILED) {
+ close(fd);
+ fprintf(stderr, "mmap failure for file %s\n", filename);
+ progresult = XMLLINT_ERR_RDFILE;
return;
+ }
doc = htmlReadMemory((char *) base, info.st_size, filename,
NULL, options);
} else {
#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
f = fopen(filename, "rb");
+#elif defined(__OS400__)
+ f = fopen(filename, "rb");
#else
f = fopen(filename, "r");
#endif
#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
f = fopen(filename, "rb");
+#elif defined(__OS400__)
+ f = fopen(filename, "rb");
#else
f = fopen(filename, "r");
#endif
if ((fd = open(filename, O_RDONLY)) < 0)
return;
base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ;
- if (base == (void *) MAP_FAILED)
+ if (base == (void *) MAP_FAILED) {
+ close(fd);
+ fprintf(stderr, "mmap failure for file %s\n", filename);
+ progresult = XMLLINT_ERR_RDFILE;
return;
+ }
if (rectxt == NULL)
doc = xmlReadMemory((char *) base, info.st_size,
fprintf(stderr, "Failed to canonicalize\n");
progresult = XMLLINT_ERR_OUT;
}
- } else if (canonical) {
+ } else if (canonical_11) {
xmlChar *result = NULL;
int size;
printf("\t--noenc : ignore any encoding specified inside the document\n");
printf("\t--noout : don't output the result tree\n");
printf("\t--path 'paths': provide a set of paths for resources\n");
- printf("\t--load-trace : print trace of all external entites loaded\n");
+ printf("\t--load-trace : print trace of all external entities loaded\n");
printf("\t--nonet : refuse to fetch DTDs or entities over network\n");
printf("\t--nocompact : do not generate compact text nodes\n");
printf("\t--htmlout : output results as HTML\n");
static void registerNode(xmlNodePtr node)
{
node->_private = malloc(sizeof(long));
+ if (node->_private == NULL) {
+ fprintf(stderr, "Out of memory in xmllint:registerNode()\n");
+ exit(XMLLINT_ERR_MEM);
+ }
*(long*)node->_private = (long) 0x81726354;
nbregister++;
}
(!strcmp(argv[i], "--pretty"))) {
i++;
#ifdef LIBXML_OUTPUT_ENABLED
- format = atoi(argv[i]);
- if (format == 1) {
- noblanks++;
- xmlKeepBlanksDefault(0);
- }
+ if (argv[i] != NULL) {
+ format = atoi(argv[i]);
+ if (format == 1) {
+ noblanks++;
+ xmlKeepBlanksDefault(0);
+ }
+ }
#endif /* LIBXML_OUTPUT_ENABLED */
}
#ifdef LIBXML_READER_ENABLED
void *
xmlReallocLoc(void *ptr,size_t size, const char * file, int line)
{
- MEMHDR *p;
+ MEMHDR *p, *tmp;
unsigned long number;
#ifdef DEBUG_MEMORY
size_t oldsize;
#endif
xmlMutexUnlock(xmlMemMutex);
- p = (MEMHDR *) realloc(p,RESERVE_SIZE+size);
- if (!p) {
+ tmp = (MEMHDR *) realloc(p,RESERVE_SIZE+size);
+ if (!tmp) {
+ free(p);
goto error;
}
+ p = tmp;
if (xmlMemTraceBlockAt == ptr) {
xmlGenericError(xmlGenericErrorContext,
"%p : Realloced(%lu -> %lu) Ok\n",
if (xmlMemStopAtBlock == p->mh_number) xmlMallocBreakpoint();
- if (s != NULL)
- strcpy(s,str);
- else
- goto error;
+ strcpy(s,str);
TEST_POINT
static void
xmlMemContentShow(FILE *fp, MEMHDR *p)
{
- int i,j,k,len = p->mh_size;
- const char *buf = (const char *) HDR_2_CLIENT(p);
+ int i,j,k,len;
+ const char *buf;
if (p == NULL) {
fprintf(fp, " NULL");
return;
}
+ len = p->mh_size;
+ buf = (const char *) HDR_2_CLIENT(p);
for (i = 0;i < len;i++) {
if (buf[i] == 0) break;
{
int rc = -1;
- if ((NULL == module) || (symbol == NULL)) {
+ if ((NULL == module) || (symbol == NULL) || (name == NULL)) {
__xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_MODULE,
XML_MODULE_OPEN, XML_ERR_FATAL, NULL, 0, 0,
NULL, NULL, 0, 0, "null parameter\n");
/*
* The following VA_COPY was coded following an example in
* the Samba project. It may not be sufficient for some
- * esoteric implementations of va_list (i.e. it may need
- * something involving a memcpy) but (hopefully) will be
- * sufficient for libxml2.
+ * esoteric implementations of va_list but (hopefully) will
+ * be sufficient for libxml2.
*/
#ifndef VA_COPY
#ifdef HAVE_VA_COPY
#ifdef HAVE___VA_COPY
#define VA_COPY(dest,src) __va_copy(dest, src)
#else
- #define VA_COPY(dest,src) (dest) = (src)
+ #ifndef VA_LIST_IS_ARRAY
+ #define VA_COPY(dest,src) (dest) = (src)
+ #else
+ #include <string.h>
+ #define VA_COPY(dest,src) memcpy((char *)(dest),(char *)(src),sizeof(va_list))
+ #endif
#endif
#endif
#endif
xmlTextReaderFreeProp(xmlTextReaderPtr reader, xmlAttrPtr cur) {
xmlDictPtr dict;
- dict = reader->ctxt->dict;
+ if ((reader != NULL) && (reader->ctxt != NULL))
+ dict = reader->ctxt->dict;
+ else
+ dict = NULL;
if (cur == NULL) return;
if ((__xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
static void
xmlTextReaderFreePropList(xmlTextReaderPtr reader, xmlAttrPtr cur) {
xmlAttrPtr next;
- if (cur == NULL) return;
+
while (cur != NULL) {
next = cur->next;
xmlTextReaderFreeProp(reader, cur);
xmlNodePtr next;
xmlDictPtr dict;
- dict = reader->ctxt->dict;
+ if ((reader != NULL) && (reader->ctxt != NULL))
+ dict = reader->ctxt->dict;
+ else
+ dict = NULL;
if (cur == NULL) return;
if (cur->type == XML_NAMESPACE_DECL) {
xmlFreeNsList((xmlNsPtr) cur);
xmlTextReaderFreeNode(xmlTextReaderPtr reader, xmlNodePtr cur) {
xmlDictPtr dict;
- dict = reader->ctxt->dict;
+ if ((reader != NULL) && (reader->ctxt != NULL))
+ dict = reader->ctxt->dict;
+ else
+ dict = NULL;
if (cur->type == XML_DTD_NODE) {
xmlFreeDtd((xmlDtdPtr) cur);
return;
goto node_found;
}
#ifdef LIBXML_REGEXP_ENABLED
- if ((reader->validate) && (reader->node->type == XML_ELEMENT_NODE))
+ if ((reader->validate != XML_TEXTREADER_NOT_VALIDATE) && (reader->node->type == XML_ELEMENT_NODE))
xmlTextReaderValidatePop(reader);
#endif /* LIBXML_REGEXP_ENABLED */
if ((reader->preserves > 0) &&
goto get_next_node;
}
#ifdef LIBXML_REGEXP_ENABLED
- if ((reader->validate) && (reader->node != NULL)) {
+ if ((reader->validate != XML_TEXTREADER_NOT_VALIDATE) && (reader->node != NULL)) {
xmlNodePtr node = reader->node;
if ((node->type == XML_ELEMENT_NODE) &&
if (xmlTextReaderDoExpand(reader) != -1) {
return xmlTextReaderCollectSiblings(node->children);
}
+ break;
case XML_ATTRIBUTE_NODE:
TODO
break;
exec->status = -6;
return;
}
- memcpy(exec->counts, exec->rollbacks[exec->nbRollbacks].counts,
+ if (exec->counts) {
+ memcpy(exec->counts, exec->rollbacks[exec->nbRollbacks].counts,
exec->comp->nbCounters * sizeof(int));
+ }
}
#ifdef DEBUG_REGEXP_EXEC
*/
exec->determinist = 0;
xmlFARegExecRollBack(exec);
- if (exec->status == 0) {
+ if ((exec->inputStack != NULL ) && (exec->status == 0)) {
value = exec->inputStack[exec->index].value;
data = exec->inputStack[exec->index].data;
#ifdef DEBUG_PUSH
(*nbval)++;
}
} else {
- if ((exec->comp->states[trans->to] != NULL) &&
+ if ((exec->comp != NULL) && (exec->comp->states[trans->to] != NULL) &&
(exec->comp->states[trans->to]->type !=
XML_REGEXP_SINK_STATE)) {
if (atom->neg)
if (atom == NULL)
return(NULL);
atom->data = data;
- if (atom == NULL)
- return(NULL);
atom->valuep = xmlStrdup(token);
if (xmlFAGenerateTransitions(am, from, to, atom) < 0) {
* @retValue: the returned value
* @ws: the whitespace type of the value
*
- * Get a the cononical representation of the value.
+ * Get a the canonical representation of the value.
* The caller has to free the returned retValue.
*
* Returns 0 if the value could be built and -1 in case of
if (ctxt->type == XML_SCHEMA_CTXT_VALIDATOR) {
xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctxt;
const char *file = NULL;
+ int col = 0;
if (errorLevel != XML_ERR_WARNING) {
vctxt->nberrors++;
vctxt->err = error;
(vctxt->parserCtxt->input != NULL)) {
file = vctxt->parserCtxt->input->filename;
line = vctxt->parserCtxt->input->line;
+ col = vctxt->parserCtxt->input->col;
}
} else {
/*
node, XML_FROM_SCHEMASV,
error, errorLevel, file, line,
(const char *) str1, (const char *) str2,
- (const char *) str3, 0, 0, msg, str1, str2, str3, str4);
+ (const char *) str3, 0, col, msg, str1, str2, str3, str4);
} else if (ctxt->type == XML_SCHEMA_CTXT_PARSER) {
xmlSchemaParserCtxtPtr pctxt = (xmlSchemaParserCtxtPtr) ctxt;
value = xmlNodeGetContent(node);
/*
* 3.2.2.1 Lexical representation
- * An instance of a datatype that is defined as �boolean�
+ * An instance of a datatype that is defined as `boolean`
* can have the following legal literals {true, false, 1, 0}.
*/
if (xmlStrEqual(BAD_CAST value, BAD_CAST "true"))
return (def);
/*
* 3.2.2.1 Lexical representation
- * An instance of a datatype that is defined as �boolean�
+ * An instance of a datatype that is defined as `boolean`
* can have the following legal literals {true, false, 1, 0}.
*/
if (xmlStrEqual(val, BAD_CAST "true"))
/*
* SPEC src-redefine:
* (7.1) "If it has an <attributeGroup> among its contents
- * the �actual value� of whose ref [attribute] is the same
- * as the �actual value� of its own name attribute plus
+ * the `actual value` of whose ref [attribute] is the same
+ * as the `actual value` of its own name attribute plus
* target namespace, then it must have exactly one such group."
*/
if (pctxt->redefCounter != 0) {
type->flags |= XML_SCHEMAS_TYPE_VARIETY_UNION;
/*
* SPEC (Base type) (2) "If the <list> or <union> alternative is chosen,
- * then the �simple ur-type definition�."
+ * then the `simple ur-type definition`."
*/
type->baseType = xmlSchemaGetBuiltInType(XML_SCHEMAS_ANYSIMPLETYPE);
/*
type->flags |= XML_SCHEMAS_TYPE_VARIETY_LIST;
/*
* SPEC (Base type) (2) "If the <list> or <union> alternative is chosen,
- * then the �simple ur-type definition�."
+ * then the `simple ur-type definition`."
*/
type->baseType = xmlSchemaGetBuiltInType(XML_SCHEMAS_ANYSIMPLETYPE);
/*
}
/*
* TargetNamespace:
- * SPEC "The �actual value� of the targetNamespace [attribute]
+ * SPEC "The `actual value` of the targetNamespace [attribute]
* of the <schema> ancestor element information item if present,
- * otherwise �absent�.
+ * otherwise `absent`.
*/
if (topLevel == 0) {
#ifdef ENABLE_NAMED_LOCALS
/*
* REDEFINE: SPEC src-redefine (5)
* "Within the [children], each <simpleType> must have a
- * <restriction> among its [children] ... the �actual value� of whose
- * base [attribute] must be the same as the �actual value� of its own
+ * <restriction> among its [children] ... the `actual value` of whose
+ * base [attribute] must be the same as the `actual value` of its own
* name attribute plus target namespace;"
*/
if (topLevel && ctxt->isRedefine && (! hasRestriction)) {
/*
* Given that the schemaLocation [attribute] is only a hint, it is open
* to applications to ignore all but the first <import> for a given
- * namespace, regardless of the �actual value� of schemaLocation, but
+ * namespace, regardless of the `actual value` of schemaLocation, but
* such a strategy risks missing useful information when new
* schemaLocations are offered.
*
XML_SCHEMAP_S4S_ATTR_INVALID_VALUE,
NULL, node,
xmlSchemaGetBuiltInType(XML_SCHEMAS_ANYURI),
- NULL, namespaceName, NULL, NULL, NULL);
+ NULL, schemaLocation, NULL, NULL, NULL);
return (pctxt->err);
}
/*
thisTargetNamespace = WXS_BUCKET(pctxt)->origTargetNamespace;
if (namespaceName != NULL) {
/*
- * 1.1 If the namespace [attribute] is present, then its �actual value�
- * must not match the �actual value� of the enclosing <schema>'s
+ * 1.1 If the namespace [attribute] is present, then its `actual value`
+ * must not match the `actual value` of the enclosing <schema>'s
* targetNamespace [attribute].
*/
if (xmlStrEqual(thisTargetNamespace, namespaceName)) {
* for inclusions, since the that was the feedback from the
* schema people. I.e. the following spec piece will *not* be
* satisfied:
- * SPEC src-include: "It is not an error for the �actual value� of the
+ * SPEC src-include: "It is not an error for the `actual value` of the
* schemaLocation [attribute] to fail to resolve it all, in which
* case no corresponding inclusion is performed.
* So do we need a warning report here?"
*
* SPEC src-redefine (1)
* "If there are any element information items among the [children]
- * other than <annotation> then the �actual value� of the
+ * other than <annotation> then the `actual value` of the
* schemaLocation [attribute] must successfully resolve."
* TODO: Ask the WG if a the location has always to resolve
* here as well!
if (bucket->origTargetNamespace != NULL) {
/*
* SPEC src-include (2.1)
- * "SII has a targetNamespace [attribute], and its �actual
- * value� is identical to the �actual value� of the targetNamespace
- * [attribute] of SII� (which must have such an [attribute])."
+ * "SII has a targetNamespace [attribute], and its `actual
+ * value` is identical to the `actual value` of the targetNamespace
+ * [attribute] of SII' (which must have such an [attribute])."
*/
if (pctxt->targetNamespace == NULL) {
xmlSchemaCustomErr(ACTXT_CAST pctxt,
/*
* SPEC src-redefine:
* (6.1) "If it has a <group> among its contents at
- * some level the �actual value� of whose ref
- * [attribute] is the same as the �actual value� of
+ * some level the `actual value` of whose ref
+ * [attribute] is the same as the `actual value` of
* its own name attribute plus target namespace, then
* all of the following must be true:"
* (6.1.1) "It must have exactly one such group."
xmlChar *str = NULL;
/*
* SPEC src-redefine:
- * (6.1.2) "The �actual value� of both that
+ * (6.1.2) "The `actual value` of both that
* group's minOccurs and maxOccurs [attribute]
- * must be 1 (or �absent�).
+ * must be 1 (or `absent`).
*/
xmlSchemaCustomErr(ACTXT_CAST ctxt,
XML_SCHEMAP_SRC_REDEFINE, child, NULL,
*
* SPEC (1.2) "...otherwise (<restriction> has no <simpleType> "
* among its [children]), the simple type definition which is
- * the {content type} of the type definition �resolved� to by
- * the �actual value� of the base [attribute]"
+ * the {content type} of the type definition `resolved` to by
+ * the `actual value` of the base [attribute]"
*/
if (xmlSchemaPValAttrQName(ctxt, schema, NULL, node, "base",
&(type->baseNs), &(type->base)) == 0)
/*
* REDEFINE: SPEC src-redefine (5)
* "Within the [children], each <simpleType> must have a
- * <restriction> among its [children] ... the �actual value� of
- * whose base [attribute] must be the same as the �actual value�
+ * <restriction> among its [children] ... the `actual value` of
+ * whose base [attribute] must be the same as the `actual value`
* of its own name attribute plus target namespace;"
*/
xmlSchemaPCustomErrExt(ctxt, XML_SCHEMAP_SRC_REDEFINE,
* SPEC
* "...the third alternative (neither <simpleContent> nor
* <complexContent>) is chosen. This case is understood as shorthand
- * for complex content restricting the �ur-type definition�, and the
+ * for complex content restricting the `ur-type definition`, and the
* details of the mappings should be modified as necessary.
*/
type->baseType = xmlSchemaGetBuiltInType(XML_SCHEMAS_ANYTYPE);
if ((elemDecl->subtypes == NULL) && (elemDecl->namedType != NULL)) {
xmlSchemaTypePtr type;
- /* (type definition) ... otherwise the type definition �resolved�
- * to by the �actual value� of the type [attribute] ...
+ /* (type definition) ... otherwise the type definition `resolved`
+ * to by the `actual value` of the type [attribute] ...
*/
type = xmlSchemaGetType(ctxt->schema, elemDecl->namedType,
elemDecl->namedTypeNs);
/*
* The type definitions is set to:
* SPEC "...the {type definition} of the element
- * declaration �resolved� to by the �actual value�
+ * declaration `resolved` to by the `actual value`
* of the substitutionGroup [attribute], if present"
*/
if (elemDecl->subtypes == NULL)
/*
* SPEC (1) "If the <union> alternative is chosen, then [Definition:]
- * define the explicit members as the type definitions �resolved�
- * to by the items in the �actual value� of the memberTypes [attribute],
+ * define the explicit members as the type definitions `resolved`
+ * to by the items in the `actual value` of the memberTypes [attribute],
* if any, followed by the type definitions corresponding to the
* <simpleType>s among the [children] of <union>, if any."
*/
return (0);
}
/*
- * 3 If both O1 and O2 are sets of (namespace names or �absent�),
+ * 3 If both O1 and O2 are sets of (namespace names or `absent`),
* then the union of those sets must be the value.
*/
if ((completeWild->nsSet != NULL) && (curWild->nsSet != NULL)) {
}
/*
* 4 If the two are negations of different values (namespace names
- * or �absent�), then a pair of not and �absent� must be the value.
+ * or `absent`), then a pair of not and `absent` must be the value.
*/
if ((completeWild->negNsSet != NULL) &&
(curWild->negNsSet != NULL) &&
if (nsFound && absentFound) {
/*
* 5.1 If the set S includes both the negated namespace
- * name and �absent�, then any must be the value.
+ * name and `absent`, then any must be the value.
*/
completeWild->any = 1;
if (completeWild->nsSet != NULL) {
} else if (nsFound && (!absentFound)) {
/*
* 5.2 If the set S includes the negated namespace name
- * but not �absent�, then a pair of not and �absent� must
+ * but not `absent`, then a pair of not and `absent` must
* be the value.
*/
if (completeWild->nsSet != NULL) {
completeWild->negNsSet->value = NULL;
} else if ((!nsFound) && absentFound) {
/*
- * 5.3 If the set S includes �absent� but not the negated
+ * 5.3 If the set S includes `absent` but not the negated
* namespace name, then the union is not expressible.
*/
xmlSchemaPErr(ctxt, completeWild->node,
} else if ((!nsFound) && (!absentFound)) {
/*
* 5.4 If the set S does not include either the negated namespace
- * name or �absent�, then whichever of O1 or O2 is a pair of not
+ * name or `absent`, then whichever of O1 or O2 is a pair of not
* and a namespace name must be the value.
*/
if (completeWild->negNsSet == NULL) {
while (cur != NULL) {
if (cur->value == NULL) {
/*
- * 6.1 If the set S includes �absent�, then any must be the
+ * 6.1 If the set S includes `absent`, then any must be the
* value.
*/
completeWild->any = 1;
}
if (completeWild->negNsSet == NULL) {
/*
- * 6.2 If the set S does not include �absent�, then a pair of not
- * and �absent� must be the value.
+ * 6.2 If the set S does not include `absent`, then a pair of not
+ * and `absent` must be the value.
*/
if (completeWild->nsSet != NULL) {
xmlSchemaFreeWildcardNsSet(completeWild->nsSet);
}
/*
* 3 If either O1 or O2 is a pair of not and a value (a namespace
- * name or �absent�) and the other is a set of (namespace names or
- * �absent�), then that set, minus the negated value if it was in
- * the set, minus �absent� if it was in the set, must be the value.
+ * name or `absent`) and the other is a set of (namespace names or
+ * `absent`), then that set, minus the negated value if it was in
+ * the set, minus `absent` if it was in the set, must be the value.
*/
if (((completeWild->negNsSet != NULL) && (curWild->nsSet != NULL)) ||
((curWild->negNsSet != NULL) && (completeWild->nsSet != NULL))) {
return(0);
}
/*
- * 4 If both O1 and O2 are sets of (namespace names or �absent�),
+ * 4 If both O1 and O2 are sets of (namespace names or `absent`),
* then the intersection of those sets must be the value.
*/
if ((completeWild->nsSet != NULL) && (curWild->nsSet != NULL)) {
}
/*
* 6 If the one is a negation of a namespace name and the other
- * is a negation of �absent�, then the one which is the negation
+ * is a negation of `absent`, then the one which is the negation
* of a namespace name must be the value.
*/
if ((completeWild->negNsSet != NULL) && (curWild->negNsSet != NULL) &&
if (super->any)
return (0);
/*
- * 2.1 sub must be a pair of not and a namespace name or �absent�.
+ * 2.1 sub must be a pair of not and a namespace name or `absent`.
* 2.2 super must be a pair of not and the same value.
*/
if ((sub->negNsSet != NULL) &&
(sub->negNsSet->value == super->negNsSet->value))
return (0);
/*
- * 3.1 sub must be a set whose members are either namespace names or �absent�.
+ * 3.1 sub must be a set whose members are either namespace names or `absent`.
*/
if (sub->nsSet != NULL) {
/*
xmlSchemaWildcardNsPtr cur;
/*
* 3.2.2 super must be a pair of not and a namespace name or
- * �absent� and that value must not be in sub's set.
+ * `absent` and that value must not be in sub's set.
*/
cur = sub->nsSet;
while (cur != NULL) {
* SPEC (2.1.2) "R's {attribute declaration}'s
* {type definition} must be validly derived from
* B's {type definition} given the empty set as
- * defined in Type Derivation OK (Simple) (�3.14.6)."
+ * defined in Type Derivation OK (Simple) ($3.14.6)."
*/
xmlSchemaPAttrUseErr4(pctxt,
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2,
/*
* 2.1.3 ... one of the following must be true
*
- * 2.1.3.1 B's �effective value constraint� is
- * �absent� or default.
+ * 2.1.3.1 B's `effective value constraint` is
+ * `absent` or default.
*/
if ((bEffValue != NULL) &&
(effFixed == 1)) {
xmlSchemaGetEffectiveValueConstraint(bcur,
&effFixed, &rEffValue, NULL);
/*
- * 2.1.3.2 R's �effective value constraint� is
+ * 2.1.3.2 R's `effective value constraint` is
* fixed with the same string as B's.
* MAYBE TODO: Compare the computed values.
* Hmm, it says "same string" so
/*
* (2.2) "otherwise the {base type definition} must have an
* {attribute wildcard} and the {target namespace} of the
- * R's {attribute declaration} must be �valid� with respect
+ * R's {attribute declaration} must be `valid` with respect
* to that wildcard, as defined in Wildcard allows Namespace
- * Name (�3.10.4)."
+ * Name ($3.10.4)."
*/
if ((baseWild == NULL) ||
(xmlSchemaCheckCVCWildcardNamespace(baseWild,
* (4.2) "The complex type definition's {attribute wildcard}'s
* {namespace constraint} must be a subset of the {base type
* definition}'s {attribute wildcard}'s {namespace constraint},
- * as defined by Wildcard Subset (�3.10.6)."
+ * as defined by Wildcard Subset ($3.10.6)."
*/
xmlSchemaCustomErr4(ACTXT_CAST pctxt,
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_2,
FREE_AND_NULL(str);
return(pctxt->err);
}
- /* 4.3 Unless the {base type definition} is the �ur-type
- * definition�, the complex type definition's {attribute
+ /* 4.3 Unless the {base type definition} is the `ur-type
+ * definition`, the complex type definition's {attribute
* wildcard}'s {process contents} must be identical to or
* stronger than the {base type definition}'s {attribute
* wildcard}'s {process contents}, where strict is stronger
if (WXS_IS_EXTENSION(type)) {
if (baseType->attributeWildcard != NULL) {
/*
- * (3.2.2.1) "If the �base wildcard� is non-�absent�, then
+ * (3.2.2.1) "If the `base wildcard` is non-`absent`, then
* the appropriate case among the following:"
*/
if (type->attributeWildcard != NULL) {
* Union the complete wildcard with the base wildcard.
* SPEC {attribute wildcard}
* (3.2.2.1.2) "otherwise a wildcard whose {process contents}
- * and {annotation} are those of the �complete wildcard�,
+ * and {annotation} are those of the `complete wildcard`,
* and whose {namespace constraint} is the intensional union
- * of the {namespace constraint} of the �complete wildcard�
- * and of the �base wildcard�, as defined in Attribute
- * Wildcard Union (�3.10.6)."
+ * of the {namespace constraint} of the `complete wildcard`
+ * and of the `base wildcard`, as defined in Attribute
+ * Wildcard Union ($3.10.6)."
*/
if (xmlSchemaUnionWildcards(pctxt, type->attributeWildcard,
baseType->attributeWildcard) == -1)
goto exit_failure;
} else {
/*
- * (3.2.2.1.1) "If the �complete wildcard� is �absent�,
- * then the �base wildcard�."
+ * (3.2.2.1.1) "If the `complete wildcard` is `absent`,
+ * then the `base wildcard`."
*/
type->attributeWildcard = baseType->attributeWildcard;
}
} else {
/*
- * (3.2.2.2) "otherwise (the �base wildcard� is �absent�) the
- * �complete wildcard"
+ * (3.2.2.2) "otherwise (the `base wildcard` is `absent`) the
+ * `complete wildcard`"
* NOOP
*/
}
/*
* SPEC {attribute wildcard}
* (3.1) "If the <restriction> alternative is chosen, then the
- * �complete wildcard�;"
+ * `complete wildcard`;"
* NOOP
*/
}
/* 2.2 */
if (type->baseType == baseType) {
/*
- * 2.2.1 D's �base type definition� is B.
+ * 2.2.1 D's `base type definition` is B.
*/
return (0);
}
/*
- * 2.2.2 D's �base type definition� is not the �ur-type definition�
+ * 2.2.2 D's `base type definition` is not the `ur-type definition`
* and is validly derived from B given the subset, as defined by this
* constraint.
*/
return (0);
}
/*
- * 2.2.3 D's {variety} is list or union and B is the �simple ur-type
- * definition�.
+ * 2.2.3 D's {variety} is list or union and B is the `simple ur-type
+ * definition`.
*/
if (WXS_IS_ANY_SIMPLE_TYPE(baseType) &&
(WXS_IS_LIST(type) || WXS_IS_UNION(type))) {
* NOTE: This is somehow redundant, since we actually built a simple type
* to have all the needed information; this acts as an self test.
*/
- /* Base type: If the datatype has been �derived� by �restriction�
- * then the Simple Type Definition component from which it is �derived�,
- * otherwise the Simple Type Definition for anySimpleType (�4.1.6).
+ /* Base type: If the datatype has been `derived` by `restriction`
+ * then the Simple Type Definition component from which it is `derived`,
+ * otherwise the Simple Type Definition for anySimpleType ($4.1.6).
*/
if (baseType == NULL) {
/*
* TODO: Think about: "modulo the impact of Missing
- * Sub-components (�5.3)."
+ * Sub-components ($5.3)."
*/
xmlSchemaPCustomErr(ctxt,
XML_SCHEMAP_ST_PROPS_CORRECT_1,
}
/*
- * 2 All simple type definitions must be derived ultimately from the �simple
- * ur-type definition (so� circular definitions are disallowed). That is, it
- * must be possible to reach a built-in primitive datatype or the �simple
- * ur-type definition� by repeatedly following the {base type definition}.
+ * 2 All simple type definitions must be derived ultimately from the `simple
+ * ur-type definition` (so circular definitions are disallowed). That is, it
+ * must be possible to reach a built-in primitive datatype or the `simple
+ * ur-type definition` by repeatedly following the {base type definition}.
*
* NOTE: this is done in xmlSchemaCheckTypeDefCircular().
*/
}
/*
* MAYBE TODO: (Hmm, not really) Datatypes states:
- * A �list� datatype can be �derived� from an �atomic� datatype
- * whose �lexical space� allows space (such as string or anyURI)or
- * a �union� datatype any of whose {member type definitions}'s
- * �lexical space� allows space.
+ * A `list` datatype can be `derived` from an `atomic` datatype
+ * whose `lexical space` allows space (such as string or anyURI)or
+ * a `union` datatype any of whose {member type definitions}'s
+ * `lexical space` allows space.
*/
} else {
/*
/*
* 2.3.2.3 The {item type definition} must be validly derived
* from the {base type definition}'s {item type definition} given
- * the empty set, as defined in Type Derivation OK (Simple) (�3.14.6).
+ * the empty set, as defined in Type Derivation OK (Simple) ($3.14.6).
*/
{
xmlSchemaTypePtr baseItemType;
case XML_SCHEMA_FACET_WHITESPACE:
/*
* TODO: 2.5.1.2 List datatypes
- * The value of �whiteSpace� is fixed to the value collapse.
+ * The value of `whiteSpace` is fixed to the value collapse.
*/
case XML_SCHEMA_FACET_PATTERN:
case XML_SCHEMA_FACET_ENUMERATION:
member = member->next;
}
/*
- * 3.3.1 If the {base type definition} is the �simple ur-type
- * definition�
+ * 3.3.1 If the {base type definition} is the `simple ur-type
+ * definition`
*/
if (type->baseType->builtInType == XML_SCHEMAS_ANYSIMPLETYPE) {
/*
* 3.3.2.3 The {member type definitions}, in order, must be validly
* derived from the corresponding type definitions in the {base
* type definition}'s {member type definitions} given the empty set,
- * as defined in Type Derivation OK (Simple) (�3.14.6).
+ * as defined in Type Derivation OK (Simple) ($3.14.6).
*/
{
xmlSchemaTypeLinkPtr baseMember;
/*
* src-simple-type.1 The corresponding simple type definition, if any,
* must satisfy the conditions set out in Constraints on Simple Type
- * Definition Schema Components (�3.14.6).
+ * Definition Schema Components ($3.14.6).
*/
if (WXS_IS_RESTRICTION(type)) {
/*
* SPEC (2.1) "its {content type} must be a simple type definition
* or mixed."
* SPEC (2.2.2) "If the {content type} is mixed, then the {content
- * type}'s particle must be �emptiable� as defined by
- * Particle Emptiable (�3.9.6)."
+ * type}'s particle must be `emptiable` as defined by
+ * Particle Emptiable ($3.9.6)."
*/
if ((! WXS_HAS_SIMPLE_CONTENT(type)) &&
((! WXS_HAS_MIXED_CONTENT(type)) || (! WXS_EMPTIABLE(type)))) {
}
/*
* 1 If the type definition is a simple type definition, then the string
- * must be �valid� with respect to that definition as defined by String
- * Valid (�3.14.4).
+ * must be `valid` with respect to that definition as defined by String
+ * Valid ($3.14.4).
*
* AND
*
* 2.2.1 If the {content type} is a simple type definition, then the
- * string must be �valid� with respect to that simple type definition
- * as defined by String Valid (�3.14.4).
+ * string must be `valid` with respect to that simple type definition
+ * as defined by String Valid ($3.14.4).
*/
if (WXS_IS_SIMPLE(type))
ret = xmlSchemaVCheckCVCSimpleType(ACTXT_CAST pctxt, node,
*
* SPEC (1) "The values of the properties of a complex type definition must
* be as described in the property tableau in The Complex Type Definition
- * Schema Component (�3.4.1), modulo the impact of Missing
- * Sub-components (�5.3)."
+ * Schema Component ($3.4.1), modulo the impact of Missing
+ * Sub-components ($5.3)."
*/
if ((type->baseType != NULL) &&
(WXS_IS_SIMPLE(type->baseType)) &&
return (XML_SCHEMAP_SRC_CT_1);
}
/*
- * SPEC (3) "Circular definitions are disallowed, except for the �ur-type
- * definition�. That is, it must be possible to reach the �ur-type
- * definition by repeatedly following the {base type definition}."
+ * SPEC (3) "Circular definitions are disallowed, except for the `ur-type
+ * definition`. That is, it must be possible to reach the `ur-type
+ * definition` by repeatedly following the {base type definition}."
*
* NOTE (3) is done in xmlSchemaCheckTypeDefCircular().
*/
if (type->baseType == baseType)
return (0);
/*
- * SPEC (2.3.1) "D's {base type definition} must not be the �ur-type
- * definition�."
+ * SPEC (2.3.1) "D's {base type definition} must not be the `ur-type
+ * definition`."
*/
if (WXS_IS_ANYTYPE(type->baseType))
return (1);
/*
* SPEC (2.3.2.2) "If D's {base type definition} is simple, then it
* must be validly derived from B given the subset as defined in Type
- * Derivation OK (Simple) (�3.14.6).
+ * Derivation OK (Simple) ($3.14.6).
*/
return (xmlSchemaCheckCOSSTDerivedOK(actxt, type->baseType,
baseType, set));
* definition must also have one, and the base type definition's
* {attribute wildcard}'s {namespace constraint} must be a subset
* of the complex type definition's {attribute wildcard}'s {namespace
- * constraint}, as defined by Wildcard Subset (�3.10.6)."
+ * constraint}, as defined by Wildcard Subset ($3.10.6)."
*/
/*
}
/*
* URGENT TODO SPEC (1.4.3.2.2.2) "The particle of the
- * complex type definition must be a �valid extension�
+ * complex type definition must be a `valid extension`
* of the {base type definition}'s particle, as defined
- * in Particle Valid (Extension) (�3.9.6)."
+ * in Particle Valid (Extension) ($3.9.6)."
*
* NOTE that we won't check "Particle Valid (Extension)",
* since it is ensured by the derivation process in
if (base->builtInType == XML_SCHEMAS_ANYTYPE) {
/*
* SPEC (5.1) "The {base type definition} must be the
- * �ur-type definition�."
+ * `ur-type definition`."
* PASS
*/
} else if ((type->contentType == XML_SCHEMA_CONTENT_SIMPLE) ||
* SPEC (5.2.2.1) "The {content type} of the {base type
* definition} must be a simple type definition from which
* the {content type} is validly derived given the empty
- * set as defined in Type Derivation OK (Simple) (�3.14.6)."
+ * set as defined in Type Derivation OK (Simple) ($3.14.6)."
*
* ATTENTION TODO: This seems not needed if the type implicitely
* derived from the base type.
(xmlSchemaParticlePtr) base->subtypes))) {
/*
* SPEC (5.2.2.2) "The {base type definition} must be mixed
- * and have a particle which is �emptiable� as defined in
- * Particle Emptiable (�3.9.6)."
+ * and have a particle which is `emptiable` as defined in
+ * Particle Emptiable ($3.9.6)."
* PASS
*/
} else {
/*
* SPEC (5.3.2.2) "The {content type} of the {base type
* definition} must be elementOnly or mixed and have a particle
- * which is �emptiable� as defined in Particle Emptiable (�3.9.6)."
+ * which is `emptiable` as defined in Particle Emptiable ($3.9.6)."
* PASS
*/
} else {
}
/*
* SPEC (5.4.2) "The particle of the complex type definition itself
- * must be a �valid restriction� of the particle of the {content
+ * must be a `valid restriction` of the particle of the {content
* type} of the {base type definition} as defined in Particle Valid
- * (Restriction) (�3.9.6).
+ * (Restriction) ($3.9.6).
*
* URGENT TODO: (5.4.2)
*/
if (! WXS_HAS_SIMPLE_CONTENT(type)) {
/*
* 1 If the <complexContent> alternative is chosen, the type definition
- * �resolved� to by the �actual value� of the base [attribute]
+ * `resolved` to by the `actual value` of the base [attribute]
* must be a complex type definition;
*/
if (! WXS_IS_COMPLEX(base)) {
* SPEC
* 2 If the <simpleContent> alternative is chosen, all of the
* following must be true:
- * 2.1 The type definition �resolved� to by the �actual value� of the
+ * 2.1 The type definition `resolved` to by the `actual value` of the
* base [attribute] must be one of the following:
*/
if (WXS_IS_SIMPLE(base)) {
/*
* SPEC (3) "The corresponding complex type definition component must
* satisfy the conditions set out in Constraints on Complex Type
- * Definition Schema Components (�3.4.6);"
+ * Definition Schema Components ($3.4.6);"
* NOTE (3) will be done in xmlSchemaTypeFixup().
*/
/*
* SPEC (4) If clause 2.2.1 or clause 2.2.2 in the correspondence specification
* above for {attribute wildcard} is satisfied, the intensional
* intersection must be expressible, as defined in Attribute Wildcard
- * Intersection (�3.10.6).
+ * Intersection ($3.10.6).
* NOTE (4) is done in xmlSchemaFixupTypeAttributeUses().
*/
return (ret);
return (1);
/*
* SPEC (2) "R's occurrence range is a valid restriction of B's
- * occurrence range as defined by Occurrence Range OK (�3.9.6)."
+ * occurrence range as defined by Occurrence Range OK ($3.9.6)."
*/
if (xmlSchemaCheckParticleRangeOK(r->minOccurs, r->maxOccurs,
b->minOccurs, b->maxOccurs) != 0)
{
/* TODO:Error codes (rcase-NSCompat). */
/*
- * SPEC "For an element declaration particle to be a �valid restriction�
+ * SPEC "For an element declaration particle to be a `valid restriction`
* of a wildcard particle all of the following must be true:"
*
- * SPEC (1) "The element declaration's {target namespace} is �valid�
+ * SPEC (1) "The element declaration's {target namespace} is `valid`
* with respect to the wildcard's {namespace constraint} as defined by
- * Wildcard allows Namespace Name (�3.10.4)."
+ * Wildcard allows Namespace Name ($3.10.4)."
*/
if (xmlSchemaCheckCVCWildcardNamespace((xmlSchemaWildcardPtr) b->children,
((xmlSchemaElementPtr) r->children)->targetNamespace) != 0)
return (1);
/*
* SPEC (2) "R's occurrence range is a valid restriction of B's
- * occurrence range as defined by Occurrence Range OK (�3.9.6)."
+ * occurrence range as defined by Occurrence Range OK ($3.9.6)."
*/
if (xmlSchemaCheckParticleRangeOK(r->minOccurs, r->maxOccurs,
b->minOccurs, b->maxOccurs) != 0)
/* TODO: Error codes (rcase-NSSubset). */
/*
* SPEC (1) "R's occurrence range is a valid restriction of B's
- * occurrence range as defined by Occurrence Range OK (�3.9.6)."
+ * occurrence range as defined by Occurrence Range OK ($3.9.6)."
*/
if (xmlSchemaCheckParticleRangeOK(r->minOccurs, r->maxOccurs,
b->minOccurs, b->maxOccurs))
return (1);
/*
* SPEC (2) "R's {namespace constraint} must be an intensional subset
- * of B's {namespace constraint} as defined by Wildcard Subset (�3.10.6)."
+ * of B's {namespace constraint} as defined by Wildcard Subset ($3.10.6)."
*/
if (xmlSchemaCheckCOSNSSubset((xmlSchemaWildcardPtr) r->children,
(xmlSchemaWildcardPtr) b->children))
return (1);
/*
- * SPEC (3) "Unless B is the content model wildcard of the �ur-type
- * definition�, R's {process contents} must be identical to or stronger
+ * SPEC (3) "Unless B is the content model wildcard of the `ur-type
+ * definition`, R's {process contents} must be identical to or stronger
* than B's {process contents}, where strict is stronger than lax is
* stronger than skip."
*/
if ((r->children == NULL) || (r->children->children == NULL))
return (-1);
/*
- * SPEC "For a group particle to be a �valid restriction� of a
+ * SPEC "For a group particle to be a `valid restriction` of a
* wildcard particle..."
*
- * SPEC (1) "Every member of the {particles} of the group is a �valid
- * restriction� of the wildcard as defined by
- * Particle Valid (Restriction) (�3.9.6)."
+ * SPEC (1) "Every member of the {particles} of the group is a `valid
+ * restriction` of the wildcard as defined by
+ * Particle Valid (Restriction) ($3.9.6)."
*/
part = (xmlSchemaParticlePtr) r->children->children;
do {
/*
* SPEC (2) "The effective total range of the group [...] is a
* valid restriction of B's occurrence range as defined by
- * Occurrence Range OK (�3.9.6)."
+ * Occurrence Range OK ($3.9.6)."
*/
if (xmlSchemaCheckParticleRangeOK(
xmlSchemaGetParticleTotalRangeMin(r),
(r->children->type != b->children->type))
return (-1);
/*
- * SPEC "For an all or sequence group particle to be a �valid
- * restriction� of another group particle with the same {compositor}..."
+ * SPEC "For an all or sequence group particle to be a `valid
+ * restriction` of another group particle with the same {compositor}..."
*
* SPEC (1) "R's occurrence range is a valid restriction of B's
- * occurrence range as defined by Occurrence Range OK (�3.9.6)."
+ * occurrence range as defined by Occurrence Range OK ($3.9.6)."
*/
if (xmlSchemaCheckParticleRangeOK(r->minOccurs, r->maxOccurs,
b->minOccurs, b->maxOccurs))
xmlSchemaTypeLinkPtr link, lastLink, prevLink, subLink, newLink;
/*
* The actual value is then formed by replacing any union type
- * definition in the �explicit members� with the members of their
+ * definition in the `explicit members` with the members of their
* {member type definitions}, in order.
*
* TODO: There's a bug entry at
}
}
/*
- * For all �atomic� datatypes other than string (and types �derived�
- * by �restriction� from it) the value of whiteSpace is fixed to
+ * For all `atomic` datatypes other than string (and types `derived`
+ * by `restriction` from it) the value of whiteSpace is fixed to
* collapse
*/
{
* SPEC src-simple-type 1
* "The corresponding simple type definition, if any, must satisfy
* the conditions set out in Constraints on Simple Type Definition
- * Schema Components (�3.14.6)."
+ * Schema Components ($3.14.6)."
*/
/*
* Schema Component Constraint: Simple Type Definition Properties Correct
( ((xmlSchemaTreeItemPtr) particle->children)->children == NULL))) {
if (type->flags & XML_SCHEMAS_TYPE_MIXED) {
/*
- * SPEC (2.1.4) "If the �effective mixed� is true, then
+ * SPEC (2.1.4) "If the `effective mixed` is true, then
* a particle whose properties are as follows:..."
*
* Empty sequence model group with
if (type->contentType == XML_SCHEMA_CONTENT_EMPTY) {
/*
* SPEC (3.2.1)
- * "If the �effective content� is empty, then the
+ * "If the `effective content` is empty, then the
* {content type} of the [...] base ..."
*/
type->contentType = baseType->contentType;
particle->children =
((xmlSchemaParticlePtr) baseType->subtypes)->children;
/*
- * SPEC "followed by the �effective content�."
+ * SPEC "followed by the `effective content`."
*/
particle->next = effectiveContent;
/*
/* 4.3.5.5 Constraints on enumeration Schema Components
* Schema Component Constraint: enumeration valid restriction
- * It is an �error� if any member of {value} is not in the
- * �value space� of {base type definition}.
+ * It is an `error` if any member of {value} is not in the
+ * `value space` of {base type definition}.
*
* minInclusive, maxInclusive, minExclusive, maxExclusive:
- * The value �must� be in the
- * �value space� of the �base type�.
+ * The value `must` be in the
+ * `value space` of the `base type`.
*/
/*
* This function is intended to deliver a compiled value
* not be an <attributeGroup> with ref [attribute] which resolves
* to the component corresponding to this <attributeGroup>. Indirect
* circularity is also ruled out. That is, when QName resolution
- * (Schema Document) (�3.15.3) is applied to a �QName� arising from
+ * (Schema Document) ($3.15.3) is applied to a `QName` arising from
* any <attributeGroup>s with a ref [attribute] among the [children],
- * it must not be the case that a �QName� is encountered at any depth
+ * it must not be the case that a `QName` is encountered at any depth
* which resolves to the component corresponding to this <attributeGroup>.
*/
if (attrGr->attrUses == NULL)
* SPEC ag-props-correct
* (1) "The values of the properties of an attribute group definition
* must be as described in the property tableau in The Attribute
- * Group Definition Schema Component (�3.6.1), modulo the impact of
- * Missing Sub-components (�5.3);"
+ * Group Definition Schema Component ($3.6.1), modulo the impact of
+ * Missing Sub-components ($5.3);"
*/
if ((attrGr->attrUses != NULL) &&
* SPEC a-props-correct (1)
* "The values of the properties of an attribute declaration must
* be as described in the property tableau in The Attribute
- * Declaration Schema Component (�3.2.1), modulo the impact of
- * Missing Sub-components (�5.3)."
+ * Declaration Schema Component ($3.2.1), modulo the impact of
+ * Missing Sub-components ($5.3)."
*/
if (WXS_ATTR_TYPEDEF(attr) == NULL)
/*
* SPEC a-props-correct (2)
* "if there is a {value constraint}, the canonical lexical
- * representation of its value must be �valid� with respect
- * to the {type definition} as defined in String Valid (�3.14.4)."
- * TODO: Don't care about the *cononical* stuff here, this requirement
+ * representation of its value must be `valid` with respect
+ * to the {type definition} as defined in String Valid ($3.14.4)."
+ * TODO: Don't care about the *canonical* stuff here, this requirement
* will be removed in WXS 1.1 anyway.
*/
ret = xmlSchemaVCheckCVCSimpleType(ACTXT_CAST pctxt,
/*
* SPEC (1) "The values of the properties of an element declaration
* must be as described in the property tableau in The Element
- * Declaration Schema Component (�3.3.1), modulo the impact of Missing
- * Sub-components (�5.3)."
+ * Declaration Schema Component ($3.3.1), modulo the impact of Missing
+ * Sub-components ($5.3)."
*/
if (WXS_SUBST_HEAD(elemDecl) != NULL) {
xmlSchemaElementPtr head = WXS_SUBST_HEAD(elemDecl), circ;
xmlSchemaCheckElementDeclComponent(head, pctxt);
/*
- * SPEC (3) "If there is a non-�absent� {substitution group
+ * SPEC (3) "If there is a non-`absent` {substitution group
* affiliation}, then {scope} must be global."
*/
if ((elemDecl->flags & XML_SCHEMAS_ELEM_GLOBAL) == 0) {
* of the element declaration must be validly derived from the {type
* definition} of the {substitution group affiliation}, given the value
* of the {substitution group exclusions} of the {substitution group
- * affiliation}, as defined in Type Derivation OK (Complex) (�3.4.6)
+ * affiliation}, as defined in Type Derivation OK (Complex) ($3.4.6)
* (if the {type definition} is complex) or as defined in
- * Type Derivation OK (Simple) (�3.14.6) (if the {type definition} is
+ * Type Derivation OK (Simple) ($3.14.6) (if the {type definition} is
* simple)."
*
* NOTE: {substitution group exclusions} means the values of the
/*
* SPEC (2) "If there is a {value constraint}, the canonical lexical
- * representation of its value must be �valid� with respect to the
+ * representation of its value must be `valid` with respect to the
* {type definition} as defined in Element Default Valid (Immediate)
- * (�3.3.6)."
+ * ($3.3.6)."
*/
if (typeDef == NULL) {
xmlSchemaPErr(pctxt, elemDecl->node,
/*
* SPEC (2) "It is validly substitutable for HEAD subject to HEAD's
* {disallowed substitutions} as the blocking constraint, as defined in
- * Substitution Group OK (Transitive) (�3.3.6)."
+ * Substitution Group OK (Transitive) ($3.3.6)."
*/
for (head = WXS_SUBST_HEAD(elemDecl); head != NULL;
head = WXS_SUBST_HEAD(head)) {
* SPEC Element Declarations Consistent:
* "If the {particles} contains, either directly,
* indirectly (that is, within the {particles} of a
- * contained model group, recursively) or �implicitly�
+ * contained model group, recursively) or `implicitly`
* two or more element declaration particles with
* the same {name} and {target namespace}, then
* all their type definitions must be the same
ptx = xmlSchemaGetPrimitiveType(tx);
pty = xmlSchemaGetPrimitiveType(ty);
/*
- * (1) if a datatype T' is �derived� by �restriction� from an
- * atomic datatype T then the �value space� of T' is a subset of
- * the �value space� of T. */
+ * (1) if a datatype T' is `derived` by `restriction` from an
+ * atomic datatype T then the `value space` of T' is a subset of
+ * the `value space` of T. */
/*
- * (2) if datatypes T' and T'' are �derived� by �restriction�
- * from a common atomic ancestor T then the �value space�s of T'
+ * (2) if datatypes T' and T'' are `derived` by `restriction`
+ * from a common atomic ancestor T then the `value space`s of T'
* and T'' may overlap.
*/
if (ptx != pty)
* SPEC au-props-correct (1)
* "The values of the properties of an attribute use must be as
* described in the property tableau in The Attribute Use Schema
- * Component (�3.5.1), modulo the impact of Missing
- * Sub-components (�5.3)."
+ * Component ($3.5.1), modulo the impact of Missing
+ * Sub-components ($5.3)."
*/
if (((WXS_ATTRUSE_DECL(use))->defValue != NULL) &&
/*
* The simple type definition corresponding to the <simpleType> element
* information item in the [children], if present, otherwise the simple
- * type definition �resolved� to by the �actual value� of the type
- * [attribute], if present, otherwise the �simple ur-type definition�.
+ * type definition `resolved` to by the `actual value` of the type
+ * [attribute], if present, otherwise the `simple ur-type definition`.
*/
if (item->flags & XML_SCHEMAS_ATTR_INTERNAL_RESOLVED)
return(0);
/*
* SPEC src-redefine:
- * (6.2.1) "The �actual value� of its own name attribute plus
- * target namespace must successfully �resolve� to a model
+ * (6.2.1) "The `actual value` of its own name attribute plus
+ * target namespace must successfully `resolve` to a model
* group definition in I."
- * (7.2.1) "The �actual value� of its own name attribute plus
- * target namespace must successfully �resolve� to an attribute
+ * (7.2.1) "The `actual value` of its own name attribute plus
+ * target namespace must successfully `resolve` to an attribute
* group definition in I."
*
* SPEC src-redefine:
* (6.2.2) "The {model group} of the model group definition
* which corresponds to it per XML Representation of Model
- * Group Definition Schema Components (�3.7.2) must be a
- * �valid restriction� of the {model group} of that model
+ * Group Definition Schema Components ($3.7.2) must be a
+ * `valid restriction` of the {model group} of that model
* group definition in I, as defined in Particle Valid
- * (Restriction) (�3.9.6)."
+ * (Restriction) ($3.9.6)."
*/
break;
case XML_SCHEMA_TYPE_ATTRIBUTEGROUP:
* (7.2.2) "The {attribute uses} and {attribute wildcard} of
* the attribute group definition which corresponds to it
* per XML Representation of Attribute Group Definition Schema
- * Components (�3.6.2) must be �valid restrictions� of the
+ * Components ($3.6.2) must be `valid restrictions` of the
* {attribute uses} and {attribute wildcard} of that attribute
* group definition in I, as defined in clause 2, clause 3 and
* clause 4 of Derivation Valid (Restriction, Complex)
- * (�3.4.6) (where references to the base type definition are
+ * ($3.4.6) (where references to the base type definition are
* understood as references to the attribute group definition
* in I)."
*/
* (6.2.2) The {model group} of the model group definition which
* corresponds to it per XML Representation of Model Group
- * Definition Schema Components (�3.7.2) must be a �valid
- * restriction� of the {model group} of that model group definition
- * in I, as defined in Particle Valid (Restriction) (�3.9.6)."
+ * Definition Schema Components ($3.7.2) must be a `valid
+ * restriction` of the {model group} of that model group definition
+ * in I, as defined in Particle Valid (Restriction) ($3.9.6)."
*/
xmlSchemaCheckSRCRedefineFirst(pctxt);
return(XML_SCHEMA_WHITESPACE_REPLACE);
else {
/*
- * For all �atomic� datatypes other than string (and types �derived�
- * by �restriction� from it) the value of whiteSpace is fixed to
+ * For all `atomic` datatypes other than string (and types `derived`
+ * by `restriction` from it) the value of whiteSpace is fixed to
* collapse
* Note that this includes built-in list datatypes.
*/
xmlChar *str = NULL;
/*
* cvc-identity-constraint:
- * 3 For each node in the �target node set� all
+ * 3 For each node in the `target node set` all
* of the {fields}, with that node as the context
* node, evaluate to either an empty node-set or
* a node-set with exactly one member, which must
/*
* 4.1 If the {identity-constraint category} is unique(/key),
- * then no two members of the �qualified node set� have
- * �key-sequences� whose members are pairwise equal, as
+ * then no two members of the `qualified node set` have
+ * `key-sequences` whose members are pairwise equal, as
* defined by Equal in [XML Schemas: Datatypes].
*
* Get the IDC binding from the matcher and check for
{
xmlChar *str = NULL;
/*
- * 4.2.1 (KEY) The �target node set� and the
- * �qualified node set� are equal, that is, every
- * member of the �target node set� is also a member
- * of the �qualified node set� and vice versa.
+ * 4.2.1 (KEY) The `target node set` and the
+ * `qualified node set` are equal, that is, every
+ * member of the `target node set` is also a member
+ * of the `qualified node set` and vice versa.
*/
xmlSchemaCustomErr(ACTXT_CAST vctxt,
XML_SCHEMAV_CVC_IDC, NULL,
*/
/*
* 2.1 If The definition is ENTITY or is validly derived from ENTITY given
- * the empty set, as defined in Type Derivation OK (Simple) (�3.14.6), then
- * the string must be a �declared entity name�.
+ * the empty set, as defined in Type Derivation OK (Simple) ($3.14.6), then
+ * the string must be a `declared entity name`.
*/
/*
* 2.2 If The definition is ENTITIES or is validly derived from ENTITIES
- * given the empty set, as defined in Type Derivation OK (Simple) (�3.14.6),
- * then every whitespace-delimited substring of the string must be a �declared
- * entity name�.
+ * given the empty set, as defined in Type Derivation OK (Simple) ($3.14.6),
+ * then every whitespace-delimited substring of the string must be a `declared
+ * entity name`.
*/
/*
* 2.3 otherwise no further condition applies.
if (WXS_IS_ANY_SIMPLE_TYPE(type) || WXS_IS_ATOMIC(type)) {
xmlSchemaTypePtr biType; /* The built-in type. */
/*
- * SPEC (1.2.1) "if {variety} is �atomic� then the string must �match�
- * a literal in the �lexical space� of {base type definition}"
+ * SPEC (1.2.1) "if {variety} is `atomic` then the string must `match`
+ * a literal in the `lexical space` of {base type definition}"
*/
/*
* Whitespace-normalize.
xmlChar *tmpValue = NULL;
unsigned long len = 0;
xmlSchemaValPtr prevVal = NULL, curVal = NULL;
- /* 1.2.2 if {variety} is �list� then the string must be a sequence
- * of white space separated tokens, each of which �match�es a literal
- * in the �lexical space� of {item type definition}
+ /* 1.2.2 if {variety} is `list` then the string must be a sequence
+ * of white space separated tokens, each of which `match`es a literal
+ * in the `lexical space` of {item type definition}
*/
/*
* Note that XML_SCHEMAS_TYPE_NORMVALUENEEDED will be set if
} else if (WXS_IS_UNION(type)) {
xmlSchemaTypeLinkPtr memberLink;
/*
- * TODO: For all datatypes �derived� by �union� whiteSpace does
- * not apply directly; however, the normalization behavior of �union�
+ * TODO: For all datatypes `derived` by `union` whiteSpace does
+ * not apply directly; however, the normalization behavior of `union`
* types is controlled by the value of whiteSpace on that one of the
- * �memberTypes� against which the �union� is successfully validated.
+ * `memberTypes` against which the `union` is successfully validated.
*
* This means that the value is normalized by the first validating
* member type, then the facets of the union type are applied. This
*/
/*
- * 1.2.3 if {variety} is �union� then the string must �match� a
- * literal in the �lexical space� of at least one member of
+ * 1.2.3 if {variety} is `union` then the string must `match` a
+ * literal in the `lexical space` of at least one member of
* {member type definitions}
*/
memberLink = xmlSchemaGetUnionSimpleTypeMemberTypes(type);
*/
if ((ret == 0) && (type->flags & XML_SCHEMAS_TYPE_HAS_FACETS)) {
/*
- * The normalization behavior of �union� types is controlled by
- * the value of whiteSpace on that one of the �memberTypes�
- * against which the �union� is successfully validated.
+ * The normalization behavior of `union` types is controlled by
+ * the value of whiteSpace on that one of the `memberTypes`
+ * against which the `union` is successfully validated.
*/
NORMALIZE(memberLink->type);
ret = xmlSchemaValidateFacets(actxt, node, type,
/*
* SPEC cvc-elt (3.3.4) : (4.3) (Type Derivation OK)
- * "The �local type definition� must be validly
+ * "The `local type definition` must be validly
* derived from the {type definition} given the union of
* the {disallowed substitutions} and the {type definition}'s
* {prohibited substitutions}, as defined in
- * Type Derivation OK (Complex) (�3.4.6)
+ * Type Derivation OK (Complex) ($3.4.6)
* (if it is a complex type definition),
* or given {disallowed substitutions} as defined in Type
- * Derivation OK (Simple) (�3.14.6) (if it is a simple type
+ * Derivation OK (Simple) ($3.14.6) (if it is a simple type
* definition)."
*
* {disallowed substitutions}: the "block" on the element decl.
/*
* SPEC (cvc-attribute)
- * (1) "The declaration must not be �absent� (see Missing
- * Sub-components (�5.3) for how this can fail to be
+ * (1) "The declaration must not be `absent` (see Missing
+ * Sub-components ($5.3) for how this can fail to be
* the case)."
* (2) "Its {type definition} must not be absent."
*
* use with an {attribute declaration} whose {name} matches
* the attribute information item's [local name] and whose
* {target namespace} is identical to the attribute information
- * item's [namespace name] (where an �absent� {target namespace}
+ * item's [namespace name] (where an `absent` {target namespace}
* is taken to be identical to a [namespace name] with no value),
- * then the attribute information must be �valid� with respect
+ * then the attribute information must be `valid` with respect
* to that attribute use as per Attribute Locally Valid (Use)
- * (�3.5.4). In this case the {attribute declaration} of that
- * attribute use is the �context-determined declaration� for the
+ * ($3.5.4). In this case the {attribute declaration} of that
+ * attribute use is the `context-determined declaration` for the
* attribute information item with respect to Schema-Validity
- * Assessment (Attribute) (�3.2.4) and
- * Assessment Outcome (Attribute) (�3.2.5).
+ * Assessment (Attribute) ($3.2.4) and
+ * Assessment Outcome (Attribute) ($3.2.5).
*/
iattr->state = XML_SCHEMAS_ATTR_ASSESSED;
iattr->use = attrUse;
continue;
/*
* SPEC (cvc-complex-type)
- * (3.2.2) "The attribute information item must be �valid� with
- * respect to it as defined in Item Valid (Wildcard) (�3.10.4)."
+ * (3.2.2) "The attribute information item must be `valid` with
+ * respect to it as defined in Item Valid (Wildcard) ($3.10.4)."
*
* SPEC Item Valid (Wildcard) (cvc-wildcard)
- * "... its [namespace name] must be �valid� with respect to
+ * "... its [namespace name] must be `valid` with respect to
* the wildcard constraint, as defined in Wildcard allows
- * Namespace Name (�3.10.4)."
+ * Namespace Name ($3.10.4)."
*/
if (xmlSchemaCheckCVCWildcardNamespace(type->attributeWildcard,
iattr->nsName) == 0) {
* SPEC (cvc-complex-type)
* (5) "Let [Definition:] the wild IDs be the set of
* all attribute information item to which clause 3.2
- * applied and whose �validation� resulted in a
- * �context-determined declaration� of mustFind or no
- * �context-determined declaration� at all, and whose
+ * applied and whose `validation` resulted in a
+ * `context-determined declaration` of mustFind or no
+ * `context-determined declaration` at all, and whose
* [local name] and [namespace name] resolve (as
- * defined by QName resolution (Instance) (�3.15.4)) to
+ * defined by QName resolution (Instance) ($3.15.4)) to
* an attribute declaration whose {type definition} is
* or is derived from ID. Then all of the following
* must be true:"
iattr->typeDef, XML_SCHEMAS_ID)) {
/*
* SPEC (5.1) "There must be no more than one
- * item in �wild IDs�."
+ * item in `wild IDs`."
*/
if (wildIDs != 0) {
/* VAL TODO */
wildIDs++;
/*
* SPEC (cvc-complex-type)
- * (5.2) "If �wild IDs� is non-empty, there must not
+ * (5.2) "If `wild IDs` is non-empty, there must not
* be any attribute uses among the {attribute uses}
* whose {attribute declaration}'s {type definition}
* is or is derived from ID."
fixed = 0;
/*
* SPEC (cvc-attribute)
- * (3) "The item's �normalized value� must be locally �valid�
+ * (3) "The item's `normalized value` must be locally `valid`
* with respect to that {type definition} as per
- * String Valid (�3.14.4)."
+ * String Valid ($3.14.4)."
*
* VAL TODO: Do we already have the
* "normalized attribute value" here?
if (fixed) {
/*
* SPEC Attribute Locally Valid (Use) (cvc-au)
- * "For an attribute information item to be�valid�
+ * "For an attribute information item to be `valid`
* with respect to an attribute use its *normalized*
- * value� must match the *canonical* lexical
+ * value must match the *canonical* lexical
* representation of the attribute use's {value
* constraint}value, if it is present and fixed."
*
*/
/*
* SPEC Attribute Locally Valid (cvc-attribute)
- * (4) "The item's *actual* value� must match the *value* of
+ * (4) "The item's *actual* value must match the *value* of
* the {value constraint}, if it is present and fixed."
*/
if (iattr->val == NULL) {
* SPEC (2.1) "its {content type} must be a simple type definition
* or mixed."
* SPEC (2.2.2) "If the {content type} is mixed, then the {content
- * type}'s particle must be �emptiable� as defined by
- * Particle Emptiable (�3.9.6)."
+ * type}'s particle must be `emptiable` as defined by
+ * Particle Emptiable ($3.9.6)."
*/
if ((! WXS_HAS_SIMPLE_CONTENT(inode->typeDef)) &&
((! WXS_HAS_MIXED_CONTENT(inode->typeDef)) ||
}
/*
* 1 If the type definition is a simple type definition, then the string
- * must be �valid� with respect to that definition as defined by String
- * Valid (�3.14.4).
+ * must be `valid` with respect to that definition as defined by String
+ * Valid ($3.14.4).
*
* AND
*
* 2.2.1 If the {content type} is a simple type definition, then the
- * string must be �valid� with respect to that simple type definition
- * as defined by String Valid (�3.14.4).
+ * string must be `valid` with respect to that simple type definition
+ * as defined by String Valid ($3.14.4).
*/
if (WXS_IS_SIMPLE(inode->typeDef)) {
(! INODE_NILLED(inode))) {
/*
* cvc-elt (3.3.4) : 5.1.1
- * If the �actual type definition� is a �local type definition�
+ * If the `actual type definition` is a `local type definition`
* then the canonical lexical representation of the {value constraint}
- * value must be a valid default for the �actual type definition� as
- * defined in Element Default Valid (Immediate) (�3.3.6).
+ * value must be a valid default for the `actual type definition` as
+ * defined in Element Default Valid (Immediate) ($3.3.6).
*/
/*
* NOTE: 'local' above means types acquired by xsi:type.
* cvc-elt (3.3.4) : 5.1.2
* The element information item with the canonical lexical
* representation of the {value constraint} value used as its
- * �normalized value� must be �valid� with respect to the
- * �actual type definition� as defined by Element Locally Valid (Type)
- * (�3.3.4).
+ * `normalized value` must be `valid` with respect to the
+ * `actual type definition` as defined by Element Locally Valid (Type)
+ * ($3.3.4).
*/
if (WXS_IS_SIMPLE(inode->typeDef)) {
ret = xmlSchemaVCheckINodeDataType(vctxt,
} else if (! INODE_NILLED(inode)) {
/*
- * 5.2.1 The element information item must be �valid� with respect
- * to the �actual type definition� as defined by Element Locally
- * Valid (Type) (�3.3.4).
+ * 5.2.1 The element information item must be `valid` with respect
+ * to the `actual type definition` as defined by Element Locally
+ * Valid (Type) ($3.3.4).
*/
if (WXS_IS_SIMPLE(inode->typeDef)) {
/*
* SPEC (cvc-type) (3.1)
* "If the type definition is a simple type definition, ..."
* (3.1.3) "If clause 3.2 of Element Locally Valid
- * (Element) (�3.3.4) did not apply, then the �normalized value�
- * must be �valid� with respect to the type definition as defined
- * by String Valid (�3.14.4).
+ * (Element) ($3.3.4) did not apply, then the `normalized value`
+ * must be `valid` with respect to the type definition as defined
+ * by String Valid ($3.14.4).
*/
ret = xmlSchemaVCheckINodeDataType(vctxt,
inode, inode->typeDef, inode->value);
/*
* SPEC (cvc-type) (3.2) "If the type definition is a complex type
* definition, then the element information item must be
- * �valid� with respect to the type definition as per
- * Element Locally Valid (Complex Type) (�3.4.4);"
+ * `valid` with respect to the type definition as per
+ * Element Locally Valid (Complex Type) ($3.4.4);"
*
* SPEC (cvc-complex-type) (2.2)
* "If the {content type} is a simple type definition, ...
- * the �normalized value� of the element information item is
- * �valid� with respect to that simple type definition as
- * defined by String Valid (�3.14.4)."
+ * the `normalized value` of the element information item is
+ * `valid` with respect to that simple type definition as
+ * defined by String Valid ($3.14.4)."
*/
ret = xmlSchemaVCheckINodeDataType(vctxt,
inode, inode->typeDef->contentTypeDef, inode->value);
*/
if (WXS_HAS_MIXED_CONTENT(inode->typeDef)) {
/*
- * 5.2.2.2.1 If the {content type} of the �actual type
- * definition� is mixed, then the *initial value* of the
+ * 5.2.2.2.1 If the {content type} of the `actual type
+ * definition` is mixed, then the *initial value* of the
* item must match the canonical lexical representation
* of the {value constraint} value.
*
}
} else if (WXS_HAS_SIMPLE_CONTENT(inode->typeDef)) {
/*
- * 5.2.2.2.2 If the {content type} of the �actual type
- * definition� is a simple type definition, then the
+ * 5.2.2.2.2 If the {content type} of the `actual type
+ * definition` is a simple type definition, then the
* *actual value* of the item must match the canonical
* lexical representation of the {value constraint} value.
*/
goto internal_error;
/*
* MAYBE TODO:
- * SPEC (6) "The element information item must be �valid� with
+ * SPEC (6) "The element information item must be `valid` with
* respect to each of the {identity-constraint definitions} as per
- * Identity-constraint Satisfied (�3.11.4)."
+ * Identity-constraint Satisfied ($3.11.4)."
*/
/*
* PSVI TODO: If we expose IDC node-tables via PSVI then the tables
vctxt->depth--;
vctxt->inode = vctxt->elemInfos[vctxt->depth];
/*
- * VAL TODO: 7 If the element information item is the �validation root�, it must be
- * �valid� per Validation Root Valid (ID/IDREF) (�3.3.4).
+ * VAL TODO: 7 If the element information item is the `validation root`, it must be
+ * `valid` per Validation Root Valid (ID/IDREF) ($3.3.4).
*/
return (ret);
* Fallback to "anyType".
*
* SPEC (cvc-assess-elt)
- * "If the item cannot be �strictly assessed�, [...]
+ * "If the item cannot be `strictly assessed`, [...]
* an element information item's schema validity may be laxly
- * assessed if its �context-determined declaration� is not
- * skip by �validating� with respect to the �ur-type
- * definition� as per Element Locally Valid (Type) (�3.3.4)."
+ * assessed if its `context-determined declaration` is not
+ * skip by `validating` with respect to the `ur-type
+ * definition` as per Element Locally Valid (Type) ($3.3.4)."
*/
vctxt->inode->typeDef =
xmlSchemaGetBuiltInType(XML_SCHEMAS_ANYTYPE);
* SPEC (2.4) "If the {content type} is element-only or mixed,
* then the sequence of the element information item's
* element information item [children], if any, taken in
- * order, is �valid� with respect to the {content type}'s
+ * order, is `valid` with respect to the {content type}'s
* particle, as defined in Element Sequence Locally Valid
- * (Particle) (�3.9.4)."
+ * (Particle) ($3.9.4)."
*/
ret = xmlRegExecPushString2(regexCtxt,
vctxt->inode->localName,
}
ret->type = XML_SCHEMA_FACET_MINLENGTH;
ret->val = xmlSchemaNewValue(XML_SCHEMAS_NNINTEGER);
+ if (ret->val == NULL) {
+ xmlFree(ret);
+ return(NULL);
+ }
ret->val->value.decimal.lo = value;
return (ret);
}
* Coverity detected an overrun in daysInMonth
* of size 12 at position 12 with index variable "((r)->mon - 1)"
*/
- if (tmon < 0)
- tmon = 0;
+ if (tmon < 1)
+ tmon = 1;
if (tmon > 12)
tmon = 12;
tempdays += MAX_DAYINMONTH(tyr, tmon);
carry = -1;
- } else if (tempdays > (long) MAX_DAYINMONTH(r->year, r->mon)) {
+ } else if (VALID_YEAR(r->year) && VALID_MONTH(r->mon) &&
+ tempdays > (long) MAX_DAYINMONTH(r->year, r->mon)) {
tempdays = tempdays - MAX_DAYINMONTH(r->year, r->mon);
carry = 1;
} else
if (y->type == XML_SCHEMAS_STRING)
yws = XML_SCHEMA_WHITESPACE_PRESERVE;
- else if (x->type == XML_SCHEMAS_NORMSTRING)
+ else if (y->type == XML_SCHEMAS_NORMSTRING)
yws = XML_SCHEMA_WHITESPACE_REPLACE;
else
yws = XML_SCHEMA_WHITESPACE_COLLAPSE;
* @val: the precomputed value
* @retValue: the returned value
*
- * Get a the cononical lexical representation of the value.
+ * Get the canonical lexical representation of the value.
* The caller has to FREE the returned retValue.
*
* WARNING: Some value types are not supported yet, resulting
* @retValue: the returned value
* @ws: the whitespace type of the value
*
- * Get a the cononical representation of the value.
+ * Get the canonical representation of the value.
* The caller has to free the returned @retValue.
*
* Returns 0 if the value could be built, 1 if the value type is
/*
* The following VA_COPY was coded following an example in
* the Samba project. It may not be sufficient for some
- * esoteric implementations of va_list (i.e. it may need
- * something involving a memcpy) but (hopefully) will be
- * sufficient for libxml2.
+ * esoteric implementations of va_list but (hopefully) will
+ * be sufficient for libxml2.
*/
#ifndef VA_COPY
#ifdef HAVE_VA_COPY
#ifdef HAVE___VA_COPY
#define VA_COPY(dest,src) __va_copy(dest, src)
#else
- #define VA_COPY(dest,src) (dest) = (src)
+ #ifndef VA_LIST_IS_ARRAY
+ #define VA_COPY(dest,src) (dest) = (src)
+ #else
+ #include <string.h>
+ #define VA_COPY(dest,src) memcpy((char *)(dest),(char *)(src),sizeof(va_list))
+ #endif
#endif
#endif
#endif
if (count == -1)
return -1;
sum += count;
- count = xmlTextWriterWriteString(writer, content);
- if (count == -1)
- return -1;
- sum += count;
+ if (content != NULL) {
+ count = xmlTextWriterWriteString(writer, content);
+ if (count == -1)
+ return -1;
+ sum += count;
+ }
count = xmlTextWriterEndElement(writer);
if (count == -1)
return -1;
* any use of the macros IS_ASCII_CHARACTER and IS_ASCII_DIGIT)
*/
+#ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON
+/**
+ * xmlXPathCmpNodesExt:
+ * @node1: the first node
+ * @node2: the second node
+ *
+ * Compare two nodes w.r.t document order.
+ * This one is optimized for handling of non-element nodes.
+ *
+ * Returns -2 in case of error 1 if first point < second point, 0 if
+ * it's the same node, -1 otherwise
+ */
+static int
+xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
+ int depth1, depth2;
+ int misc = 0, precedence1 = 0, precedence2 = 0;
+ xmlNodePtr miscNode1 = NULL, miscNode2 = NULL;
+ xmlNodePtr cur, root;
+ long l1, l2;
+
+ if ((node1 == NULL) || (node2 == NULL))
+ return(-2);
+
+ if (node1 == node2)
+ return(0);
+
+ /*
+ * a couple of optimizations which will avoid computations in most cases
+ */
+ switch (node1->type) {
+ case XML_ELEMENT_NODE:
+ if (node2->type == XML_ELEMENT_NODE) {
+ if ((0 > (long) node1->content) && /* TODO: Would a != 0 suffice here? */
+ (0 > (long) node2->content) &&
+ (node1->doc == node2->doc))
+ {
+ l1 = -((long) node1->content);
+ l2 = -((long) node2->content);
+ if (l1 < l2)
+ return(1);
+ if (l1 > l2)
+ return(-1);
+ } else
+ goto turtle_comparison;
+ }
+ break;
+ case XML_ATTRIBUTE_NODE:
+ precedence1 = 1; /* element is owner */
+ miscNode1 = node1;
+ node1 = node1->parent;
+ misc = 1;
+ break;
+ case XML_TEXT_NODE:
+ case XML_CDATA_SECTION_NODE:
+ case XML_COMMENT_NODE:
+ case XML_PI_NODE: {
+ miscNode1 = node1;
+ /*
+ * Find nearest element node.
+ */
+ if (node1->prev != NULL) {
+ do {
+ node1 = node1->prev;
+ if (node1->type == XML_ELEMENT_NODE) {
+ precedence1 = 3; /* element in prev-sibl axis */
+ break;
+ }
+ if (node1->prev == NULL) {
+ precedence1 = 2; /* element is parent */
+ /*
+ * URGENT TODO: Are there any cases, where the
+ * parent of such a node is not an element node?
+ */
+ node1 = node1->parent;
+ break;
+ }
+ } while (1);
+ } else {
+ precedence1 = 2; /* element is parent */
+ node1 = node1->parent;
+ }
+ if ((node1 == NULL) || (node1->type != XML_ELEMENT_NODE) ||
+ (0 <= (long) node1->content)) {
+ /*
+ * Fallback for whatever case.
+ */
+ node1 = miscNode1;
+ precedence1 = 0;
+ } else
+ misc = 1;
+ }
+ break;
+ case XML_NAMESPACE_DECL:
+ /*
+ * TODO: why do we return 1 for namespace nodes?
+ */
+ return(1);
+ default:
+ break;
+ }
+ switch (node2->type) {
+ case XML_ELEMENT_NODE:
+ break;
+ case XML_ATTRIBUTE_NODE:
+ precedence2 = 1; /* element is owner */
+ miscNode2 = node2;
+ node2 = node2->parent;
+ misc = 1;
+ break;
+ case XML_TEXT_NODE:
+ case XML_CDATA_SECTION_NODE:
+ case XML_COMMENT_NODE:
+ case XML_PI_NODE: {
+ miscNode2 = node2;
+ if (node2->prev != NULL) {
+ do {
+ node2 = node2->prev;
+ if (node2->type == XML_ELEMENT_NODE) {
+ precedence2 = 3; /* element in prev-sibl axis */
+ break;
+ }
+ if (node2->prev == NULL) {
+ precedence2 = 2; /* element is parent */
+ node2 = node2->parent;
+ break;
+ }
+ } while (1);
+ } else {
+ precedence2 = 2; /* element is parent */
+ node2 = node2->parent;
+ }
+ if ((node2 == NULL) || (node2->type != XML_ELEMENT_NODE) ||
+ (0 <= (long) node2->content))
+ {
+ node2 = miscNode2;
+ precedence2 = 0;
+ } else
+ misc = 1;
+ }
+ break;
+ case XML_NAMESPACE_DECL:
+ return(1);
+ default:
+ break;
+ }
+ if (misc) {
+ if (node1 == node2) {
+ if (precedence1 == precedence2) {
+ /*
+ * The ugly case; but normally there aren't many
+ * adjacent non-element nodes around.
+ */
+ cur = miscNode2->prev;
+ while (cur != NULL) {
+ if (cur == miscNode1)
+ return(1);
+ if (cur->type == XML_ELEMENT_NODE)
+ return(-1);
+ cur = cur->prev;
+ }
+ return (-1);
+ } else {
+ /*
+ * Evaluate based on higher precedence wrt to the element.
+ * TODO: This assumes attributes are sorted before content.
+ * Is this 100% correct?
+ */
+ if (precedence1 < precedence2)
+ return(1);
+ else
+ return(-1);
+ }
+ }
+ /*
+ * Special case: One of the helper-elements is contained by the other.
+ * <foo>
+ * <node2>
+ * <node1>Text-1(precedence1 == 2)</node1>
+ * </node2>
+ * Text-6(precedence2 == 3)
+ * </foo>
+ */
+ if ((precedence2 == 3) && (precedence1 > 1)) {
+ cur = node1->parent;
+ while (cur) {
+ if (cur == node2)
+ return(1);
+ cur = cur->parent;
+ }
+ }
+ if ((precedence1 == 3) && (precedence2 > 1)) {
+ cur = node2->parent;
+ while (cur) {
+ if (cur == node1)
+ return(-1);
+ cur = cur->parent;
+ }
+ }
+ }
+
+ /*
+ * Speedup using document order if availble.
+ */
+ if ((node1->type == XML_ELEMENT_NODE) &&
+ (node2->type == XML_ELEMENT_NODE) &&
+ (0 > (long) node1->content) &&
+ (0 > (long) node2->content) &&
+ (node1->doc == node2->doc)) {
+
+ l1 = -((long) node1->content);
+ l2 = -((long) node2->content);
+ if (l1 < l2)
+ return(1);
+ if (l1 > l2)
+ return(-1);
+ }
+
+turtle_comparison:
+
+ if (node1 == node2->prev)
+ return(1);
+ if (node1 == node2->next)
+ return(-1);
+ /*
+ * compute depth to root
+ */
+ for (depth2 = 0, cur = node2;cur->parent != NULL;cur = cur->parent) {
+ if (cur == node1)
+ return(1);
+ depth2++;
+ }
+ root = cur;
+ for (depth1 = 0, cur = node1;cur->parent != NULL;cur = cur->parent) {
+ if (cur == node2)
+ return(-1);
+ depth1++;
+ }
+ /*
+ * Distinct document (or distinct entities :-( ) case.
+ */
+ if (root != cur) {
+ return(-2);
+ }
+ /*
+ * get the nearest common ancestor.
+ */
+ while (depth1 > depth2) {
+ depth1--;
+ node1 = node1->parent;
+ }
+ while (depth2 > depth1) {
+ depth2--;
+ node2 = node2->parent;
+ }
+ while (node1->parent != node2->parent) {
+ node1 = node1->parent;
+ node2 = node2->parent;
+ /* should not happen but just in case ... */
+ if ((node1 == NULL) || (node2 == NULL))
+ return(-2);
+ }
+ /*
+ * Find who's first.
+ */
+ if (node1 == node2->prev)
+ return(1);
+ if (node1 == node2->next)
+ return(-1);
+ /*
+ * Speedup using document order if availble.
+ */
+ if ((node1->type == XML_ELEMENT_NODE) &&
+ (node2->type == XML_ELEMENT_NODE) &&
+ (0 > (long) node1->content) &&
+ (0 > (long) node2->content) &&
+ (node1->doc == node2->doc)) {
+
+ l1 = -((long) node1->content);
+ l2 = -((long) node2->content);
+ if (l1 < l2)
+ return(1);
+ if (l1 > l2)
+ return(-1);
+ }
+
+ for (cur = node1->next;cur != NULL;cur = cur->next)
+ if (cur == node2)
+ return(1);
+ return(-1); /* assume there is no sibling list corruption */
+}
+#endif /* XP_OPTIMIZED_NON_ELEM_COMPARISON */
+
/*
* Wrapper for the Timsort argorithm from timsort.h
*/
static
int wrap_cmp( xmlNodePtr x, xmlNodePtr y );
#ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON
- static int xmlXPathCmpNodesExt(xmlNodePtr, xmlNodePtr);
static int wrap_cmp( xmlNodePtr x, xmlNodePtr y )
{
int res = xmlXPathCmpNodesExt(x, y);
"Encoding error\n",
"Char out of XML range\n",
"Invalid or incomplete context\n",
- "Stack usage errror\n",
+ "Stack usage error\n",
"Forbidden variable\n",
"?? Unknown error ??\n" /* Must be last in the list! */
};
fraction_place, number);
}
+ /* Remove leading spaces sometimes inserted by snprintf */
+ while (work[0] == ' ') {
+ for (ptr = &work[0];(ptr[0] = ptr[1]);ptr++);
+ size--;
+ }
+
/* Remove fractional trailing zeroes */
after_fraction = work + size;
ptr = after_fraction;
}
do {
cur = cur->parent;
- if (cur == NULL)
- break;
- if (cur == (xmlNodePtr) doc) {
- cur = NULL;
- break;
- }
- if (cur->next != NULL) {
- cur = cur->next;
- break;
- }
- } while (cur != NULL);
- }
- return(count);
-}
-
-/**
- * xmlXPathCmpNodes:
- * @node1: the first node
- * @node2: the second node
- *
- * Compare two nodes w.r.t document order
- *
- * Returns -2 in case of error 1 if first point < second point, 0 if
- * it's the same node, -1 otherwise
- */
-int
-xmlXPathCmpNodes(xmlNodePtr node1, xmlNodePtr node2) {
- int depth1, depth2;
- int attr1 = 0, attr2 = 0;
- xmlNodePtr attrNode1 = NULL, attrNode2 = NULL;
- xmlNodePtr cur, root;
-
- if ((node1 == NULL) || (node2 == NULL))
- return(-2);
- /*
- * a couple of optimizations which will avoid computations in most cases
- */
- if (node1 == node2) /* trivial case */
- return(0);
- if (node1->type == XML_ATTRIBUTE_NODE) {
- attr1 = 1;
- attrNode1 = node1;
- node1 = node1->parent;
- }
- if (node2->type == XML_ATTRIBUTE_NODE) {
- attr2 = 1;
- attrNode2 = node2;
- node2 = node2->parent;
- }
- if (node1 == node2) {
- if (attr1 == attr2) {
- /* not required, but we keep attributes in order */
- if (attr1 != 0) {
- cur = attrNode2->prev;
- while (cur != NULL) {
- if (cur == attrNode1)
- return (1);
- cur = cur->prev;
- }
- return (-1);
- }
- return(0);
- }
- if (attr2 == 1)
- return(1);
- return(-1);
- }
- if ((node1->type == XML_NAMESPACE_DECL) ||
- (node2->type == XML_NAMESPACE_DECL))
- return(1);
- if (node1 == node2->prev)
- return(1);
- if (node1 == node2->next)
- return(-1);
-
- /*
- * Speedup using document order if availble.
- */
- if ((node1->type == XML_ELEMENT_NODE) &&
- (node2->type == XML_ELEMENT_NODE) &&
- (0 > (long) node1->content) &&
- (0 > (long) node2->content) &&
- (node1->doc == node2->doc)) {
- long l1, l2;
-
- l1 = -((long) node1->content);
- l2 = -((long) node2->content);
- if (l1 < l2)
- return(1);
- if (l1 > l2)
- return(-1);
- }
-
- /*
- * compute depth to root
- */
- for (depth2 = 0, cur = node2;cur->parent != NULL;cur = cur->parent) {
- if (cur == node1)
- return(1);
- depth2++;
- }
- root = cur;
- for (depth1 = 0, cur = node1;cur->parent != NULL;cur = cur->parent) {
- if (cur == node2)
- return(-1);
- depth1++;
- }
- /*
- * Distinct document (or distinct entities :-( ) case.
- */
- if (root != cur) {
- return(-2);
- }
- /*
- * get the nearest common ancestor.
- */
- while (depth1 > depth2) {
- depth1--;
- node1 = node1->parent;
- }
- while (depth2 > depth1) {
- depth2--;
- node2 = node2->parent;
- }
- while (node1->parent != node2->parent) {
- node1 = node1->parent;
- node2 = node2->parent;
- /* should not happen but just in case ... */
- if ((node1 == NULL) || (node2 == NULL))
- return(-2);
- }
- /*
- * Find who's first.
- */
- if (node1 == node2->prev)
- return(1);
- if (node1 == node2->next)
- return(-1);
- /*
- * Speedup using document order if availble.
- */
- if ((node1->type == XML_ELEMENT_NODE) &&
- (node2->type == XML_ELEMENT_NODE) &&
- (0 > (long) node1->content) &&
- (0 > (long) node2->content) &&
- (node1->doc == node2->doc)) {
- long l1, l2;
-
- l1 = -((long) node1->content);
- l2 = -((long) node2->content);
- if (l1 < l2)
- return(1);
- if (l1 > l2)
- return(-1);
+ if (cur == NULL)
+ break;
+ if (cur == (xmlNodePtr) doc) {
+ cur = NULL;
+ break;
+ }
+ if (cur->next != NULL) {
+ cur = cur->next;
+ break;
+ }
+ } while (cur != NULL);
}
-
- for (cur = node1->next;cur != NULL;cur = cur->next)
- if (cur == node2)
- return(1);
- return(-1); /* assume there is no sibling list corruption */
+ return(count);
}
-#ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON
/**
- * xmlXPathCmpNodesExt:
+ * xmlXPathCmpNodes:
* @node1: the first node
* @node2: the second node
*
- * Compare two nodes w.r.t document order.
- * This one is optimized for handling of non-element nodes.
+ * Compare two nodes w.r.t document order
*
* Returns -2 in case of error 1 if first point < second point, 0 if
* it's the same node, -1 otherwise
*/
-static int
-xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
+int
+xmlXPathCmpNodes(xmlNodePtr node1, xmlNodePtr node2) {
int depth1, depth2;
- int misc = 0, precedence1 = 0, precedence2 = 0;
- xmlNodePtr miscNode1 = NULL, miscNode2 = NULL;
+ int attr1 = 0, attr2 = 0;
+ xmlNodePtr attrNode1 = NULL, attrNode2 = NULL;
xmlNodePtr cur, root;
- long l1, l2;
if ((node1 == NULL) || (node2 == NULL))
return(-2);
-
- if (node1 == node2)
- return(0);
-
/*
* a couple of optimizations which will avoid computations in most cases
*/
- switch (node1->type) {
- case XML_ELEMENT_NODE:
- if (node2->type == XML_ELEMENT_NODE) {
- if ((0 > (long) node1->content) && /* TODO: Would a != 0 suffice here? */
- (0 > (long) node2->content) &&
- (node1->doc == node2->doc))
- {
- l1 = -((long) node1->content);
- l2 = -((long) node2->content);
- if (l1 < l2)
- return(1);
- if (l1 > l2)
- return(-1);
- } else
- goto turtle_comparison;
- }
- break;
- case XML_ATTRIBUTE_NODE:
- precedence1 = 1; /* element is owner */
- miscNode1 = node1;
- node1 = node1->parent;
- misc = 1;
- break;
- case XML_TEXT_NODE:
- case XML_CDATA_SECTION_NODE:
- case XML_COMMENT_NODE:
- case XML_PI_NODE: {
- miscNode1 = node1;
- /*
- * Find nearest element node.
- */
- if (node1->prev != NULL) {
- do {
- node1 = node1->prev;
- if (node1->type == XML_ELEMENT_NODE) {
- precedence1 = 3; /* element in prev-sibl axis */
- break;
- }
- if (node1->prev == NULL) {
- precedence1 = 2; /* element is parent */
- /*
- * URGENT TODO: Are there any cases, where the
- * parent of such a node is not an element node?
- */
- node1 = node1->parent;
- break;
- }
- } while (1);
- } else {
- precedence1 = 2; /* element is parent */
- node1 = node1->parent;
- }
- if ((node1 == NULL) || (node1->type != XML_ELEMENT_NODE) ||
- (0 <= (long) node1->content)) {
- /*
- * Fallback for whatever case.
- */
- node1 = miscNode1;
- precedence1 = 0;
- } else
- misc = 1;
- }
- break;
- case XML_NAMESPACE_DECL:
- /*
- * TODO: why do we return 1 for namespace nodes?
- */
- return(1);
- default:
- break;
+ if (node1 == node2) /* trivial case */
+ return(0);
+ if (node1->type == XML_ATTRIBUTE_NODE) {
+ attr1 = 1;
+ attrNode1 = node1;
+ node1 = node1->parent;
}
- switch (node2->type) {
- case XML_ELEMENT_NODE:
- break;
- case XML_ATTRIBUTE_NODE:
- precedence2 = 1; /* element is owner */
- miscNode2 = node2;
- node2 = node2->parent;
- misc = 1;
- break;
- case XML_TEXT_NODE:
- case XML_CDATA_SECTION_NODE:
- case XML_COMMENT_NODE:
- case XML_PI_NODE: {
- miscNode2 = node2;
- if (node2->prev != NULL) {
- do {
- node2 = node2->prev;
- if (node2->type == XML_ELEMENT_NODE) {
- precedence2 = 3; /* element in prev-sibl axis */
- break;
- }
- if (node2->prev == NULL) {
- precedence2 = 2; /* element is parent */
- node2 = node2->parent;
- break;
- }
- } while (1);
- } else {
- precedence2 = 2; /* element is parent */
- node2 = node2->parent;
- }
- if ((node2 == NULL) || (node2->type != XML_ELEMENT_NODE) ||
- (0 <= (long) node1->content))
- {
- node2 = miscNode2;
- precedence2 = 0;
- } else
- misc = 1;
- }
- break;
- case XML_NAMESPACE_DECL:
- return(1);
- default:
- break;
+ if (node2->type == XML_ATTRIBUTE_NODE) {
+ attr2 = 1;
+ attrNode2 = node2;
+ node2 = node2->parent;
}
- if (misc) {
- if (node1 == node2) {
- if (precedence1 == precedence2) {
- /*
- * The ugly case; but normally there aren't many
- * adjacent non-element nodes around.
- */
- cur = miscNode2->prev;
+ if (node1 == node2) {
+ if (attr1 == attr2) {
+ /* not required, but we keep attributes in order */
+ if (attr1 != 0) {
+ cur = attrNode2->prev;
while (cur != NULL) {
- if (cur == miscNode1)
- return(1);
- if (cur->type == XML_ELEMENT_NODE)
- return(-1);
+ if (cur == attrNode1)
+ return (1);
cur = cur->prev;
}
return (-1);
- } else {
- /*
- * Evaluate based on higher precedence wrt to the element.
- * TODO: This assumes attributes are sorted before content.
- * Is this 100% correct?
- */
- if (precedence1 < precedence2)
- return(1);
- else
- return(-1);
- }
- }
- /*
- * Special case: One of the helper-elements is contained by the other.
- * <foo>
- * <node2>
- * <node1>Text-1(precedence1 == 2)</node1>
- * </node2>
- * Text-6(precedence2 == 3)
- * </foo>
- */
- if ((precedence2 == 3) && (precedence1 > 1)) {
- cur = node1->parent;
- while (cur) {
- if (cur == node2)
- return(1);
- cur = cur->parent;
- }
- }
- if ((precedence1 == 3) && (precedence2 > 1)) {
- cur = node2->parent;
- while (cur) {
- if (cur == node1)
- return(-1);
- cur = cur->parent;
}
+ return(0);
}
+ if (attr2 == 1)
+ return(1);
+ return(-1);
}
+ if ((node1->type == XML_NAMESPACE_DECL) ||
+ (node2->type == XML_NAMESPACE_DECL))
+ return(1);
+ if (node1 == node2->prev)
+ return(1);
+ if (node1 == node2->next)
+ return(-1);
/*
* Speedup using document order if availble.
(0 > (long) node1->content) &&
(0 > (long) node2->content) &&
(node1->doc == node2->doc)) {
+ long l1, l2;
l1 = -((long) node1->content);
l2 = -((long) node2->content);
return(-1);
}
-turtle_comparison:
-
- if (node1 == node2->prev)
- return(1);
- if (node1 == node2->next)
- return(-1);
/*
* compute depth to root
*/
(0 > (long) node1->content) &&
(0 > (long) node2->content) &&
(node1->doc == node2->doc)) {
+ long l1, l2;
l1 = -((long) node1->content);
l2 = -((long) node2->content);
return(1);
return(-1); /* assume there is no sibling list corruption */
}
-#endif /* XP_OPTIMIZED_NON_ELEM_COMPARISON */
/**
* xmlXPathNodeSetSort:
if (axis == AXIS_ATTRIBUTE) {
if (cur->type == XML_ATTRIBUTE_NODE)
{
- XP_TEST_HIT
+ if (prefix == NULL)
+ {
+ XP_TEST_HIT
+ } else if ((cur->ns != NULL) &&
+ (xmlStrEqual(URI, cur->ns->href)))
+ {
+ XP_TEST_HIT
+ }
}
} else if (axis == AXIS_NAMESPACE) {
if (cur->type == XML_NAMESPACE_DECL)
int frame;
frame = xmlXPathSetFrame(ctxt);
- if (op->ch1 != -1)
+ if (op->ch1 != -1) {
total +=
xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
- if (ctxt->valueNr < op->value) {
+ if (ctxt->error != XPATH_EXPRESSION_OK) {
+ xmlXPathPopFrame(ctxt, frame);
+ return (total);
+ }
+ }
+ if (ctxt->valueNr < ctxt->valueFrame + op->value) {
xmlGenericError(xmlGenericErrorContext,
"xmlXPathCompOpEval: parameter error\n");
ctxt->error = XPATH_INVALID_OPERAND;
bak = ctxt->context->node;
pp = ctxt->context->proximityPosition;
cs = ctxt->context->contextSize;
- if (op->ch1 != -1)
+ if (op->ch1 != -1) {
total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
- ctxt->context->contextSize = cs;
- ctxt->context->proximityPosition = pp;
- ctxt->context->node = bak;
- ctxt->context->doc = bakd;
- CHECK_ERROR0;
+ ctxt->context->contextSize = cs;
+ ctxt->context->proximityPosition = pp;
+ ctxt->context->node = bak;
+ ctxt->context->doc = bakd;
+ CHECK_ERROR0;
+ }
if (op->ch2 != -1) {
total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
- ctxt->context->doc = bakd;
- ctxt->context->node = bak;
+ ctxt->context->contextSize = cs;
+ ctxt->context->proximityPosition = pp;
+ ctxt->context->node = bak;
+ ctxt->context->doc = bakd;
CHECK_ERROR0;
}
return (total);
* internal representation.
*/
- if ((op->ch1 != -1) &&
- (op->op == XPATH_OP_COLLECT /* 11 */))
+ if ((op->op == XPATH_OP_COLLECT /* 11 */) &&
+ (op->ch1 != -1) &&
+ (op->ch2 == -1 /* no predicate */))
{
xmlXPathStepOpPtr prevop = &comp->steps[op->ch1];
return(NULL);
ctxt = xmlXPathNewParserContext(str, ctx);
+ if (ctxt == NULL)
+ return(NULL);
ctxt->xptr = 1;
xmlXPtrEvalXPointer(ctxt);
*/
tmp = xmlXPtrNewLocationSetNodeSet(obj->nodesetval);
xmlXPathFreeObject(obj);
+ if (tmp == NULL)
+ XP_ERROR(XPATH_MEMORY_ERROR)
obj = tmp;
}
*/
tmp = xmlXPtrNewLocationSetNodeSet(obj->nodesetval);
xmlXPathFreeObject(obj);
+ if (tmp == NULL)
+ XP_ERROR(XPATH_MEMORY_ERROR)
obj = tmp;
}
newset = xmlXPtrLocationSetCreate(NULL);
+ if (newset == NULL) {
+ xmlXPathFreeObject(obj);
+ XP_ERROR(XPATH_MEMORY_ERROR);
+ }
oldset = (xmlLocationSetPtr) obj->user;
if (oldset != NULL) {
int i;
*/
tmp = xmlXPtrNewLocationSetNodeSet(set->nodesetval);
xmlXPathFreeObject(set);
+ if (tmp == NULL)
+ XP_ERROR(XPATH_MEMORY_ERROR)
set = tmp;
}
oldset = (xmlLocationSetPtr) set->user;
* The loop is to compute the covering range for each item and add it
*/
newset = xmlXPtrLocationSetCreate(NULL);
+ if (newset == NULL) {
+ xmlXPathFreeObject(set);
+ XP_ERROR(XPATH_MEMORY_ERROR);
+ }
for (i = 0;i < oldset->locNr;i++) {
xmlXPtrLocationSetAdd(newset,
xmlXPtrCoveringRange(ctxt, oldset->locTab[i]));
*/
tmp = xmlXPtrNewLocationSetNodeSet(set->nodesetval);
xmlXPathFreeObject(set);
+ if (tmp == NULL)
+ XP_ERROR(XPATH_MEMORY_ERROR)
set = tmp;
}
oldset = (xmlLocationSetPtr) set->user;
* The loop is to compute the covering range for each item and add it
*/
newset = xmlXPtrLocationSetCreate(NULL);
+ if (newset == NULL) {
+ xmlXPathFreeObject(set);
+ XP_ERROR(XPATH_MEMORY_ERROR);
+ }
for (i = 0;i < oldset->locNr;i++) {
xmlXPtrLocationSetAdd(newset,
xmlXPtrInsideRange(ctxt, oldset->locTab[i]));
((*end)->type == XML_NAMESPACE_DECL) || (endindex == NULL))
return(-1);
cur = start;
- if (cur == NULL)
- return(-1);
pos = startindex - 1;
stringlen = xmlStrlen(string);
set = valuePop(ctxt);
newset = xmlXPtrLocationSetCreate(NULL);
+ if (newset == NULL) {
+ xmlXPathFreeObject(set);
+ XP_ERROR(XPATH_MEMORY_ERROR);
+ }
if (set->nodesetval == NULL) {
goto error;
}
*/
tmp = xmlXPtrNewLocationSetNodeSet(set->nodesetval);
xmlXPathFreeObject(set);
+ if (tmp == NULL)
+ XP_ERROR(XPATH_MEMORY_ERROR)
set = tmp;
}
oldset = (xmlLocationSetPtr) set->user;
return (xzFile) state;
}
+static int
+xz_compressed(xzFile f) {
+ xz_statep state;
+
+ if (f == NULL)
+ return(-1);
+ state = (xz_statep) f;
+ if (state->init <= 0)
+ return(-1);
+
+ switch (state->how) {
+ case COPY:
+ return(0);
+ case GZIP:
+ case LZMA:
+ return(1);
+ }
+ return(-1);
+}
+
xzFile
__libxml2_xzopen(const char *path, const char *mode)
{
return xz_open(path, -1, mode);
}
+int
+__libxml2_xzcompressed(xzFile f) {
+ return xz_compressed(f);
+}
+
xzFile
__libxml2_xzdopen(int fd, const char *mode)
{
return 0;
}
+#ifdef HAVE_ZLIB_H
+static int
+xz_avail_zstrm(xz_statep state)
+{
+ int ret;
+ state->strm.avail_in = state->zstrm.avail_in;
+ state->strm.next_in = state->zstrm.next_in;
+ ret = xz_avail(state);
+ state->zstrm.avail_in = (uInt) state->strm.avail_in;
+ state->zstrm.next_in = (Bytef *) state->strm.next_in;
+ return ret;
+}
+#endif
+
static int
is_format_xz(xz_statep state)
{
#define NEXT() ((strm->avail_in == 0 && xz_avail(state) == -1) ? -1 : \
(strm->avail_in == 0 ? -1 : \
(strm->avail_in--, *(strm->next_in)++)))
+/* Same thing, but from zstrm */
+#define NEXTZ() ((strm->avail_in == 0 && xz_avail_zstrm(state) == -1) ? -1 : \
+ (strm->avail_in == 0 ? -1 : \
+ (strm->avail_in--, *(strm->next_in)++)))
/* Get a four-byte little-endian integer and return 0 on success and the value
in *ret. Otherwise -1 is returned and *ret is not modified. */
unsigned long val;
z_streamp strm = &(state->zstrm);
- val = NEXT();
- val += (unsigned) NEXT() << 8;
- val += (unsigned long) NEXT() << 16;
- ch = NEXT();
+ val = NEXTZ();
+ val += (unsigned) NEXTZ() << 8;
+ val += (unsigned long) NEXTZ() << 16;
+ ch = NEXTZ();
if (ch == -1)
return -1;
val += (unsigned long) ch << 24;
xzFile __libxml2_xzdopen(int fd, const char *mode);
int __libxml2_xzread(xzFile file, void *buf, unsigned len);
int __libxml2_xzclose(xzFile file);
+int __libxml2_xzcompressed(xzFile f);
#endif /* LIBXML2_XZLIB_H */
Website: http://www.bzip.org
Title: LibXML
-Used Version: 2.9.1
+Used Version: 2.9.2
Website: http://xmlsoft.org | ftp://xmlsoft.org/libxml2/
Title: ZLib