Commit 6fc5db00 authored by Daniel Veillard's avatar Daniel Veillard
Browse files

trying to fix at least the message from bug #158628 added first xmlsave

* xmlschemastypes.c: trying to fix at least the message from
  bug #158628
* include/libxml/xmlsave.h xmlsave.c: added first xmlsave option
  for format, c.f. bug #159997
Daniel
parent 1cd4dae1
Sun Jan 16 01:04:18 CET 2005 Daniel Veillard <daniel@veillard.com>
* xmlschemastypes.c: trying to fix at least the message from
bug #158628
* include/libxml/xmlsave.h xmlsave.c: added first xmlsave option
for format, c.f. bug #159997
Sat Jan 15 18:44:30 CET 2005 Daniel Veillard <daniel@veillard.com>
 
* python/libxml.py: make __str__ call serialize() on nodes, c.f.
......
......@@ -20,6 +20,17 @@
extern "C" {
#endif
/**
* xmlSaveOption:
*
* This is the set of XML save options that can be passed down
* to the xmlSaveToFd() and similar calls.
*/
typedef enum {
XML_SAVE_FORMAT = 1<<0 /* format save output */
} xmlSaveOption;
typedef struct _xmlSaveCtxt xmlSaveCtxt;
typedef xmlSaveCtxt *xmlSaveCtxtPtr;
......
......@@ -377,7 +377,14 @@ xmlNewSaveCtxt(const char *encoding, int options)
return ( NULL );
}
memset(ret, 0, sizeof(xmlSaveCtxt));
/*
* Use the options
*/
ret->options = options;
if (options & XML_SAVE_FORMAT)
ret->format = 1;
if (encoding != NULL) {
ret->handler = xmlFindCharEncodingHandler(encoding);
if (ret->handler == NULL) {
......
......@@ -1656,6 +1656,9 @@ xmlSchemaValAtomicListNode(xmlSchemaTypePtr type, const xmlChar *value,
if (val == NULL) {
return(-1);
}
if (ret != NULL) {
*ret = NULL;
}
cur = val;
/*
* Split the list
......@@ -1673,9 +1676,6 @@ xmlSchemaValAtomicListNode(xmlSchemaTypePtr type, const xmlChar *value,
}
}
if (nb_values == 0) {
if (ret != NULL) {
TODO
}
xmlFree(val);
return(nb_values);
}
......@@ -1689,10 +1689,11 @@ xmlSchemaValAtomicListNode(xmlSchemaTypePtr type, const xmlChar *value,
while (*cur != 0) cur++;
while ((*cur == 0) && (cur != endval)) cur++;
}
xmlFree(val);
/* TODO what return value ? c.f. bug #158628
if (ret != NULL) {
TODO
}
} */
xmlFree(val);
if (tmp == 0)
return(nb_values);
return(-1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment