mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-27 18:50:07 +03:00
Release 1.6, lot of fixes, more validation, code cleanup, added namespace
on attributes, Daniel.
This commit is contained in:
parent
56316b09e4
commit
b96e643849
11
ChangeLog
11
ChangeLog
@ -1,4 +1,13 @@
|
||||
Mon Aug 16 03:27:38 CEST 1999
|
||||
Sun Aug 29 22:27:29 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org>
|
||||
|
||||
* all .h : changed the prototype declaration indent as in gtk
|
||||
* most .c : working on reducing the TODOs in the code
|
||||
* most .c : cleanup though -pedantic and Insure++
|
||||
* improvements on validation ID checkings.
|
||||
* tree.[ch] SAX.c: added support for namespace on attributes #2022
|
||||
* xml-config.in: closed #1810
|
||||
|
||||
Mon Aug 16 03:27:38 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org>
|
||||
|
||||
* tree.h, valid.c, valid.h: more work on validity, IDs
|
||||
* xpath.c: added/fixed comparidon and equlity, added a new isinf
|
||||
|
44
HTMLparser.c
44
HTMLparser.c
@ -269,7 +269,7 @@ htmlElemDesc html40ElementTable[] = {
|
||||
* any tag of each line implies the end of the current element if the type of
|
||||
* that element is in the same line
|
||||
*/
|
||||
CHAR *htmlEquEnd[] = {
|
||||
char *htmlEquEnd[] = {
|
||||
"DT", "DD", "LI", "OPTION", NULL,
|
||||
"H1", "H2", "H3", "H4", "H5", "H6", NULL,
|
||||
"OL", "MENU", "DIR", "ADDRESS", "PRE", "LISTING", "XMP", NULL,
|
||||
@ -284,7 +284,7 @@ NULL
|
||||
/*
|
||||
* start tags that imply the end of current element
|
||||
*/
|
||||
CHAR *htmlStartClose[] = {
|
||||
char *htmlStartClose[] = {
|
||||
"FORM", "FORM", "P", "HR", "H1", "H2", "H3", "H4", "H5", "H6",
|
||||
"DL", "UL", "OL", "MENU", "DIR", "ADDRESS", "PRE",
|
||||
"LISTING", "XMP", "HEAD", NULL,
|
||||
@ -338,7 +338,7 @@ CHAR *htmlStartClose[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
static CHAR** htmlStartCloseIndex[100];
|
||||
static char** htmlStartCloseIndex[100];
|
||||
static int htmlStartCloseIndexinitialized = 0;
|
||||
|
||||
/************************************************************************
|
||||
@ -382,7 +382,7 @@ htmlTagLookup(const CHAR *tag) {
|
||||
|
||||
for (i = 0; i < (sizeof(html40ElementTable) /
|
||||
sizeof(html40ElementTable[0]));i++) {
|
||||
if (!xmlStrcmp(tag, html40ElementTable[i].name))
|
||||
if (!xmlStrcmp(tag, BAD_CAST html40ElementTable[i].name))
|
||||
return(&html40ElementTable[i]);
|
||||
}
|
||||
return(NULL);
|
||||
@ -401,7 +401,7 @@ htmlTagLookup(const CHAR *tag) {
|
||||
int
|
||||
htmlCheckAutoClose(const CHAR *new, const CHAR *old) {
|
||||
int i, index;
|
||||
CHAR **close;
|
||||
char **close;
|
||||
|
||||
if (htmlStartCloseIndexinitialized == 0) htmlInitAutoClose();
|
||||
|
||||
@ -409,13 +409,13 @@ htmlCheckAutoClose(const CHAR *new, const CHAR *old) {
|
||||
for (index = 0; index < 100;index++) {
|
||||
close = htmlStartCloseIndex[index];
|
||||
if (close == NULL) return(0);
|
||||
if (!xmlStrcmp(*close, new)) break;
|
||||
if (!xmlStrcmp(BAD_CAST *close, new)) break;
|
||||
}
|
||||
|
||||
i = close - htmlStartClose;
|
||||
i++;
|
||||
while (htmlStartClose[i] != NULL) {
|
||||
if (!xmlStrcmp(htmlStartClose[i], old)) {
|
||||
if (!xmlStrcmp(BAD_CAST htmlStartClose[i], old)) {
|
||||
return(1);
|
||||
}
|
||||
i++;
|
||||
@ -789,7 +789,7 @@ htmlEntityLookup(const CHAR *name) {
|
||||
|
||||
for (i = 0;i < (sizeof(html40EntitiesTable)/
|
||||
sizeof(html40EntitiesTable[0]));i++) {
|
||||
if (!xmlStrcmp(name, html40EntitiesTable[i].name)) {
|
||||
if (!xmlStrcmp(name, BAD_CAST html40EntitiesTable[i].name)) {
|
||||
#ifdef DEBUG
|
||||
printf("Found entity %s\n", name);
|
||||
#endif
|
||||
@ -850,7 +850,7 @@ htmlDecodeEntities(htmlParserCtxtPtr ctxt, int len,
|
||||
if (CUR == '&') {
|
||||
if (NXT(1) == '#') {
|
||||
int val = htmlParseCharRef(ctxt);
|
||||
/* TODO: invalid for UTF-8 variable encoding !!! */
|
||||
/* invalid for UTF-8 variable encoding !!!!! */
|
||||
*out++ = val;
|
||||
nbchars += 3; /* !!!! */
|
||||
} else {
|
||||
@ -871,7 +871,7 @@ htmlDecodeEntities(htmlParserCtxtPtr ctxt, int len,
|
||||
}
|
||||
*out++ = ';';
|
||||
} else {
|
||||
/* TODO: invalid for UTF-8 variable encoding !!! */
|
||||
/* invalid for UTF-8 variable encoding !!!!! */
|
||||
*out++ = (CHAR)ent->value;
|
||||
if (out - buffer > buffer_size - 100) {
|
||||
int index = out - buffer;
|
||||
@ -885,7 +885,7 @@ htmlDecodeEntities(htmlParserCtxtPtr ctxt, int len,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* TODO: invalid for UTF-8 , use COPY(out); */
|
||||
/* invalid for UTF-8 , use COPY(out); !!!!! */
|
||||
*out++ = CUR;
|
||||
nbchars++;
|
||||
if (out - buffer > buffer_size - 100) {
|
||||
@ -1050,8 +1050,6 @@ htmlSwitchEncoding(htmlParserCtxtPtr ctxt, xmlCharEncoding enc)
|
||||
*
|
||||
* Is this a sequence of blank chars that one can ignore ?
|
||||
*
|
||||
* TODO: to be corrected accodingly to DTD information if available
|
||||
*
|
||||
* Returns 1 if ignorable 0 otherwise.
|
||||
*/
|
||||
|
||||
@ -1125,7 +1123,7 @@ htmlNewDoc(const CHAR *URI, const CHAR *ExternalID) {
|
||||
cur->type = XML_DOCUMENT_NODE;
|
||||
cur->version = NULL;
|
||||
cur->intSubset = NULL;
|
||||
xmlCreateIntSubset(cur, "HTML", ExternalID, URI);
|
||||
xmlCreateIntSubset(cur, BAD_CAST "HTML", ExternalID, URI);
|
||||
cur->name = NULL;
|
||||
cur->root = NULL;
|
||||
cur->extSubset = NULL;
|
||||
@ -1338,7 +1336,7 @@ htmlParseEntityRef(htmlParserCtxtPtr ctxt, CHAR **str) {
|
||||
"htmlParseEntityRef: expecting ';'\n");
|
||||
ctxt->wellFormed = 0;
|
||||
if (ctxt->sax->characters != NULL) {
|
||||
ctxt->sax->characters(ctxt->userData, "&", 1);
|
||||
ctxt->sax->characters(ctxt->userData, BAD_CAST "&", 1);
|
||||
ctxt->sax->characters(ctxt->userData, name, xmlStrlen(name));
|
||||
}
|
||||
free(name);
|
||||
@ -1817,7 +1815,6 @@ htmlParseDocTypeDecl(htmlParserCtxtPtr ctxt) {
|
||||
|
||||
/*
|
||||
* Cleanup, since we don't use all those identifiers
|
||||
* TODO : the DOCTYPE if available should be stored !
|
||||
*/
|
||||
if (URI != NULL) free(URI);
|
||||
if (ExternalID != NULL) free(ExternalID);
|
||||
@ -2113,7 +2110,7 @@ htmlParseReference(htmlParserCtxtPtr ctxt) {
|
||||
|
||||
if (NXT(1) == '#') {
|
||||
val = htmlParseCharRef(ctxt);
|
||||
/* TODO: invalid for UTF-8 variable encoding !!! */
|
||||
/* invalid for UTF-8 variable encoding !!!!! */
|
||||
out[0] = val;
|
||||
out[1] = 0;
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL))
|
||||
@ -2123,12 +2120,12 @@ htmlParseReference(htmlParserCtxtPtr ctxt) {
|
||||
if (name == NULL) return; /* Shall we output & anyway ? */
|
||||
if ((ent == NULL) || (ent->value <= 0) || (ent->value >= 255)) {
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL)) {
|
||||
ctxt->sax->characters(ctxt->userData, "&", 1);
|
||||
ctxt->sax->characters(ctxt->userData, BAD_CAST "&", 1);
|
||||
ctxt->sax->characters(ctxt->userData, name, xmlStrlen(name));
|
||||
ctxt->sax->characters(ctxt->userData, ";", 1);
|
||||
ctxt->sax->characters(ctxt->userData, BAD_CAST ";", 1);
|
||||
}
|
||||
} else {
|
||||
/* TODO: invalid for UTF-8 variable encoding !!! */
|
||||
/* invalid for UTF-8 variable encoding !!!!! */
|
||||
out[0] = ent->value;
|
||||
out[1] = 0;
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL))
|
||||
@ -2339,16 +2336,11 @@ htmlParseDocument(htmlParserCtxtPtr ctxt) {
|
||||
|
||||
GROW;
|
||||
/*
|
||||
* SAX: beginning of the document processing TODO: update for HTML.
|
||||
* SAX: beginning of the document processing.
|
||||
*/
|
||||
if ((ctxt->sax) && (ctxt->sax->setDocumentLocator))
|
||||
ctxt->sax->setDocumentLocator(ctxt->userData, &xmlDefaultSAXLocator);
|
||||
|
||||
/*
|
||||
* We should check for encoding here and plug-in some
|
||||
* conversion code TODO !!!!
|
||||
*/
|
||||
|
||||
/*
|
||||
* Wipe out everything which is before the first '<'
|
||||
*/
|
||||
|
@ -27,7 +27,7 @@ typedef xmlNodePtr htmlNodePtr;
|
||||
* Internal description of an HTML element
|
||||
*/
|
||||
typedef struct htmlElemDesc {
|
||||
const CHAR *name; /* The tag name */
|
||||
const char *name; /* The tag name */
|
||||
int startTag; /* Whether the start tag can be implied */
|
||||
int endTag; /* Whether the end tag can be implied */
|
||||
int empty; /* Is this an empty element ? */
|
||||
@ -41,7 +41,7 @@ typedef struct htmlElemDesc {
|
||||
*/
|
||||
typedef struct htmlEntityDesc {
|
||||
int value; /* the UNICODE value for the character */
|
||||
const CHAR *name; /* The entity name */
|
||||
const char *name; /* The entity name */
|
||||
const char *desc; /* the description */
|
||||
} htmlEntityDesc, *htmlEntityDescPtr;
|
||||
|
||||
|
174
SAX.c
174
SAX.c
@ -14,8 +14,10 @@
|
||||
#include "valid.h"
|
||||
#include "entities.h"
|
||||
#include "xml-error.h"
|
||||
#include "debugXML.h"
|
||||
|
||||
/* #define DEBUG_SAX */
|
||||
/* #define DEBUG_SAX_TREE */
|
||||
|
||||
/**
|
||||
* getPublicId:
|
||||
@ -45,7 +47,7 @@ const CHAR *
|
||||
getSystemId(void *ctx)
|
||||
{
|
||||
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
|
||||
return(ctxt->input->filename);
|
||||
return(BAD_CAST ctxt->input->filename);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -164,7 +166,7 @@ internalSubset(void *ctx, const CHAR *name,
|
||||
* Ask the Entity resolver to load the damn thing
|
||||
*/
|
||||
if ((ctxt->directory != NULL) && (dtdCtxt->directory == NULL))
|
||||
dtdCtxt->directory = xmlStrdup(ctxt->directory);
|
||||
dtdCtxt->directory = (char *) xmlStrdup(BAD_CAST ctxt->directory);
|
||||
|
||||
if ((dtdCtxt->sax != NULL) && (dtdCtxt->sax->resolveEntity != NULL))
|
||||
input = dtdCtxt->sax->resolveEntity(dtdCtxt->userData, ExternalID,
|
||||
@ -182,7 +184,7 @@ internalSubset(void *ctx, const CHAR *name,
|
||||
xmlSwitchEncoding(dtdCtxt, enc);
|
||||
|
||||
if (input->filename == NULL)
|
||||
input->filename = xmlStrdup(SystemID);
|
||||
input->filename = (char *) xmlStrdup(SystemID);
|
||||
input->line = 1;
|
||||
input->col = 1;
|
||||
input->base = dtdCtxt->input->cur;
|
||||
@ -234,15 +236,13 @@ resolveEntity(void *ctx, const CHAR *publicId, const CHAR *systemId)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* TODO : not 100% sure that the appropriate handling in that case.
|
||||
* TODO : resolveEntity, handling of http://.. or ftp://..
|
||||
*/
|
||||
if (systemId != NULL) {
|
||||
if (!xmlStrncmp(systemId, "http://", 7)) {
|
||||
/* !!!!!!!!! TODO */
|
||||
} else if (!xmlStrncmp(systemId, "ftp://", 6)) {
|
||||
/* !!!!!!!!! TODO */
|
||||
if (!xmlStrncmp(systemId, BAD_CAST "http://", 7)) {
|
||||
} else if (!xmlStrncmp(systemId, BAD_CAST "ftp://", 6)) {
|
||||
} else {
|
||||
return(xmlNewInputFromFile(ctxt, systemId));
|
||||
return(xmlNewInputFromFile(ctxt, (char *) systemId));
|
||||
}
|
||||
}
|
||||
return(NULL);
|
||||
@ -390,7 +390,6 @@ elementDecl(void *ctx, const CHAR *name, int type,
|
||||
* @systemId: The system ID of the entity
|
||||
*
|
||||
* What to do when a notation declaration has been parsed.
|
||||
* TODO Not handled currently.
|
||||
*/
|
||||
void
|
||||
notationDecl(void *ctx, const CHAR *name,
|
||||
@ -421,18 +420,24 @@ notationDecl(void *ctx, const CHAR *name,
|
||||
* @notationName: the name of the notation
|
||||
*
|
||||
* What to do when an unparsed entity declaration is parsed
|
||||
* TODO Create an Entity node.
|
||||
*/
|
||||
void
|
||||
unparsedEntityDecl(void *ctx, const CHAR *name,
|
||||
const CHAR *publicId, const CHAR *systemId,
|
||||
const CHAR *notationName)
|
||||
{
|
||||
/* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */
|
||||
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
|
||||
#ifdef DEBUG_SAX
|
||||
fprintf(stderr, "SAX.unparsedEntityDecl(%s, %s, %s, %s)\n",
|
||||
name, publicId, systemId, notationName);
|
||||
#endif
|
||||
if (ctxt->validate && ctxt->wellFormed &&
|
||||
ctxt->myDoc && ctxt->myDoc->intSubset)
|
||||
ctxt->valid &= xmlValidateNotationUse(&ctxt->vctxt, ctxt->myDoc,
|
||||
notationName);
|
||||
xmlAddDocEntity(ctxt->myDoc, name,
|
||||
XML_EXTERNAL_GENERAL_UNPARSED_ENTITY,
|
||||
publicId, systemId, notationName);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -510,6 +515,7 @@ attribute(void *ctx, const CHAR *fullname, const CHAR *value)
|
||||
xmlAttrPtr ret;
|
||||
CHAR *name;
|
||||
CHAR *ns;
|
||||
xmlNsPtr namespace;
|
||||
|
||||
/****************
|
||||
#ifdef DEBUG_SAX
|
||||
@ -543,15 +549,29 @@ attribute(void *ctx, const CHAR *fullname, const CHAR *value)
|
||||
return;
|
||||
}
|
||||
|
||||
ret = xmlNewProp(ctxt->node, name, NULL);
|
||||
namespace = xmlSearchNs(ctxt->myDoc, ctxt->node, ns);
|
||||
/* !!!!!! <a toto:arg="" xmlns:toto="http://toto.com"> */
|
||||
ret = xmlNewNsProp(ctxt->node, namespace, name, NULL);
|
||||
|
||||
if ((ret != NULL) && (ctxt->replaceEntities == 0))
|
||||
ret->val = xmlStringGetNodeList(ctxt->myDoc, value);
|
||||
if (ret != NULL) {
|
||||
if (ctxt->replaceEntities == 0)
|
||||
ret->val = xmlStringGetNodeList(ctxt->myDoc, value);
|
||||
else
|
||||
ret->val = xmlNewDocText(ctxt->myDoc, value);
|
||||
}
|
||||
|
||||
if (ctxt->validate && ctxt->wellFormed &&
|
||||
ctxt->myDoc && ctxt->myDoc->intSubset)
|
||||
ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt, ctxt->myDoc,
|
||||
ctxt->node, ret, value);
|
||||
else {
|
||||
/*
|
||||
* when validating, the ID registration is done at the attribute
|
||||
* validation level. Otherwise we have to do specific handling here.
|
||||
*/
|
||||
if (xmlIsID(ctxt->myDoc, ctxt->node, ret))
|
||||
xmlAddID(&ctxt->vctxt, ctxt->myDoc, value, ret);
|
||||
}
|
||||
|
||||
if (name != NULL)
|
||||
free(name);
|
||||
@ -566,7 +586,6 @@ attribute(void *ctx, const CHAR *fullname, const CHAR *value)
|
||||
* @atts: An array of name/value attributes pairs, NULL terminated
|
||||
*
|
||||
* called when an opening tag has been processed.
|
||||
* TODO We currently have a small pblm with the arguments ...
|
||||
*/
|
||||
void
|
||||
startElement(void *ctx, const CHAR *fullname, const CHAR **atts)
|
||||
@ -598,32 +617,67 @@ startElement(void *ctx, const CHAR *fullname, const CHAR **atts)
|
||||
*/
|
||||
ret = xmlNewDocNode(ctxt->myDoc, NULL, name, NULL);
|
||||
if (ret == NULL) return;
|
||||
if (ctxt->myDoc->root == NULL)
|
||||
if (ctxt->myDoc->root == NULL) {
|
||||
#ifdef DEBUG_SAX_TREE
|
||||
fprintf(stderr, "Setting %s as root\n", name);
|
||||
#endif
|
||||
ctxt->myDoc->root = ret;
|
||||
} else if (parent == NULL) {
|
||||
parent = ctxt->myDoc->root;
|
||||
}
|
||||
|
||||
/*
|
||||
* We are parsing a new node.
|
||||
*/
|
||||
#ifdef DEBUG_SAX_TREE
|
||||
fprintf(stderr, "pushing(%s)\n", name);
|
||||
#endif
|
||||
nodePush(ctxt, ret);
|
||||
|
||||
/*
|
||||
* Link the child element
|
||||
*/
|
||||
if (parent != NULL)
|
||||
xmlAddChild(parent, ctxt->node);
|
||||
if (parent != NULL) {
|
||||
if (parent->type == XML_ELEMENT_NODE) {
|
||||
#ifdef DEBUG_SAX_TREE
|
||||
fprintf(stderr, "adding child %s to %s\n", name, parent->name);
|
||||
#endif
|
||||
xmlAddChild(parent, ret);
|
||||
} else {
|
||||
#ifdef DEBUG_SAX_TREE
|
||||
fprintf(stderr, "adding sibling %s to ", name);
|
||||
xmlDebugDumpOneNode(stderr, parent, 0);
|
||||
#endif
|
||||
xmlAddSibling(parent, ret);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* process all the attributes.
|
||||
* process all the attributes whose name start with "xml"
|
||||
*/
|
||||
if (atts != NULL) {
|
||||
i = 0;
|
||||
att = atts[i++];
|
||||
value = atts[i++];
|
||||
while ((att != NULL) && (value != NULL)) {
|
||||
/*
|
||||
* Handle one pair of attribute/value
|
||||
*/
|
||||
attribute(ctxt, att, value);
|
||||
if ((att[0] == 'x') && (att[1] == 'm') && (att[2] == 'l'))
|
||||
attribute(ctxt, att, value);
|
||||
|
||||
att = atts[i++];
|
||||
value = atts[i++];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* process all the other attributes
|
||||
*/
|
||||
if (atts != NULL) {
|
||||
i = 0;
|
||||
att = atts[i++];
|
||||
value = atts[i++];
|
||||
while ((att != NULL) && (value != NULL)) {
|
||||
if ((att[0] != 'x') || (att[1] != 'm') || (att[2] != 'l'))
|
||||
attribute(ctxt, att, value);
|
||||
|
||||
/*
|
||||
* Next ones
|
||||
@ -687,6 +741,9 @@ endElement(void *ctx, const CHAR *name)
|
||||
/*
|
||||
* end of parsing of this node.
|
||||
*/
|
||||
#ifdef DEBUG_SAX_TREE
|
||||
fprintf(stderr, "popping(%s)\n", cur->name);
|
||||
#endif
|
||||
nodePop(ctxt);
|
||||
}
|
||||
|
||||
@ -707,6 +764,9 @@ reference(void *ctx, const CHAR *name)
|
||||
fprintf(stderr, "SAX.reference(%s)\n", name);
|
||||
#endif
|
||||
ret = xmlNewReference(ctxt->myDoc, name);
|
||||
#ifdef DEBUG_SAX_TREE
|
||||
fprintf(stderr, "add reference %s to %s \n", name, ctxt->node->name);
|
||||
#endif
|
||||
xmlAddChild(ctxt->node, ret);
|
||||
}
|
||||
|
||||
@ -735,6 +795,9 @@ characters(void *ctx, const CHAR *ch, int len)
|
||||
*/
|
||||
|
||||
lastChild = xmlGetLastChild(ctxt->node);
|
||||
#ifdef DEBUG_SAX_TREE
|
||||
fprintf(stderr, "add chars to %s \n", ctxt->node->name);
|
||||
#endif
|
||||
if (lastChild == NULL)
|
||||
xmlNodeAddContentLen(ctxt->node, ch, len);
|
||||
else {
|
||||
@ -778,10 +841,40 @@ void
|
||||
processingInstruction(void *ctx, const CHAR *target,
|
||||
const CHAR *data)
|
||||
{
|
||||
/* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */
|
||||
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
|
||||
xmlNodePtr ret;
|
||||
xmlNodePtr parent = ctxt->node;
|
||||
|
||||
#ifdef DEBUG_SAX
|
||||
fprintf(stderr, "SAX.processingInstruction(%s, %s)\n", target, data);
|
||||
#endif
|
||||
|
||||
ret = xmlNewPI(target, data);
|
||||
if (ret == NULL) return;
|
||||
ret->doc = ctxt->myDoc;
|
||||
if (ctxt->myDoc->root == NULL) {
|
||||
#ifdef DEBUG_SAX_TREE
|
||||
fprintf(stderr, "Setting PI %s as root\n", target);
|
||||
#endif
|
||||
ctxt->myDoc->root = ret;
|
||||
} else if (parent == NULL) {
|
||||
parent = ctxt->myDoc->root;
|
||||
}
|
||||
if (parent != NULL) {
|
||||
if (parent->type == XML_ELEMENT_NODE) {
|
||||
#ifdef DEBUG_SAX_TREE
|
||||
fprintf(stderr, "adding PI child %s to %s\n", target, parent->name);
|
||||
#endif
|
||||
xmlAddChild(parent, ret);
|
||||
} else {
|
||||
#ifdef DEBUG_SAX_TREE
|
||||
fprintf(stderr, "adding PI sibling %s to ", target);
|
||||
xmlDebugDumpOneNode(stderr, parent, 0);
|
||||
#endif
|
||||
xmlAddSibling(parent, ret);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -885,7 +978,7 @@ checkNamespace(void *ctx, CHAR *namespace)
|
||||
"End tags %s holds a prefix %s not used by the open tag\n",
|
||||
cur->name, namespace);
|
||||
ctxt->wellFormed = 0;
|
||||
} else if (strcmp(namespace, cur->ns->prefix)) {
|
||||
} else if (xmlStrcmp(namespace, cur->ns->prefix)) {
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||
ctxt->sax->error(ctxt,
|
||||
"Start and End tags for %s don't use the same namespaces: %s and %s\n",
|
||||
@ -930,13 +1023,36 @@ comment(void *ctx, const CHAR *value)
|
||||
{
|
||||
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
|
||||
xmlNodePtr ret;
|
||||
xmlNodePtr parent = ctxt->node;
|
||||
|
||||
#ifdef DEBUG_SAX
|
||||
fprintf(stderr, "SAX.comment(%s)\n", value);
|
||||
#endif
|
||||
ret = xmlNewDocComment(ctxt->myDoc, value);
|
||||
xmlAddChild(ctxt->node, ret);
|
||||
/* !!!!! merges */
|
||||
if (ret == NULL) return;
|
||||
|
||||
if (ctxt->myDoc->root == NULL) {
|
||||
#ifdef DEBUG_SAX_TREE
|
||||
fprintf(stderr, "Setting comment as root\n");
|
||||
#endif
|
||||
ctxt->myDoc->root = ret;
|
||||
} else if (parent == NULL) {
|
||||
parent = ctxt->myDoc->root;
|
||||
}
|
||||
if (parent != NULL) {
|
||||
if (parent->type == XML_ELEMENT_NODE) {
|
||||
#ifdef DEBUG_SAX_TREE
|
||||
fprintf(stderr, "adding comment child to %s\n", parent->name);
|
||||
#endif
|
||||
xmlAddChild(parent, ret);
|
||||
} else {
|
||||
#ifdef DEBUG_SAX_TREE
|
||||
fprintf(stderr, "adding comment sibling to ");
|
||||
xmlDebugDumpOneNode(stderr, parent, 0);
|
||||
#endif
|
||||
xmlAddSibling(parent, ret);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -954,7 +1070,7 @@ cdataBlock(void *ctx, const CHAR *value, int len)
|
||||
xmlNodePtr ret;
|
||||
|
||||
#ifdef DEBUG_SAX
|
||||
fprintf(stderr, "SAX.pcdata(%s, %d)\n", name, len);
|
||||
fprintf(stderr, "SAX.pcdata(%.10s, %d)\n", value, len);
|
||||
#endif
|
||||
ret = xmlNewCDataBlock(ctxt->myDoc, value, len);
|
||||
xmlAddChild(ctxt->node, ret);
|
||||
|
@ -4,7 +4,7 @@ AC_INIT(entities.h)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
LIBXML_MAJOR_VERSION=1
|
||||
LIBXML_MINOR_VERSION=5
|
||||
LIBXML_MINOR_VERSION=6
|
||||
LIBXML_MICRO_VERSION=0
|
||||
LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION
|
||||
LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
|
||||
|
@ -146,7 +146,7 @@ void xmlDebugDumpOneNode(FILE *output, xmlNodePtr node, int depth) {
|
||||
fprintf(output, "ENTITY\n");
|
||||
break;
|
||||
case XML_PI_NODE:
|
||||
fprintf(output, "PI\n");
|
||||
fprintf(output, "PI %s\n", node->name);
|
||||
break;
|
||||
case XML_COMMENT_NODE:
|
||||
fprintf(output, "COMMENT\n");
|
||||
@ -252,7 +252,7 @@ void xmlDebugDumpDocument(FILE *output, xmlDocPtr doc) {
|
||||
}
|
||||
if (doc->name != NULL) {
|
||||
fprintf(output, "name=");
|
||||
xmlDebugDumpString(output, doc->name);
|
||||
xmlDebugDumpString(output, BAD_CAST doc->name);
|
||||
fprintf(output, "\n");
|
||||
}
|
||||
if (doc->version != NULL) {
|
||||
|
14
encoding.c
14
encoding.c
@ -19,9 +19,13 @@
|
||||
* Daniel.Veillard@w3.org
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include "encoding.h"
|
||||
#ifdef HAVE_UNICODE_H
|
||||
#include <unicode.h>
|
||||
@ -85,7 +89,8 @@ isolat1ToUTF8(unsigned char* out, int outlen, unsigned char* in, int inlen)
|
||||
*
|
||||
* Take a block of UTF-8 chars in and try to convert it to an ISO Latin 1
|
||||
* block of chars out.
|
||||
* TODO: need a fallback mechanism ...
|
||||
* TODO: UTF8Toisolat1 need a fallback mechanism ...
|
||||
*
|
||||
* Returns the number of byte written, or -1 by lack of space, or -2
|
||||
* if the transcoding failed.
|
||||
*/
|
||||
@ -169,7 +174,8 @@ UTF16ToUTF8(unsigned char* out, int outlen, unsigned short* in, int inlen)
|
||||
*
|
||||
* Take a block of UTF-8 chars in and try to convert it to an UTF-16
|
||||
* block of chars out.
|
||||
* TODO: need a fallback mechanism ...
|
||||
* TODO: UTF8ToUTF16 need a fallback mechanism ...
|
||||
*
|
||||
* Returns the number of byte written, or -1 by lack of space, or -2
|
||||
* if the transcoding failed.
|
||||
*/
|
||||
@ -416,7 +422,7 @@ xmlInitCharEncodingHandlers(void) {
|
||||
xmlNewCharEncodingHandler("UTF-8", NULL, NULL);
|
||||
#ifdef HAVE_UNICODE_H
|
||||
#else
|
||||
xmlNewCharEncodingHandler("UTF-16", UTF16ToUTF8, UTF8ToUTF16);
|
||||
/* xmlNewCharEncodingHandler("UTF-16", UTF16ToUTF8, UTF8ToUTF16); */
|
||||
xmlNewCharEncodingHandler("ISO-8859-1", isolat1ToUTF8, UTF8Toisolat1);
|
||||
#endif
|
||||
}
|
||||
@ -455,7 +461,7 @@ xmlRegisterCharEncodingHandler(xmlCharEncodingHandlerPtr handler) {
|
||||
xmlCharEncodingHandlerPtr
|
||||
xmlGetCharEncodingHandler(xmlCharEncoding enc) {
|
||||
if (handlers == NULL) xmlInitCharEncodingHandlers();
|
||||
/* TODO !!!!!!! */
|
||||
/* TODO xmlGetCharEncodingHandler !!!!!!! */
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ typedef enum {
|
||||
XML_CHAR_ENCODING_8859_9= 18,/* ISO-8859-9 */
|
||||
XML_CHAR_ENCODING_2022_JP= 19,/* ISO-2022-JP */
|
||||
XML_CHAR_ENCODING_SHIFT_JIS=20,/* Shift_JIS */
|
||||
XML_CHAR_ENCODING_EUC_JP= 21,/* EUC-JP */
|
||||
XML_CHAR_ENCODING_EUC_JP= 21 /* EUC-JP */
|
||||
} xmlCharEncoding;
|
||||
|
||||
/**
|
||||
|
15
entities.c
15
entities.c
@ -50,13 +50,10 @@ void xmlFreeEntity(xmlEntityPtr entity) {
|
||||
|
||||
/*
|
||||
* xmlAddEntity : register a new entity for an entities table.
|
||||
*
|
||||
* TODO !!! We should check here that the combination of type
|
||||
* ExternalID and SystemID is valid.
|
||||
*/
|
||||
static void
|
||||
xmlAddEntity(xmlEntitiesTablePtr table, const CHAR *name, int type,
|
||||
const CHAR *ExternalID, const CHAR *SystemID, CHAR *content) {
|
||||
const CHAR *ExternalID, const CHAR *SystemID, const CHAR *content) {
|
||||
int i;
|
||||
xmlEntityPtr cur;
|
||||
int len;
|
||||
@ -67,6 +64,7 @@ xmlAddEntity(xmlEntitiesTablePtr table, const CHAR *name, int type,
|
||||
/*
|
||||
* The entity is already defined in this Dtd, the spec says to NOT
|
||||
* override it ... Is it worth a Warning ??? !!!
|
||||
* Not having a cprinting context this seems hard ...
|
||||
*/
|
||||
if (((type == XML_INTERNAL_PARAMETER_ENTITY) ||
|
||||
(type == XML_EXTERNAL_PARAMETER_ENTITY)) &&
|
||||
@ -178,7 +176,7 @@ xmlGetPredefinedEntity(const CHAR *name) {
|
||||
*/
|
||||
void
|
||||
xmlAddDtdEntity(xmlDocPtr doc, const CHAR *name, int type,
|
||||
const CHAR *ExternalID, const CHAR *SystemID, CHAR *content) {
|
||||
const CHAR *ExternalID, const CHAR *SystemID, const CHAR *content) {
|
||||
xmlEntitiesTablePtr table;
|
||||
|
||||
if (doc->extSubset == NULL) {
|
||||
@ -207,7 +205,7 @@ xmlAddDtdEntity(xmlDocPtr doc, const CHAR *name, int type,
|
||||
*/
|
||||
void
|
||||
xmlAddDocEntity(xmlDocPtr doc, const CHAR *name, int type,
|
||||
const CHAR *ExternalID, const CHAR *SystemID, CHAR *content) {
|
||||
const CHAR *ExternalID, const CHAR *SystemID, const CHAR *content) {
|
||||
xmlEntitiesTablePtr table;
|
||||
|
||||
if (doc == NULL) {
|
||||
@ -343,8 +341,6 @@ xmlGetDocEntity(xmlDocPtr doc, const CHAR *name) {
|
||||
|
||||
/*
|
||||
* A buffer used for converting entities to their equivalent and back.
|
||||
*
|
||||
* TODO: remove this, once we are not afraid of breaking binary compatibility
|
||||
*/
|
||||
static int buffer_size = 0;
|
||||
static CHAR *buffer = NULL;
|
||||
@ -367,7 +363,8 @@ void growBuffer(void) {
|
||||
* Do a global encoding of a string, replacing the predefined entities
|
||||
* and non ASCII values with their entities and CharRef counterparts.
|
||||
*
|
||||
* TODO: remove this, once we are not afraid of breaking binary compatibility
|
||||
* TODO: remove xmlEncodeEntities, once we are not afraid of breaking binary
|
||||
* compatibility
|
||||
*
|
||||
* People must migrate their code to xmlEncodeEntitiesReentrant !
|
||||
* This routine will issue a warning when encountered.
|
||||
|
44
entities.h
44
entities.h
@ -59,21 +59,35 @@ typedef xmlEntitiesTable *xmlEntitiesTablePtr;
|
||||
|
||||
#include "parser.h"
|
||||
|
||||
void xmlAddDocEntity(xmlDocPtr doc, const CHAR *name, int type,
|
||||
const CHAR *ExternalID, const CHAR *SystemID, CHAR *content);
|
||||
void xmlAddDtdEntity(xmlDocPtr doc, const CHAR *name, int type,
|
||||
const CHAR *ExternalID, const CHAR *SystemID, CHAR *content);
|
||||
xmlEntityPtr xmlGetPredefinedEntity(const CHAR *name);
|
||||
xmlEntityPtr xmlGetDocEntity(xmlDocPtr doc, const CHAR *name);
|
||||
xmlEntityPtr xmlGetDtdEntity(xmlDocPtr doc, const CHAR *name);
|
||||
xmlEntityPtr xmlGetParameterEntity(xmlDocPtr doc, const CHAR *name);
|
||||
const CHAR *xmlEncodeEntities(xmlDocPtr doc, const CHAR *input);
|
||||
CHAR *xmlEncodeEntitiesReentrant(xmlDocPtr doc, const CHAR *input);
|
||||
xmlEntitiesTablePtr xmlCreateEntitiesTable(void);
|
||||
xmlEntitiesTablePtr xmlCopyEntitiesTable(xmlEntitiesTablePtr table);
|
||||
void xmlFreeEntitiesTable(xmlEntitiesTablePtr table);
|
||||
void xmlDumpEntitiesTable(xmlBufferPtr buf, xmlEntitiesTablePtr table);
|
||||
xmlEntitiesTablePtr xmlCopyEntitiesTable(xmlEntitiesTablePtr table);
|
||||
void xmlAddDocEntity (xmlDocPtr doc,
|
||||
const CHAR *name,
|
||||
int type,
|
||||
const CHAR *ExternalID,
|
||||
const CHAR *SystemID,
|
||||
const CHAR *content);
|
||||
void xmlAddDtdEntity (xmlDocPtr doc,
|
||||
const CHAR *name,
|
||||
int type,
|
||||
const CHAR *ExternalID,
|
||||
const CHAR *SystemID,
|
||||
const CHAR *content);
|
||||
xmlEntityPtr xmlGetPredefinedEntity (const CHAR *name);
|
||||
xmlEntityPtr xmlGetDocEntity (xmlDocPtr doc,
|
||||
const CHAR *name);
|
||||
xmlEntityPtr xmlGetDtdEntity (xmlDocPtr doc,
|
||||
const CHAR *name);
|
||||
xmlEntityPtr xmlGetParameterEntity (xmlDocPtr doc,
|
||||
const CHAR *name);
|
||||
const CHAR * xmlEncodeEntities (xmlDocPtr doc,
|
||||
const CHAR *input);
|
||||
CHAR * xmlEncodeEntitiesReentrant(xmlDocPtr doc,
|
||||
const CHAR *input);
|
||||
xmlEntitiesTablePtr xmlCreateEntitiesTable (void);
|
||||
xmlEntitiesTablePtr xmlCopyEntitiesTable (xmlEntitiesTablePtr table);
|
||||
void xmlFreeEntitiesTable (xmlEntitiesTablePtr table);
|
||||
void xmlDumpEntitiesTable (xmlBufferPtr buf,
|
||||
xmlEntitiesTablePtr table);
|
||||
xmlEntitiesTablePtr xmlCopyEntitiesTable (xmlEntitiesTablePtr table);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
41
error.c
41
error.c
@ -10,18 +10,32 @@
|
||||
#include <stdarg.h>
|
||||
#include "parser.h"
|
||||
|
||||
static void
|
||||
/**
|
||||
* xmlParserPrintFileInfo:
|
||||
* @input: an xmlParserInputPtr input
|
||||
*
|
||||
* Displays the associated file and line informations for the current input
|
||||
*/
|
||||
|
||||
void
|
||||
xmlParserPrintFileInfo(xmlParserInputPtr input) {
|
||||
if (input != NULL) {
|
||||
if (input->filename)
|
||||
fprintf(stderr, "%s:%d: ", input->filename,
|
||||
input->line);
|
||||
else
|
||||
fprintf(stderr, "line %d: ", input->line);
|
||||
fprintf(stderr, "Entity: line %d: ", input->line);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
/**
|
||||
* xmlParserPrintFileContext:
|
||||
* @input: an xmlParserInputPtr input
|
||||
*
|
||||
* Displays current context within the input content for error tracking
|
||||
*/
|
||||
|
||||
void
|
||||
xmlParserPrintFileContext(xmlParserInputPtr input) {
|
||||
const CHAR *cur, *base;
|
||||
int n;
|
||||
@ -67,11 +81,14 @@ xmlParserError(void *ctx, const char *msg, ...)
|
||||
{
|
||||
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
|
||||
xmlParserInputPtr input;
|
||||
xmlParserInputPtr cur = NULL;
|
||||
va_list args;
|
||||
|
||||
input = ctxt->input;
|
||||
if ((input->filename == NULL) && (ctxt->inputNr > 1))
|
||||
if ((input->filename == NULL) && (ctxt->inputNr > 1)) {
|
||||
cur = input;
|
||||
input = ctxt->inputTab[ctxt->inputNr - 2];
|
||||
}
|
||||
|
||||
xmlParserPrintFileInfo(input);
|
||||
|
||||
@ -81,6 +98,11 @@ xmlParserError(void *ctx, const char *msg, ...)
|
||||
va_end(args);
|
||||
|
||||
xmlParserPrintFileContext(input);
|
||||
if (cur != NULL) {
|
||||
xmlParserPrintFileInfo(cur);
|
||||
fprintf(stderr, "\n");
|
||||
xmlParserPrintFileContext(cur);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -97,11 +119,15 @@ xmlParserWarning(void *ctx, const char *msg, ...)
|
||||
{
|
||||
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
|
||||
xmlParserInputPtr input;
|
||||
xmlParserInputPtr cur = NULL;
|
||||
va_list args;
|
||||
|
||||
input = ctxt->input;
|
||||
if ((input->filename == NULL) && (ctxt->inputNr > 1))
|
||||
if ((input->filename == NULL) && (ctxt->inputNr > 1)) {
|
||||
cur = input;
|
||||
input = ctxt->inputTab[ctxt->inputNr - 2];
|
||||
}
|
||||
|
||||
|
||||
xmlParserPrintFileInfo(input);
|
||||
|
||||
@ -111,6 +137,11 @@ xmlParserWarning(void *ctx, const char *msg, ...)
|
||||
va_end(args);
|
||||
|
||||
xmlParserPrintFileContext(input);
|
||||
if (cur != NULL) {
|
||||
xmlParserPrintFileInfo(cur);
|
||||
fprintf(stderr, "\n");
|
||||
xmlParserPrintFileContext(cur);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -27,7 +27,7 @@ typedef xmlNodePtr htmlNodePtr;
|
||||
* Internal description of an HTML element
|
||||
*/
|
||||
typedef struct htmlElemDesc {
|
||||
const CHAR *name; /* The tag name */
|
||||
const char *name; /* The tag name */
|
||||
int startTag; /* Whether the start tag can be implied */
|
||||
int endTag; /* Whether the end tag can be implied */
|
||||
int empty; /* Is this an empty element ? */
|
||||
@ -41,7 +41,7 @@ typedef struct htmlElemDesc {
|
||||
*/
|
||||
typedef struct htmlEntityDesc {
|
||||
int value; /* the UNICODE value for the character */
|
||||
const CHAR *name; /* The entity name */
|
||||
const char *name; /* The entity name */
|
||||
const char *desc; /* the description */
|
||||
} htmlEntityDesc, *htmlEntityDescPtr;
|
||||
|
||||
|
@ -51,7 +51,7 @@ typedef enum {
|
||||
XML_CHAR_ENCODING_8859_9= 18,/* ISO-8859-9 */
|
||||
XML_CHAR_ENCODING_2022_JP= 19,/* ISO-2022-JP */
|
||||
XML_CHAR_ENCODING_SHIFT_JIS=20,/* Shift_JIS */
|
||||
XML_CHAR_ENCODING_EUC_JP= 21,/* EUC-JP */
|
||||
XML_CHAR_ENCODING_EUC_JP= 21 /* EUC-JP */
|
||||
} xmlCharEncoding;
|
||||
|
||||
/**
|
||||
|
@ -59,21 +59,35 @@ typedef xmlEntitiesTable *xmlEntitiesTablePtr;
|
||||
|
||||
#include "parser.h"
|
||||
|
||||
void xmlAddDocEntity(xmlDocPtr doc, const CHAR *name, int type,
|
||||
const CHAR *ExternalID, const CHAR *SystemID, CHAR *content);
|
||||
void xmlAddDtdEntity(xmlDocPtr doc, const CHAR *name, int type,
|
||||
const CHAR *ExternalID, const CHAR *SystemID, CHAR *content);
|
||||
xmlEntityPtr xmlGetPredefinedEntity(const CHAR *name);
|
||||
xmlEntityPtr xmlGetDocEntity(xmlDocPtr doc, const CHAR *name);
|
||||
xmlEntityPtr xmlGetDtdEntity(xmlDocPtr doc, const CHAR *name);
|
||||
xmlEntityPtr xmlGetParameterEntity(xmlDocPtr doc, const CHAR *name);
|
||||
const CHAR *xmlEncodeEntities(xmlDocPtr doc, const CHAR *input);
|
||||
CHAR *xmlEncodeEntitiesReentrant(xmlDocPtr doc, const CHAR *input);
|
||||
xmlEntitiesTablePtr xmlCreateEntitiesTable(void);
|
||||
xmlEntitiesTablePtr xmlCopyEntitiesTable(xmlEntitiesTablePtr table);
|
||||
void xmlFreeEntitiesTable(xmlEntitiesTablePtr table);
|
||||
void xmlDumpEntitiesTable(xmlBufferPtr buf, xmlEntitiesTablePtr table);
|
||||
xmlEntitiesTablePtr xmlCopyEntitiesTable(xmlEntitiesTablePtr table);
|
||||
void xmlAddDocEntity (xmlDocPtr doc,
|
||||
const CHAR *name,
|
||||
int type,
|
||||
const CHAR *ExternalID,
|
||||
const CHAR *SystemID,
|
||||
const CHAR *content);
|
||||
void xmlAddDtdEntity (xmlDocPtr doc,
|
||||
const CHAR *name,
|
||||
int type,
|
||||
const CHAR *ExternalID,
|
||||
const CHAR *SystemID,
|
||||
const CHAR *content);
|
||||
xmlEntityPtr xmlGetPredefinedEntity (const CHAR *name);
|
||||
xmlEntityPtr xmlGetDocEntity (xmlDocPtr doc,
|
||||
const CHAR *name);
|
||||
xmlEntityPtr xmlGetDtdEntity (xmlDocPtr doc,
|
||||
const CHAR *name);
|
||||
xmlEntityPtr xmlGetParameterEntity (xmlDocPtr doc,
|
||||
const CHAR *name);
|
||||
const CHAR * xmlEncodeEntities (xmlDocPtr doc,
|
||||
const CHAR *input);
|
||||
CHAR * xmlEncodeEntitiesReentrant(xmlDocPtr doc,
|
||||
const CHAR *input);
|
||||
xmlEntitiesTablePtr xmlCreateEntitiesTable (void);
|
||||
xmlEntitiesTablePtr xmlCopyEntitiesTable (xmlEntitiesTablePtr table);
|
||||
void xmlFreeEntitiesTable (xmlEntitiesTablePtr table);
|
||||
void xmlDumpEntitiesTable (xmlBufferPtr buf,
|
||||
xmlEntitiesTablePtr table);
|
||||
xmlEntitiesTablePtr xmlCopyEntitiesTable (xmlEntitiesTablePtr table);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -47,6 +47,10 @@ typedef struct xmlParserInput {
|
||||
} xmlParserInput;
|
||||
typedef xmlParserInput *xmlParserInputPtr;
|
||||
|
||||
typedef xmlParserInputPtr (*xmlExternalEntityLoader)(const char *URL,
|
||||
const char *ID,
|
||||
xmlParserInputPtr context);
|
||||
|
||||
/**
|
||||
* the parser can be asked to collect Node informations, i.e. at what
|
||||
* place in the file they were detected.
|
||||
@ -84,7 +88,7 @@ typedef enum xmlParserInputState {
|
||||
XML_PARSER_DTD,
|
||||
XML_PARSER_EPILOG,
|
||||
XML_PARSER_COMMENT,
|
||||
XML_PARSER_CDATA_SECTION,
|
||||
XML_PARSER_CDATA_SECTION
|
||||
} xmlParserInputState;
|
||||
|
||||
/**
|
||||
@ -249,66 +253,104 @@ extern xmlSAXHandler htmlDefaultSAXHandler;
|
||||
* Input functions
|
||||
*/
|
||||
|
||||
int xmlParserInputRead(xmlParserInputPtr in, int len);
|
||||
int xmlParserInputGrow(xmlParserInputPtr in, int len);
|
||||
int xmlParserInputRead (xmlParserInputPtr in,
|
||||
int len);
|
||||
int xmlParserInputGrow (xmlParserInputPtr in,
|
||||
int len);
|
||||
|
||||
/**
|
||||
* CHAR handling
|
||||
*/
|
||||
CHAR *xmlStrdup(const CHAR *cur);
|
||||
CHAR *xmlStrndup(const CHAR *cur, int len);
|
||||
CHAR *xmlStrsub(const CHAR *str, int start, int len);
|
||||
const CHAR *xmlStrchr(const CHAR *str, CHAR val);
|
||||
const CHAR *xmlStrstr(const CHAR *str, CHAR *val);
|
||||
int xmlStrcmp(const CHAR *str1, const CHAR *str2);
|
||||
int xmlStrncmp(const CHAR *str1, const CHAR *str2, int len);
|
||||
int xmlStrlen(const CHAR *str);
|
||||
CHAR *xmlStrcat(CHAR *cur, const CHAR *add);
|
||||
CHAR *xmlStrncat(CHAR *cur, const CHAR *add, int len);
|
||||
CHAR * xmlStrdup (const CHAR *cur);
|
||||
CHAR * xmlStrndup (const CHAR *cur,
|
||||
int len);
|
||||
CHAR * xmlStrsub (const CHAR *str,
|
||||
int start,
|
||||
int len);
|
||||
const CHAR * xmlStrchr (const CHAR *str,
|
||||
CHAR val);
|
||||
const CHAR * xmlStrstr (const CHAR *str,
|
||||
CHAR *val);
|
||||
int xmlStrcmp (const CHAR *str1,
|
||||
const CHAR *str2);
|
||||
int xmlStrncmp (const CHAR *str1,
|
||||
const CHAR *str2,
|
||||
int len);
|
||||
int xmlStrlen (const CHAR *str);
|
||||
CHAR * xmlStrcat (CHAR *cur,
|
||||
const CHAR *add);
|
||||
CHAR * xmlStrncat (CHAR *cur,
|
||||
const CHAR *add,
|
||||
int len);
|
||||
|
||||
/**
|
||||
* Basic parsing Interfaces
|
||||
*/
|
||||
xmlDocPtr xmlParseDoc(CHAR *cur);
|
||||
xmlDocPtr xmlParseMemory(char *buffer, int size);
|
||||
xmlDocPtr xmlParseFile(const char *filename);
|
||||
int xmlSubstituteEntitiesDefault(int val);
|
||||
xmlDocPtr xmlParseDoc (CHAR *cur);
|
||||
xmlDocPtr xmlParseMemory (char *buffer,
|
||||
int size);
|
||||
xmlDocPtr xmlParseFile (const char *filename);
|
||||
int xmlSubstituteEntitiesDefault(int val);
|
||||
|
||||
/**
|
||||
* Recovery mode
|
||||
*/
|
||||
xmlDocPtr xmlRecoverDoc(CHAR *cur);
|
||||
xmlDocPtr xmlRecoverMemory(char *buffer, int size);
|
||||
xmlDocPtr xmlRecoverFile(const char *filename);
|
||||
xmlDocPtr xmlRecoverDoc (CHAR *cur);
|
||||
xmlDocPtr xmlRecoverMemory (char *buffer,
|
||||
int size);
|
||||
xmlDocPtr xmlRecoverFile (const char *filename);
|
||||
|
||||
/**
|
||||
* Less common routines and SAX interfaces
|
||||
*/
|
||||
int xmlParseDocument(xmlParserCtxtPtr ctxt);
|
||||
xmlDocPtr xmlSAXParseDoc(xmlSAXHandlerPtr sax, CHAR *cur, int recovery);
|
||||
xmlDocPtr xmlSAXParseMemory(xmlSAXHandlerPtr sax, char *buffer,
|
||||
int size, int recovery);
|
||||
xmlDocPtr xmlSAXParseFile(xmlSAXHandlerPtr sax, const char *filename,
|
||||
int recovery);
|
||||
xmlDtdPtr xmlParseDTD(const CHAR *ExternalID, const CHAR *SystemID);
|
||||
xmlDtdPtr xmlSAXParseDTD(xmlSAXHandlerPtr sax, const CHAR *ExternalID,
|
||||
const CHAR *SystemID);
|
||||
void xmlInitParserCtxt(xmlParserCtxtPtr ctxt);
|
||||
void xmlClearParserCtxt(xmlParserCtxtPtr ctxt);
|
||||
void xmlSetupParserForBuffer(xmlParserCtxtPtr ctxt, const CHAR* buffer,
|
||||
const char* filename);
|
||||
int xmlParseDocument (xmlParserCtxtPtr ctxt);
|
||||
xmlDocPtr xmlSAXParseDoc (xmlSAXHandlerPtr sax,
|
||||
CHAR *cur,
|
||||
int recovery);
|
||||
xmlDocPtr xmlSAXParseMemory (xmlSAXHandlerPtr sax,
|
||||
char *buffer,
|
||||
int size,
|
||||
int recovery);
|
||||
xmlDocPtr xmlSAXParseFile (xmlSAXHandlerPtr sax,
|
||||
const char *filename,
|
||||
int recovery);
|
||||
xmlDtdPtr xmlParseDTD (const CHAR *ExternalID,
|
||||
const CHAR *SystemID);
|
||||
xmlDtdPtr xmlSAXParseDTD (xmlSAXHandlerPtr sax,
|
||||
const CHAR *ExternalID,
|
||||
const CHAR *SystemID);
|
||||
void xmlInitParserCtxt (xmlParserCtxtPtr ctxt);
|
||||
void xmlClearParserCtxt (xmlParserCtxtPtr ctxt);
|
||||
void xmlSetupParserForBuffer (xmlParserCtxtPtr ctxt,
|
||||
const CHAR* buffer,
|
||||
const char* filename);
|
||||
void xmlDefaultSAXHandlerInit(void);
|
||||
void htmlDefaultSAXHandlerInit(void);
|
||||
|
||||
const xmlParserNodeInfo* xmlParserFindNodeInfo(const xmlParserCtxt* ctxt,
|
||||
/**
|
||||
* Node infos
|
||||
*/
|
||||
const xmlParserNodeInfo*
|
||||
xmlParserFindNodeInfo (const xmlParserCtxt* ctxt,
|
||||
const xmlNode* node);
|
||||
void xmlInitNodeInfoSeq(xmlParserNodeInfoSeqPtr seq);
|
||||
void xmlClearNodeInfoSeq(xmlParserNodeInfoSeqPtr seq);
|
||||
void xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
|
||||
void xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
|
||||
unsigned long xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeq* seq,
|
||||
const xmlNode* node);
|
||||
void xmlParserAddNodeInfo(xmlParserCtxtPtr ctxt,
|
||||
const xmlParserNodeInfo* info);
|
||||
void xmlParserAddNodeInfo (xmlParserCtxtPtr ctxt,
|
||||
const xmlParserNodeInfo* info);
|
||||
|
||||
void xmlDefaultSAXHandlerInit(void);
|
||||
void htmlDefaultSAXHandlerInit(void);
|
||||
/*
|
||||
* External entities handling actually implemented in xmlIO
|
||||
*/
|
||||
|
||||
void xmlSetExternalEntityLoader(xmlExternalEntityLoader f);
|
||||
xmlExternalEntityLoader
|
||||
xmlGetExternalEntityLoader(void);
|
||||
xmlParserInputPtr
|
||||
xmlLoadExternalEntity (const char *URL,
|
||||
const char *ID,
|
||||
xmlParserInputPtr context);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -15,6 +15,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define XML_MAX_NAMELEN 1000
|
||||
|
||||
/**
|
||||
* A few macros needed to help building the parser.
|
||||
*/
|
||||
@ -510,154 +512,112 @@ typedef unsigned char CHARVAL;
|
||||
* entity substitution default behaviour.
|
||||
*/
|
||||
|
||||
int xmlSubstituteEntitiesDefaultValue;
|
||||
int xmlSubstituteEntitiesDefaultValue;
|
||||
|
||||
/**
|
||||
* Parser context
|
||||
*/
|
||||
xmlParserCtxtPtr
|
||||
xmlCreateDocParserCtxt(CHAR *cur);
|
||||
xmlParserCtxtPtr
|
||||
xmlCreateFileParserCtxt(const char *filename);
|
||||
xmlParserCtxtPtr
|
||||
xmlCreateMemoryParserCtxt(char *buffer, int size);
|
||||
void
|
||||
xmlFreeParserCtxt(xmlParserCtxtPtr ctxt);
|
||||
xmlParserCtxtPtr
|
||||
xmlNewParserCtxt();
|
||||
void
|
||||
xmlSwitchEncoding(xmlParserCtxtPtr ctxt, xmlCharEncoding enc);
|
||||
xmlParserCtxtPtr xmlCreateDocParserCtxt (CHAR *cur);
|
||||
xmlParserCtxtPtr xmlCreateFileParserCtxt (const char *filename);
|
||||
xmlParserCtxtPtr xmlCreateMemoryParserCtxt(char *buffer,
|
||||
int size);
|
||||
void xmlFreeParserCtxt (xmlParserCtxtPtr ctxt);
|
||||
xmlParserCtxtPtr xmlNewParserCtxt (void);
|
||||
void xmlSwitchEncoding (xmlParserCtxtPtr ctxt,
|
||||
xmlCharEncoding enc);
|
||||
|
||||
/**
|
||||
* Entities
|
||||
*/
|
||||
void
|
||||
xmlHandleEntity(xmlParserCtxtPtr ctxt, xmlEntityPtr entity);
|
||||
void xmlHandleEntity (xmlParserCtxtPtr ctxt,
|
||||
xmlEntityPtr entity);
|
||||
|
||||
/**
|
||||
* Input Streams
|
||||
*/
|
||||
xmlParserInputPtr
|
||||
xmlNewEntityInputStream(xmlParserCtxtPtr ctxt, xmlEntityPtr entity);
|
||||
void
|
||||
xmlPushInput(xmlParserCtxtPtr ctxt, xmlParserInputPtr input);
|
||||
CHAR
|
||||
xmlPopInput(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlFreeInputStream(xmlParserInputPtr input);
|
||||
xmlParserInputPtr
|
||||
xmlNewInputFromFile(xmlParserCtxtPtr ctxt, const char *filename);
|
||||
xmlParserInputPtr xmlNewEntityInputStream (xmlParserCtxtPtr ctxt,
|
||||
xmlEntityPtr entity);
|
||||
void xmlPushInput (xmlParserCtxtPtr ctxt,
|
||||
xmlParserInputPtr input);
|
||||
CHAR xmlPopInput (xmlParserCtxtPtr ctxt);
|
||||
void xmlFreeInputStream (xmlParserInputPtr input);
|
||||
xmlParserInputPtr xmlNewInputFromFile (xmlParserCtxtPtr ctxt,
|
||||
const char *filename);
|
||||
|
||||
/**
|
||||
* Namespaces.
|
||||
*/
|
||||
CHAR *
|
||||
xmlSplitQName(const CHAR *name, CHAR **prefix);
|
||||
CHAR *
|
||||
xmlNamespaceParseNCName(xmlParserCtxtPtr ctxt);
|
||||
CHAR *
|
||||
xmlNamespaceParseQName(xmlParserCtxtPtr ctxt, CHAR **prefix);
|
||||
CHAR *
|
||||
xmlNamespaceParseNSDef(xmlParserCtxtPtr ctxt);
|
||||
CHAR *
|
||||
xmlParseQuotedString(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParseNamespace(xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlSplitQName (const CHAR *name,
|
||||
CHAR **prefix);
|
||||
CHAR * xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlNamespaceParseQName (xmlParserCtxtPtr ctxt,
|
||||
CHAR **prefix);
|
||||
CHAR * xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlParseQuotedString (xmlParserCtxtPtr ctxt);
|
||||
void xmlParseNamespace (xmlParserCtxtPtr ctxt);
|
||||
|
||||
/**
|
||||
* Generic production rules
|
||||
*/
|
||||
CHAR *
|
||||
xmlScanName(xmlParserCtxtPtr ctxt);
|
||||
CHAR *
|
||||
xmlParseName(xmlParserCtxtPtr ctxt);
|
||||
CHAR *
|
||||
xmlParseNmtoken(xmlParserCtxtPtr ctxt);
|
||||
CHAR *
|
||||
xmlParseEntityValue(xmlParserCtxtPtr ctxt, CHAR **orig);
|
||||
CHAR *
|
||||
xmlParseAttValue(xmlParserCtxtPtr ctxt);
|
||||
CHAR *
|
||||
xmlParseSystemLiteral(xmlParserCtxtPtr ctxt);
|
||||
CHAR *
|
||||
xmlParsePubidLiteral(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParseCharData(xmlParserCtxtPtr ctxt, int cdata);
|
||||
CHAR *
|
||||
xmlParseExternalID(xmlParserCtxtPtr ctxt, CHAR **publicID, int strict);
|
||||
void
|
||||
xmlParseComment(xmlParserCtxtPtr ctxt, int create);
|
||||
CHAR *
|
||||
xmlParsePITarget(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParsePI(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParseNotationDecl(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParseEntityDecl(xmlParserCtxtPtr ctxt);
|
||||
int
|
||||
xmlParseDefaultDecl(xmlParserCtxtPtr ctxt, CHAR **value);
|
||||
xmlEnumerationPtr
|
||||
xmlParseNotationType(xmlParserCtxtPtr ctxt);
|
||||
xmlEnumerationPtr
|
||||
xmlParseEnumerationType(xmlParserCtxtPtr ctxt);
|
||||
int
|
||||
xmlParseEnumeratedType(xmlParserCtxtPtr ctxt, xmlEnumerationPtr *tree);
|
||||
int
|
||||
xmlParseAttributeType(xmlParserCtxtPtr ctxt, xmlEnumerationPtr *tree);
|
||||
void
|
||||
xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt);
|
||||
xmlElementContentPtr
|
||||
xmlParseElementMixedContentDecl(xmlParserCtxtPtr ctxt);
|
||||
xmlElementContentPtr
|
||||
xmlParseElementChildrenContentDecl(xmlParserCtxtPtr ctxt);
|
||||
int
|
||||
xmlParseElementContentDecl(xmlParserCtxtPtr ctxt, CHAR *name,
|
||||
xmlElementContentPtr *result);
|
||||
int
|
||||
xmlParseElementDecl(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParseMarkupDecl(xmlParserCtxtPtr ctxt);
|
||||
int
|
||||
xmlParseCharRef(xmlParserCtxtPtr ctxt);
|
||||
xmlEntityPtr
|
||||
xmlParseEntityRef(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParseReference(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParsePEReference(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParseDocTypeDecl(xmlParserCtxtPtr ctxt);
|
||||
CHAR *
|
||||
xmlParseAttribute(xmlParserCtxtPtr ctxt, CHAR **value);
|
||||
CHAR *
|
||||
xmlParseStartTag(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParseEndTag(xmlParserCtxtPtr ctxt, CHAR *tagname);
|
||||
void
|
||||
xmlParseCDSect(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParseContent(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParseElement(xmlParserCtxtPtr ctxt);
|
||||
CHAR *
|
||||
xmlParseVersionNum(xmlParserCtxtPtr ctxt);
|
||||
CHAR *
|
||||
xmlParseVersionInfo(xmlParserCtxtPtr ctxt);
|
||||
CHAR *
|
||||
xmlParseEncName(xmlParserCtxtPtr ctxt);
|
||||
CHAR *
|
||||
xmlParseEncodingDecl(xmlParserCtxtPtr ctxt);
|
||||
int
|
||||
xmlParseSDDecl(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParseXMLDecl(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParseMisc(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const CHAR *ExternalID,
|
||||
const CHAR *SystemID);
|
||||
|
||||
CHAR * xmlScanName (xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlParseName (xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlParseNmtoken (xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlParseEntityValue (xmlParserCtxtPtr ctxt,
|
||||
CHAR **orig);
|
||||
CHAR * xmlParseAttValue (xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlParseSystemLiteral (xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlParsePubidLiteral (xmlParserCtxtPtr ctxt);
|
||||
void xmlParseCharData (xmlParserCtxtPtr ctxt,
|
||||
int cdata);
|
||||
CHAR * xmlParseExternalID (xmlParserCtxtPtr ctxt,
|
||||
CHAR **publicID,
|
||||
int strict);
|
||||
void xmlParseComment (xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlParsePITarget (xmlParserCtxtPtr ctxt);
|
||||
void xmlParsePI (xmlParserCtxtPtr ctxt);
|
||||
void xmlParseNotationDecl (xmlParserCtxtPtr ctxt);
|
||||
void xmlParseEntityDecl (xmlParserCtxtPtr ctxt);
|
||||
int xmlParseDefaultDecl (xmlParserCtxtPtr ctxt,
|
||||
CHAR **value);
|
||||
xmlEnumerationPtr xmlParseNotationType (xmlParserCtxtPtr ctxt);
|
||||
xmlEnumerationPtr xmlParseEnumerationType (xmlParserCtxtPtr ctxt);
|
||||
int xmlParseEnumeratedType (xmlParserCtxtPtr ctxt,
|
||||
xmlEnumerationPtr *tree);
|
||||
int xmlParseAttributeType (xmlParserCtxtPtr ctxt,
|
||||
xmlEnumerationPtr *tree);
|
||||
void xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt);
|
||||
xmlElementContentPtr xmlParseElementMixedContentDecl
|
||||
(xmlParserCtxtPtr ctxt);
|
||||
xmlElementContentPtr xmlParseElementChildrenContentDecl
|
||||
(xmlParserCtxtPtr ctxt);
|
||||
int xmlParseElementContentDecl(xmlParserCtxtPtr ctxt,
|
||||
CHAR *name,
|
||||
xmlElementContentPtr *result);
|
||||
int xmlParseElementDecl (xmlParserCtxtPtr ctxt);
|
||||
void xmlParseMarkupDecl (xmlParserCtxtPtr ctxt);
|
||||
int xmlParseCharRef (xmlParserCtxtPtr ctxt);
|
||||
xmlEntityPtr xmlParseEntityRef (xmlParserCtxtPtr ctxt);
|
||||
void xmlParseReference (xmlParserCtxtPtr ctxt);
|
||||
void xmlParsePEReference (xmlParserCtxtPtr ctxt);
|
||||
void xmlParseDocTypeDecl (xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlParseAttribute (xmlParserCtxtPtr ctxt,
|
||||
CHAR **value);
|
||||
CHAR * xmlParseStartTag (xmlParserCtxtPtr ctxt);
|
||||
void xmlParseEndTag (xmlParserCtxtPtr ctxt,
|
||||
CHAR *tagname);
|
||||
void xmlParseCDSect (xmlParserCtxtPtr ctxt);
|
||||
void xmlParseContent (xmlParserCtxtPtr ctxt);
|
||||
void xmlParseElement (xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlParseVersionNum (xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlParseVersionInfo (xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlParseEncName (xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlParseEncodingDecl (xmlParserCtxtPtr ctxt);
|
||||
int xmlParseSDDecl (xmlParserCtxtPtr ctxt);
|
||||
void xmlParseXMLDecl (xmlParserCtxtPtr ctxt);
|
||||
void xmlParseMisc (xmlParserCtxtPtr ctxt);
|
||||
void xmlParseExternalSubset (xmlParserCtxtPtr ctxt,
|
||||
const CHAR *ExternalID,
|
||||
const CHAR *SystemID);
|
||||
/*
|
||||
* Entities substitution
|
||||
*/
|
||||
@ -666,16 +626,21 @@ xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const CHAR *ExternalID,
|
||||
#define XML_SUBSTITUTE_PEREF 2
|
||||
#define XML_SUBSTITUTE_BOTH 3
|
||||
|
||||
CHAR *
|
||||
xmlDecodeEntities(xmlParserCtxtPtr ctxt, int len, int what,
|
||||
CHAR end, CHAR end2, CHAR end3);
|
||||
CHAR * xmlDecodeEntities (xmlParserCtxtPtr ctxt,
|
||||
int len,
|
||||
int what,
|
||||
CHAR end,
|
||||
CHAR end2,
|
||||
CHAR end3);
|
||||
|
||||
/*
|
||||
* Generated by MACROS on top of parser.c c.f. PUSH_AND_POP
|
||||
*/
|
||||
extern int nodePush(xmlParserCtxtPtr ctxt, xmlNodePtr value);
|
||||
extern xmlNodePtr nodePop(xmlParserCtxtPtr ctxt);
|
||||
extern int inputPush(xmlParserCtxtPtr ctxt, xmlParserInputPtr value);
|
||||
extern xmlParserInputPtr inputPop(xmlParserCtxtPtr ctxt);
|
||||
int nodePush (xmlParserCtxtPtr ctxt,
|
||||
xmlNodePtr value);
|
||||
xmlNodePtr nodePop (xmlParserCtxtPtr ctxt);
|
||||
int inputPush (xmlParserCtxtPtr ctxt,
|
||||
xmlParserInputPtr value);
|
||||
xmlParserInputPtr inputPop (xmlParserCtxtPtr ctxt);
|
||||
|
||||
#endif /* __XML_PARSER_INTERNALS_H__ */
|
||||
|
@ -53,6 +53,8 @@ typedef unsigned short CHAR;
|
||||
typedef unsigned char CHAR;
|
||||
#endif
|
||||
|
||||
#define BAD_CAST (CHAR *)
|
||||
|
||||
/*
|
||||
* a DTD Notation definition
|
||||
*/
|
||||
@ -193,6 +195,7 @@ typedef struct xmlAttr {
|
||||
struct xmlAttr *next; /* attribute list link */
|
||||
const CHAR *name; /* the name of the property */
|
||||
struct xmlNode *val; /* the value of the property */
|
||||
xmlNs *ns; /* pointer to the associated namespace */
|
||||
} xmlAttr;
|
||||
typedef xmlAttr *xmlAttrPtr;
|
||||
|
||||
@ -277,124 +280,195 @@ extern int xmlIndentTreeOutput; /* try to indent the tree dumps */
|
||||
* Handling Buffers.
|
||||
*/
|
||||
|
||||
xmlBufferPtr xmlBufferCreate(void);
|
||||
void xmlBufferFree(xmlBufferPtr buf);
|
||||
int xmlBufferDump(FILE *file, xmlBufferPtr buf);
|
||||
void xmlBufferAdd(xmlBufferPtr buf, const CHAR *str, int len);
|
||||
void xmlBufferCat(xmlBufferPtr buf, const CHAR *str);
|
||||
void xmlBufferCCat(xmlBufferPtr buf, const char *str);
|
||||
int xmlBufferShrink(xmlBufferPtr buf, int len);
|
||||
void xmlBufferEmpty(xmlBufferPtr buf);
|
||||
xmlBufferPtr xmlBufferCreate (void);
|
||||
void xmlBufferFree (xmlBufferPtr buf);
|
||||
int xmlBufferDump (FILE *file,
|
||||
xmlBufferPtr buf);
|
||||
void xmlBufferAdd (xmlBufferPtr buf,
|
||||
const CHAR *str,
|
||||
int len);
|
||||
void xmlBufferCat (xmlBufferPtr buf,
|
||||
const CHAR *str);
|
||||
void xmlBufferCCat (xmlBufferPtr buf,
|
||||
const char *str);
|
||||
int xmlBufferShrink (xmlBufferPtr buf,
|
||||
int len);
|
||||
void xmlBufferEmpty (xmlBufferPtr buf);
|
||||
|
||||
/*
|
||||
* Creating/freeing new structures
|
||||
*/
|
||||
xmlDtdPtr xmlCreateIntSubset(xmlDocPtr doc, const CHAR *name,
|
||||
const CHAR *ExternalID, const CHAR *SystemID);
|
||||
xmlDtdPtr xmlNewDtd(xmlDocPtr doc, const CHAR *name,
|
||||
const CHAR *ExternalID, const CHAR *SystemID);
|
||||
void xmlFreeDtd(xmlDtdPtr cur);
|
||||
xmlNsPtr xmlNewGlobalNs(xmlDocPtr doc, const CHAR *href, const CHAR *prefix);
|
||||
xmlNsPtr xmlNewNs(xmlNodePtr node, const CHAR *href, const CHAR *prefix);
|
||||
void xmlFreeNs(xmlNsPtr cur);
|
||||
xmlDocPtr xmlNewDoc(const CHAR *version);
|
||||
void xmlFreeDoc(xmlDocPtr cur);
|
||||
xmlAttrPtr xmlNewDocProp(xmlDocPtr doc, const CHAR *name,
|
||||
const CHAR *value);
|
||||
xmlAttrPtr xmlNewProp(xmlNodePtr node, const CHAR *name,
|
||||
const CHAR *value);
|
||||
void xmlFreePropList(xmlAttrPtr cur);
|
||||
void xmlFreeProp(xmlAttrPtr cur);
|
||||
xmlAttrPtr xmlCopyProp(xmlAttrPtr cur);
|
||||
xmlAttrPtr xmlCopyPropList(xmlAttrPtr cur);
|
||||
xmlDtdPtr xmlCopyDtd(xmlDtdPtr dtd);
|
||||
xmlDocPtr xmlCopyDoc(xmlDocPtr doc, int recursive);
|
||||
xmlDtdPtr xmlCreateIntSubset (xmlDocPtr doc,
|
||||
const CHAR *name,
|
||||
const CHAR *ExternalID,
|
||||
const CHAR *SystemID);
|
||||
xmlDtdPtr xmlNewDtd (xmlDocPtr doc,
|
||||
const CHAR *name,
|
||||
const CHAR *ExternalID,
|
||||
const CHAR *SystemID);
|
||||
void xmlFreeDtd (xmlDtdPtr cur);
|
||||
xmlNsPtr xmlNewGlobalNs (xmlDocPtr doc,
|
||||
const CHAR *href,
|
||||
const CHAR *prefix);
|
||||
xmlNsPtr xmlNewNs (xmlNodePtr node,
|
||||
const CHAR *href,
|
||||
const CHAR *prefix);
|
||||
void xmlFreeNs (xmlNsPtr cur);
|
||||
xmlDocPtr xmlNewDoc (const CHAR *version);
|
||||
void xmlFreeDoc (xmlDocPtr cur);
|
||||
xmlAttrPtr xmlNewDocProp (xmlDocPtr doc,
|
||||
const CHAR *name,
|
||||
const CHAR *value);
|
||||
xmlAttrPtr xmlNewProp (xmlNodePtr node,
|
||||
const CHAR *name,
|
||||
const CHAR *value);
|
||||
xmlAttrPtr xmlNewNsProp (xmlNodePtr node,
|
||||
xmlNsPtr ns,
|
||||
const CHAR *name,
|
||||
const CHAR *value);
|
||||
void xmlFreePropList (xmlAttrPtr cur);
|
||||
void xmlFreeProp (xmlAttrPtr cur);
|
||||
xmlAttrPtr xmlCopyProp (xmlNodePtr target,
|
||||
xmlAttrPtr cur);
|
||||
xmlAttrPtr xmlCopyPropList (xmlNodePtr target,
|
||||
xmlAttrPtr cur);
|
||||
xmlDtdPtr xmlCopyDtd (xmlDtdPtr dtd);
|
||||
xmlDocPtr xmlCopyDoc (xmlDocPtr doc,
|
||||
int recursive);
|
||||
|
||||
/*
|
||||
* Creating new nodes
|
||||
*/
|
||||
xmlNodePtr xmlNewDocNode(xmlDocPtr doc, xmlNsPtr ns,
|
||||
const CHAR *name, const CHAR *content);
|
||||
xmlNodePtr xmlNewNode(xmlNsPtr ns, const CHAR *name);
|
||||
xmlNodePtr xmlNewChild(xmlNodePtr parent, xmlNsPtr ns,
|
||||
const CHAR *name, const CHAR *content);
|
||||
xmlNodePtr xmlNewDocText(xmlDocPtr doc, const CHAR *content);
|
||||
xmlNodePtr xmlNewText(const CHAR *content);
|
||||
xmlNodePtr xmlNewDocTextLen(xmlDocPtr doc, const CHAR *content, int len);
|
||||
xmlNodePtr xmlNewTextLen(const CHAR *content, int len);
|
||||
xmlNodePtr xmlNewDocComment(xmlDocPtr doc, const CHAR *content);
|
||||
xmlNodePtr xmlNewComment(const CHAR *content);
|
||||
xmlNodePtr xmlNewCDataBlock(xmlDocPtr doc, const CHAR *content, int len);
|
||||
xmlNodePtr xmlNewReference(xmlDocPtr doc, const CHAR *name);
|
||||
xmlNodePtr xmlCopyNode(xmlNodePtr node, int recursive);
|
||||
xmlNodePtr xmlCopyNodeList(xmlNodePtr node);
|
||||
xmlNodePtr xmlNewDocNode (xmlDocPtr doc,
|
||||
xmlNsPtr ns,
|
||||
const CHAR *name,
|
||||
const CHAR *content);
|
||||
xmlNodePtr xmlNewNode (xmlNsPtr ns,
|
||||
const CHAR *name);
|
||||
xmlNodePtr xmlNewChild (xmlNodePtr parent,
|
||||
xmlNsPtr ns,
|
||||
const CHAR *name,
|
||||
const CHAR *content);
|
||||
xmlNodePtr xmlNewDocText (xmlDocPtr doc,
|
||||
const CHAR *content);
|
||||
xmlNodePtr xmlNewText (const CHAR *content);
|
||||
xmlNodePtr xmlNewPI (const CHAR *name,
|
||||
const CHAR *content);
|
||||
xmlNodePtr xmlNewDocTextLen (xmlDocPtr doc,
|
||||
const CHAR *content,
|
||||
int len);
|
||||
xmlNodePtr xmlNewTextLen (const CHAR *content,
|
||||
int len);
|
||||
xmlNodePtr xmlNewDocComment (xmlDocPtr doc,
|
||||
const CHAR *content);
|
||||
xmlNodePtr xmlNewComment (const CHAR *content);
|
||||
xmlNodePtr xmlNewCDataBlock (xmlDocPtr doc,
|
||||
const CHAR *content,
|
||||
int len);
|
||||
xmlNodePtr xmlNewReference (xmlDocPtr doc,
|
||||
const CHAR *name);
|
||||
xmlNodePtr xmlCopyNode (xmlNodePtr node,
|
||||
int recursive);
|
||||
xmlNodePtr xmlCopyNodeList (xmlNodePtr node);
|
||||
|
||||
/*
|
||||
* Navigating
|
||||
*/
|
||||
xmlNodePtr xmlGetLastChild(xmlNodePtr parent);
|
||||
int xmlNodeIsText(xmlNodePtr node);
|
||||
xmlNodePtr xmlGetLastChild (xmlNodePtr parent);
|
||||
int xmlNodeIsText (xmlNodePtr node);
|
||||
|
||||
/*
|
||||
* Changing the structure
|
||||
*/
|
||||
xmlNodePtr xmlAddChild(xmlNodePtr parent, xmlNodePtr cur);
|
||||
void xmlUnlinkNode(xmlNodePtr cur);
|
||||
|
||||
xmlNodePtr xmlTextMerge(xmlNodePtr first, xmlNodePtr second);
|
||||
void xmlTextConcat(xmlNodePtr node, const CHAR *content, int len);
|
||||
|
||||
void xmlFreeNodeList(xmlNodePtr cur);
|
||||
void xmlFreeNode(xmlNodePtr cur);
|
||||
xmlNodePtr xmlAddChild (xmlNodePtr parent,
|
||||
xmlNodePtr cur);
|
||||
xmlNodePtr xmlAddSibling (xmlNodePtr cur,
|
||||
xmlNodePtr elem);
|
||||
void xmlUnlinkNode (xmlNodePtr cur);
|
||||
xmlNodePtr xmlTextMerge (xmlNodePtr first,
|
||||
xmlNodePtr second);
|
||||
void xmlTextConcat (xmlNodePtr node,
|
||||
const CHAR *content,
|
||||
int len);
|
||||
void xmlFreeNodeList (xmlNodePtr cur);
|
||||
void xmlFreeNode (xmlNodePtr cur);
|
||||
|
||||
/*
|
||||
* Namespaces
|
||||
*/
|
||||
xmlNsPtr xmlSearchNs(xmlDocPtr doc, xmlNodePtr node,
|
||||
const CHAR *nameSpace);
|
||||
xmlNsPtr xmlSearchNsByHref(xmlDocPtr doc, xmlNodePtr node,
|
||||
const CHAR *href);
|
||||
void xmlSetNs(xmlNodePtr node, xmlNsPtr ns);
|
||||
xmlNsPtr xmlCopyNamespace(xmlNsPtr cur);
|
||||
xmlNsPtr xmlCopyNamespaceList(xmlNsPtr cur);
|
||||
xmlNsPtr xmlSearchNs (xmlDocPtr doc,
|
||||
xmlNodePtr node,
|
||||
const CHAR *nameSpace);
|
||||
xmlNsPtr xmlSearchNsByHref (xmlDocPtr doc,
|
||||
xmlNodePtr node,
|
||||
const CHAR *href);
|
||||
xmlNsPtr * xmlGetNsList (xmlDocPtr doc,
|
||||
xmlNodePtr node);
|
||||
void xmlSetNs (xmlNodePtr node,
|
||||
xmlNsPtr ns);
|
||||
xmlNsPtr xmlCopyNamespace (xmlNsPtr cur);
|
||||
xmlNsPtr xmlCopyNamespaceList (xmlNsPtr cur);
|
||||
|
||||
/*
|
||||
* Changing the content.
|
||||
*/
|
||||
xmlAttrPtr xmlSetProp(xmlNodePtr node, const CHAR *name,
|
||||
const CHAR *value);
|
||||
CHAR *xmlGetProp(xmlNodePtr node, const CHAR *name);
|
||||
xmlNodePtr xmlStringGetNodeList(xmlDocPtr doc, const CHAR *value);
|
||||
xmlNodePtr xmlStringLenGetNodeList(xmlDocPtr doc, const CHAR *value,
|
||||
int len);
|
||||
CHAR *xmlNodeListGetString(xmlDocPtr doc, xmlNodePtr list, int inLine);
|
||||
void xmlNodeSetContent(xmlNodePtr cur, const CHAR *content);
|
||||
void xmlNodeSetContentLen(xmlNodePtr cur, const CHAR *content, int len);
|
||||
void xmlNodeAddContent(xmlNodePtr cur, const CHAR *content);
|
||||
void xmlNodeAddContentLen(xmlNodePtr cur, const CHAR *content, int len);
|
||||
CHAR *xmlNodeGetContent(xmlNodePtr cur);
|
||||
xmlAttrPtr xmlSetProp (xmlNodePtr node,
|
||||
const CHAR *name,
|
||||
const CHAR *value);
|
||||
CHAR * xmlGetProp (xmlNodePtr node,
|
||||
const CHAR *name);
|
||||
xmlNodePtr xmlStringGetNodeList (xmlDocPtr doc,
|
||||
const CHAR *value);
|
||||
xmlNodePtr xmlStringLenGetNodeList (xmlDocPtr doc,
|
||||
const CHAR *value,
|
||||
int len);
|
||||
CHAR * xmlNodeListGetString (xmlDocPtr doc,
|
||||
xmlNodePtr list,
|
||||
int inLine);
|
||||
void xmlNodeSetContent (xmlNodePtr cur,
|
||||
const CHAR *content);
|
||||
void xmlNodeSetContentLen (xmlNodePtr cur,
|
||||
const CHAR *content,
|
||||
int len);
|
||||
void xmlNodeAddContent (xmlNodePtr cur,
|
||||
const CHAR *content);
|
||||
void xmlNodeAddContentLen (xmlNodePtr cur,
|
||||
const CHAR *content,
|
||||
int len);
|
||||
CHAR * xmlNodeGetContent (xmlNodePtr cur);
|
||||
const CHAR * xmlNodeGetLang (xmlNodePtr cur);
|
||||
void xmlNodeSetLang (xmlNodePtr cur,
|
||||
const CHAR *lang);
|
||||
|
||||
/*
|
||||
* Internal, don't use
|
||||
*/
|
||||
void xmlBufferWriteCHAR(xmlBufferPtr buf, const CHAR *string);
|
||||
void xmlBufferWriteChar(xmlBufferPtr buf, const char *string);
|
||||
void xmlBufferWriteQuotedString(xmlBufferPtr buf, const CHAR *string);
|
||||
void xmlBufferWriteCHAR (xmlBufferPtr buf,
|
||||
const CHAR *string);
|
||||
void xmlBufferWriteChar (xmlBufferPtr buf,
|
||||
const char *string);
|
||||
void xmlBufferWriteQuotedString(xmlBufferPtr buf,
|
||||
const CHAR *string);
|
||||
|
||||
/*
|
||||
* Saving
|
||||
*/
|
||||
void xmlDocDumpMemory(xmlDocPtr cur, CHAR**mem, int *size);
|
||||
void xmlDocDump(FILE *f, xmlDocPtr cur);
|
||||
int xmlSaveFile(const char *filename, xmlDocPtr cur);
|
||||
void xmlDocDumpMemory (xmlDocPtr cur,
|
||||
CHAR**mem,
|
||||
int *size);
|
||||
void xmlDocDump (FILE *f,
|
||||
xmlDocPtr cur);
|
||||
int xmlSaveFile (const char *filename,
|
||||
xmlDocPtr cur);
|
||||
|
||||
/*
|
||||
* Compression
|
||||
*/
|
||||
int xmlGetDocCompressMode (xmlDocPtr doc);
|
||||
void xmlSetDocCompressMode (xmlDocPtr doc, int mode);
|
||||
int xmlGetCompressMode(void);
|
||||
void xmlSetCompressMode(int mode);
|
||||
int xmlGetDocCompressMode (xmlDocPtr doc);
|
||||
void xmlSetDocCompressMode (xmlDocPtr doc,
|
||||
int mode);
|
||||
int xmlGetCompressMode (void);
|
||||
void xmlSetCompressMode (int mode);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -84,62 +84,107 @@ typedef struct xmlIDTable {
|
||||
typedef xmlIDTable *xmlIDTablePtr;
|
||||
|
||||
/* Notation */
|
||||
xmlNotationPtr xmlAddNotationDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd,
|
||||
const CHAR *name, const CHAR *PublicID, const CHAR *SystemID);
|
||||
xmlNotationPtr xmlAddNotationDecl (xmlValidCtxtPtr ctxt,
|
||||
xmlDtdPtr dtd,
|
||||
const CHAR *name,
|
||||
const CHAR *PublicID,
|
||||
const CHAR *SystemID);
|
||||
xmlNotationTablePtr xmlCopyNotationTable(xmlNotationTablePtr table);
|
||||
void xmlFreeNotationTable(xmlNotationTablePtr table);
|
||||
void xmlDumpNotationTable(xmlBufferPtr buf, xmlNotationTablePtr table);
|
||||
void xmlFreeNotationTable(xmlNotationTablePtr table);
|
||||
void xmlDumpNotationTable(xmlBufferPtr buf,
|
||||
xmlNotationTablePtr table);
|
||||
|
||||
/* Element Content */
|
||||
xmlElementContentPtr xmlNewElementContent(CHAR *name, int type);
|
||||
xmlElementContentPtr xmlNewElementContent (CHAR *name, int type);
|
||||
xmlElementContentPtr xmlCopyElementContent(xmlElementContentPtr content);
|
||||
void xmlFreeElementContent(xmlElementContentPtr cur);
|
||||
void xmlFreeElementContent(xmlElementContentPtr cur);
|
||||
|
||||
/* Element */
|
||||
xmlElementPtr xmlAddElementDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd,
|
||||
const CHAR *name, int type, xmlElementContentPtr content);
|
||||
xmlElementTablePtr xmlCopyElementTable(xmlElementTablePtr table);
|
||||
void xmlFreeElementTable(xmlElementTablePtr table);
|
||||
void xmlDumpElementTable(xmlBufferPtr buf, xmlElementTablePtr table);
|
||||
xmlElementPtr xmlAddElementDecl (xmlValidCtxtPtr ctxt,
|
||||
xmlDtdPtr dtd,
|
||||
const CHAR *name,
|
||||
int type,
|
||||
xmlElementContentPtr content);
|
||||
xmlElementTablePtr xmlCopyElementTable (xmlElementTablePtr table);
|
||||
void xmlFreeElementTable (xmlElementTablePtr table);
|
||||
void xmlDumpElementTable (xmlBufferPtr buf,
|
||||
xmlElementTablePtr table);
|
||||
|
||||
/* Enumeration */
|
||||
xmlEnumerationPtr xmlCreateEnumeration(CHAR *name);
|
||||
void xmlFreeEnumeration(xmlEnumerationPtr cur);
|
||||
xmlEnumerationPtr xmlCopyEnumeration(xmlEnumerationPtr cur);
|
||||
xmlEnumerationPtr xmlCreateEnumeration (CHAR *name);
|
||||
void xmlFreeEnumeration (xmlEnumerationPtr cur);
|
||||
xmlEnumerationPtr xmlCopyEnumeration (xmlEnumerationPtr cur);
|
||||
|
||||
/* Attribute */
|
||||
xmlAttributePtr xmlAddAttributeDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd,
|
||||
const CHAR *elem, const CHAR *name, int type, int def,
|
||||
const CHAR *defaultValue, xmlEnumerationPtr tree);
|
||||
xmlAttributeTablePtr xmlCopyAttributeTable(xmlAttributeTablePtr table);
|
||||
void xmlFreeAttributeTable(xmlAttributeTablePtr table);
|
||||
void xmlDumpAttributeTable(xmlBufferPtr buf, xmlAttributeTablePtr table);
|
||||
xmlAttributePtr xmlAddAttributeDecl (xmlValidCtxtPtr ctxt,
|
||||
xmlDtdPtr dtd,
|
||||
const CHAR *elem,
|
||||
const CHAR *name,
|
||||
int type,
|
||||
int def,
|
||||
const CHAR *defaultValue,
|
||||
xmlEnumerationPtr tree);
|
||||
xmlAttributeTablePtr xmlCopyAttributeTable (xmlAttributeTablePtr table);
|
||||
void xmlFreeAttributeTable (xmlAttributeTablePtr table);
|
||||
void xmlDumpAttributeTable (xmlBufferPtr buf,
|
||||
xmlAttributeTablePtr table);
|
||||
|
||||
/* IDs */
|
||||
xmlIDPtr xmlAddID(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
const CHAR *value, xmlAttrPtr attr);
|
||||
xmlIDTablePtr xmlCopyIDTable(xmlIDTablePtr table);
|
||||
void xmlFreeIDTable(xmlIDTablePtr table);
|
||||
xmlIDPtr xmlAddID (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
const CHAR *value,
|
||||
xmlAttrPtr attr);
|
||||
xmlIDTablePtr xmlCopyIDTable (xmlIDTablePtr table);
|
||||
void xmlFreeIDTable (xmlIDTablePtr table);
|
||||
xmlAttrPtr xmlGetID (xmlDocPtr doc,
|
||||
const CHAR *ID);
|
||||
int xmlIsID (xmlDocPtr doc,
|
||||
xmlNodePtr elem,
|
||||
xmlAttrPtr attr);
|
||||
|
||||
/**
|
||||
* The public function calls related to validity checking
|
||||
*/
|
||||
|
||||
int xmlValidateRoot(xmlValidCtxtPtr ctxt, xmlDocPtr doc);
|
||||
int xmlValidateElementDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
xmlElementPtr elem);
|
||||
int xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
xmlAttributePtr attr);
|
||||
int xmlValidateNotationDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
xmlNotationPtr nota);
|
||||
int xmlValidateDtd(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlDtdPtr dtd);
|
||||
|
||||
int xmlValidateDocument(xmlValidCtxtPtr ctxt, xmlDocPtr doc);
|
||||
int xmlValidateElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem);
|
||||
int xmlValidateOneElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
xmlNodePtr elem);
|
||||
int xmlValidateOneAttribute(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
xmlNodePtr elem, xmlAttrPtr attr, const CHAR *value);
|
||||
|
||||
int xmlIsMixedElement(xmlDocPtr doc, const CHAR *name);
|
||||
int xmlValidateRoot (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc);
|
||||
int xmlValidateElementDecl (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlElementPtr elem);
|
||||
int xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlAttributePtr attr);
|
||||
int xmlValidateAttributeValue(xmlAttributeType type,
|
||||
const CHAR *value);
|
||||
int xmlValidateNotationDecl (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlNotationPtr nota);
|
||||
int xmlValidateDtd (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlDtdPtr dtd);
|
||||
int xmlValidateDocument (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc);
|
||||
int xmlValidateElement (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlNodePtr elem);
|
||||
int xmlValidateOneElement (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlNodePtr elem);
|
||||
int xmlValidateOneAttribute (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlNodePtr elem,
|
||||
xmlAttrPtr attr,
|
||||
const CHAR *value);
|
||||
int xmlValidateNotationUse (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
const CHAR *notationName);
|
||||
int xmlIsMixedElement (xmlDocPtr doc,
|
||||
const CHAR *name);
|
||||
xmlAttributePtr xmlGetDtdAttrDesc (xmlDtdPtr dtd,
|
||||
const CHAR *elem,
|
||||
const CHAR *name);
|
||||
xmlNotationPtr xmlGetDtdNotationDesc (xmlDtdPtr dtd,
|
||||
const CHAR *name);
|
||||
xmlElementPtr xmlGetDtdElementDesc (xmlDtdPtr dtd,
|
||||
const CHAR *name);
|
||||
#endif /* __XML_VALID_H__ */
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include "tree.h"
|
||||
#include "parser.h"
|
||||
#include "encoding.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -35,17 +36,21 @@ typedef xmlParserInputBuffer *xmlParserInputBufferPtr;
|
||||
* Interfaces
|
||||
*/
|
||||
|
||||
xmlParserInputBufferPtr xmlParserInputBufferCreateFilename(const char *filename,
|
||||
xmlCharEncoding enc);
|
||||
xmlParserInputBufferPtr xmlParserInputBufferCreateFile(FILE *file,
|
||||
xmlCharEncoding enc);
|
||||
xmlParserInputBufferPtr xmlParserInputBufferCreateFd(int fd, xmlCharEncoding enc);
|
||||
|
||||
int xmlParserInputBufferRead(xmlParserInputBufferPtr in, int len);
|
||||
int xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len);
|
||||
|
||||
void xmlFreeParserInputBuffer(xmlParserInputBufferPtr in);
|
||||
char *xmlParserGetDirectory(const char *filename);
|
||||
xmlParserInputBufferPtr
|
||||
xmlParserInputBufferCreateFilename (const char *filename,
|
||||
xmlCharEncoding enc);
|
||||
xmlParserInputBufferPtr
|
||||
xmlParserInputBufferCreateFile (FILE *file,
|
||||
xmlCharEncoding enc);
|
||||
xmlParserInputBufferPtr
|
||||
xmlParserInputBufferCreateFd (int fd,
|
||||
xmlCharEncoding enc);
|
||||
int xmlParserInputBufferRead (xmlParserInputBufferPtr in,
|
||||
int len);
|
||||
int xmlParserInputBufferGrow (xmlParserInputBufferPtr in,
|
||||
int len);
|
||||
void xmlFreeParserInputBuffer (xmlParserInputBufferPtr in);
|
||||
char * xmlParserGetDirectory (const char *filename);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -62,7 +62,8 @@ typedef struct xmlXPathContext {
|
||||
xmlNodeSetPtr nodelist; /* The current node list */
|
||||
void *variables; /* TODO !!!! */
|
||||
void *functions; /* TODO !!!! */
|
||||
void *namespaces; /* TODO !!!! */
|
||||
xmlNsPtr *namespaces; /* The namespaces lookup */
|
||||
int nsNr; /* the current Namespace index */
|
||||
} xmlXPathContext, *xmlXPathContextPtr;
|
||||
|
||||
/*
|
||||
@ -96,12 +97,14 @@ typedef void (*xmlXPathFunction) (xmlXPathParserContextPtr ctxt, int nargs);
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
xmlXPathContextPtr xmlXPathNewContext(xmlDocPtr doc, void *variables,
|
||||
void *functions, void *namespaces);
|
||||
void xmlXPathFreeContext(xmlXPathContextPtr ctxt);
|
||||
xmlXPathObjectPtr xmlXPathEval(const CHAR *str, xmlXPathContextPtr ctxt);
|
||||
void xmlXPathFreeObject(xmlXPathObjectPtr obj);
|
||||
xmlXPathObjectPtr xmlXPathEvalExpression(const CHAR *str,
|
||||
xmlXPathContextPtr ctxt);
|
||||
xmlXPathContextPtr xmlXPathNewContext (xmlDocPtr doc,
|
||||
void *variables,
|
||||
void *functions);
|
||||
void xmlXPathFreeContext (xmlXPathContextPtr ctxt);
|
||||
xmlXPathObjectPtr xmlXPathEval (const CHAR *str,
|
||||
xmlXPathContextPtr ctxt);
|
||||
void xmlXPathFreeObject (xmlXPathObjectPtr obj);
|
||||
xmlXPathObjectPtr xmlXPathEvalExpression (const CHAR *str,
|
||||
xmlXPathContextPtr ctxt);
|
||||
|
||||
#endif /* ! __XML_XPATH_H__ */
|
||||
|
244
parser.c
244
parser.c
@ -37,7 +37,6 @@
|
||||
|
||||
const char *xmlParserVersion = LIBXML_VERSION;
|
||||
|
||||
#define XML_MAX_NAMELEN 1000
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
@ -382,7 +381,7 @@ xmlFreeInputStream(xmlParserInputPtr input) {
|
||||
if (input->filename != NULL) free((char *) input->filename);
|
||||
if (input->directory != NULL) free((char *) input->directory);
|
||||
if ((input->free != NULL) && (input->base != NULL))
|
||||
input->free((char *) input->base);
|
||||
input->free((CHAR *) input->base);
|
||||
if (input->buf != NULL)
|
||||
xmlFreeParserInputBuffer(input->buf);
|
||||
memset(input, -1, sizeof(xmlParserInput));
|
||||
@ -425,7 +424,8 @@ xmlNewInputStream(xmlParserCtxtPtr ctxt) {
|
||||
* @entity: an Entity pointer
|
||||
*
|
||||
* Create a new input stream based on an xmlEntityPtr
|
||||
* Returns the new input stream
|
||||
*
|
||||
* Returns the new input stream or NULL
|
||||
*/
|
||||
xmlParserInputPtr
|
||||
xmlNewEntityInputStream(xmlParserCtxtPtr ctxt, xmlEntityPtr entity) {
|
||||
@ -438,16 +438,39 @@ xmlNewEntityInputStream(xmlParserCtxtPtr ctxt, xmlEntityPtr entity) {
|
||||
return(NULL);
|
||||
}
|
||||
if (entity->content == NULL) {
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||
ctxt->sax->error(ctxt->userData,
|
||||
"internal: xmlNewEntityInputStream entity->input = NULL\n");
|
||||
switch (entity->type) {
|
||||
case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||
ctxt->sax->error(ctxt->userData,
|
||||
"xmlNewEntityInputStream unparsed entity !\n");
|
||||
break;
|
||||
case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
|
||||
case XML_EXTERNAL_PARAMETER_ENTITY:
|
||||
return(xmlLoadExternalEntity((char *) entity->SystemID,
|
||||
(char *) entity->ExternalID, ctxt->input));
|
||||
case XML_INTERNAL_GENERAL_ENTITY:
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||
ctxt->sax->error(ctxt->userData,
|
||||
"Internal entity %s without content !\n", entity->name);
|
||||
break;
|
||||
case XML_INTERNAL_PARAMETER_ENTITY:
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||
ctxt->sax->error(ctxt->userData,
|
||||
"Internal parameter entity %s without content !\n", entity->name);
|
||||
break;
|
||||
case XML_INTERNAL_PREDEFINED_ENTITY:
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||
ctxt->sax->error(ctxt->userData,
|
||||
"Predefined entity %s without content !\n", entity->name);
|
||||
break;
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
input = xmlNewInputStream(ctxt);
|
||||
if (input == NULL) {
|
||||
return(NULL);
|
||||
}
|
||||
input->filename = entity->SystemID; /* TODO !!! char <- CHAR */
|
||||
input->filename = (char *) entity->SystemID; /* TODO !!! char <- CHAR */
|
||||
input->base = entity->content;
|
||||
input->cur = entity->content;
|
||||
return(input);
|
||||
@ -842,7 +865,7 @@ xmlParserHandleReference(xmlParserCtxtPtr ctxt) {
|
||||
return;
|
||||
case XML_PARSER_CONTENT:
|
||||
case XML_PARSER_ATTRIBUTE_VALUE:
|
||||
/* TODO this may not be Ok for UTF-8, multibyte sequence */
|
||||
/* !!! this may not be Ok for UTF-8, multibyte sequence */
|
||||
ctxt->token = xmlParseCharRef(ctxt);
|
||||
return;
|
||||
}
|
||||
@ -887,8 +910,7 @@ xmlParserHandleReference(xmlParserCtxtPtr ctxt) {
|
||||
* without entity substitution.
|
||||
* This will then be handled by xmlDecodeEntities
|
||||
*/
|
||||
if (ctxt->replaceEntities == 0) return;
|
||||
break;
|
||||
return;
|
||||
case XML_PARSER_ENTITY_DECL:
|
||||
/*
|
||||
* we just ignore it there
|
||||
@ -902,8 +924,7 @@ xmlParserHandleReference(xmlParserCtxtPtr ctxt) {
|
||||
ctxt->wellFormed = 0;
|
||||
return;
|
||||
case XML_PARSER_CONTENT:
|
||||
if (ctxt->replaceEntities == 0) return;
|
||||
break;
|
||||
return;
|
||||
}
|
||||
|
||||
NEXT;
|
||||
@ -1239,7 +1260,7 @@ xmlDecodeEntities(xmlParserCtxtPtr ctxt, int len, int what,
|
||||
|
||||
break;
|
||||
} else {
|
||||
/* TODO: invalid for UTF-8 , use COPY(out); */
|
||||
/* invalid for UTF-8 , use COPY(out); !!!!!! */
|
||||
*out++ = cur;
|
||||
nbchars++;
|
||||
if (out - buffer > buffer_size - 100) {
|
||||
@ -1876,6 +1897,12 @@ xmlSplitQName(const CHAR *name, CHAR **prefix) {
|
||||
const CHAR *cur = name;
|
||||
|
||||
*prefix = NULL;
|
||||
|
||||
/* xml: prefix is not really a namespace */
|
||||
if ((cur[0] == 'x') && (cur[1] == 'm') &&
|
||||
(cur[2] == 'l') && (cur[3] == ':'))
|
||||
return(xmlStrdup(name));
|
||||
|
||||
if (!IS_LETTER(*cur) && (*cur != '_')) return(NULL);
|
||||
q = cur++;
|
||||
|
||||
@ -2293,12 +2320,12 @@ xmlParseEntityValue(xmlParserCtxtPtr ctxt, CHAR **orig) {
|
||||
xmlPopInput(ctxt);
|
||||
|
||||
if ((temp == NULL) && (tst == CUR_PTR)) {
|
||||
ret = xmlStrndup("", 0);
|
||||
ret = xmlStrndup((CHAR *) "", 0);
|
||||
break;
|
||||
}
|
||||
if ((temp[0] == 0) && (tst == CUR_PTR)) {
|
||||
free((char *)temp);
|
||||
ret = xmlStrndup("", 0);
|
||||
ret = xmlStrndup((CHAR *) "", 0);
|
||||
break;
|
||||
}
|
||||
ret = xmlStrcat(ret, temp);
|
||||
@ -2313,7 +2340,7 @@ xmlParseEntityValue(xmlParserCtxtPtr ctxt, CHAR **orig) {
|
||||
if (orig != NULL) /* !!!!!!!!! */
|
||||
*orig = xmlStrndup(org, CUR_PTR - org);
|
||||
if (ret == NULL)
|
||||
ret = xmlStrndup("", 0);
|
||||
ret = xmlStrndup((CHAR *) "", 0);
|
||||
NEXT;
|
||||
}
|
||||
} else if (CUR == '\'') {
|
||||
@ -2352,12 +2379,12 @@ xmlParseEntityValue(xmlParserCtxtPtr ctxt, CHAR **orig) {
|
||||
xmlPopInput(ctxt);
|
||||
|
||||
if ((temp == NULL) && (tst == CUR_PTR)) {
|
||||
ret = xmlStrndup("", 0);
|
||||
ret = xmlStrndup((CHAR *) "", 0);
|
||||
break;
|
||||
}
|
||||
if ((temp[0] == 0) && (tst == CUR_PTR)) {
|
||||
free((char *)temp);
|
||||
ret = xmlStrndup("", 0);
|
||||
ret = xmlStrndup((CHAR *) "", 0);
|
||||
break;
|
||||
}
|
||||
ret = xmlStrcat(ret, temp);
|
||||
@ -2372,7 +2399,7 @@ xmlParseEntityValue(xmlParserCtxtPtr ctxt, CHAR **orig) {
|
||||
if (orig != NULL) /* !!!!!!!!! */
|
||||
*orig = xmlStrndup(org, CUR_PTR - org);
|
||||
if (ret == NULL)
|
||||
ret = xmlStrndup("", 0);
|
||||
ret = xmlStrndup((CHAR *) "", 0);
|
||||
NEXT;
|
||||
}
|
||||
} else {
|
||||
@ -2390,8 +2417,7 @@ xmlParseEntityValue(xmlParserCtxtPtr ctxt, CHAR **orig) {
|
||||
*
|
||||
* parse a value for an attribute
|
||||
* Note: the parser won't do substitution of entities here, this
|
||||
* will be handled later in xmlStringGetNodeList, unless it was
|
||||
* asked for ctxt->replaceEntities != 0
|
||||
* will be handled later in xmlStringGetNodeList
|
||||
*
|
||||
* [10] AttValue ::= '"' ([^<&"] | Reference)* '"' |
|
||||
* "'" ([^<&'] | Reference)* "'"
|
||||
@ -2722,17 +2748,15 @@ xmlParseExternalID(xmlParserCtxtPtr ctxt, CHAR **publicID, int strict) {
|
||||
/**
|
||||
* xmlParseComment:
|
||||
* @ctxt: an XML parser context
|
||||
* @create: should we create a node, or just skip the content
|
||||
*
|
||||
* Skip an XML (SGML) comment <!-- .... -->
|
||||
* This may or may not create a node (depending on the context)
|
||||
* The spec says that "For compatibility, the string "--" (double-hyphen)
|
||||
* must not occur within comments. "
|
||||
*
|
||||
* [15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
|
||||
*/
|
||||
void
|
||||
xmlParseComment(xmlParserCtxtPtr ctxt, int create) {
|
||||
xmlParseComment(xmlParserCtxtPtr ctxt) {
|
||||
const CHAR *q, *start;
|
||||
const CHAR *r;
|
||||
CHAR *val;
|
||||
@ -2767,12 +2791,10 @@ xmlParseComment(xmlParserCtxtPtr ctxt, int create) {
|
||||
ctxt->wellFormed = 0;
|
||||
} else {
|
||||
NEXT;
|
||||
if (create) {
|
||||
val = xmlStrndup(start, q - start);
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL))
|
||||
ctxt->sax->comment(ctxt->userData, val);
|
||||
free(val);
|
||||
}
|
||||
val = xmlStrndup(start, q - start);
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL))
|
||||
ctxt->sax->comment(ctxt->userData, val);
|
||||
free(val);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2831,8 +2853,16 @@ xmlParsePI(xmlParserCtxtPtr ctxt) {
|
||||
*/
|
||||
target = xmlParsePITarget(ctxt);
|
||||
if (target != NULL) {
|
||||
const CHAR *q = CUR_PTR;
|
||||
const CHAR *q;
|
||||
|
||||
if (!IS_BLANK(CUR)) {
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||
ctxt->sax->error(ctxt->userData,
|
||||
"xmlParsePI: PI %s space expected\n", target);
|
||||
ctxt->wellFormed = 0;
|
||||
}
|
||||
SKIP_BLANKS;
|
||||
q = CUR_PTR;
|
||||
while (IS_CHAR(CUR) &&
|
||||
((CUR != '?') || (NXT(1) != '>')))
|
||||
NEXT;
|
||||
@ -2960,7 +2990,7 @@ xmlParseNotationDecl(xmlParserCtxtPtr ctxt) {
|
||||
* [76] NDataDecl ::= S 'NDATA' S Name
|
||||
*
|
||||
* [ VC: Notation Declared ]
|
||||
* TODO The Name must match the declared name of a notation.
|
||||
* The Name must match the declared name of a notation.
|
||||
*/
|
||||
|
||||
void
|
||||
@ -3062,9 +3092,9 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) {
|
||||
}
|
||||
SKIP_BLANKS;
|
||||
ndata = xmlParseName(ctxt);
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->entityDecl != NULL))
|
||||
ctxt->sax->entityDecl(ctxt->userData, name,
|
||||
XML_EXTERNAL_GENERAL_UNPARSED_ENTITY,
|
||||
if ((ctxt->sax != NULL) &&
|
||||
(ctxt->sax->unparsedEntityDecl != NULL))
|
||||
ctxt->sax->unparsedEntityDecl(ctxt->userData, name,
|
||||
literal, URI, ndata);
|
||||
} else {
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->entityDecl != NULL))
|
||||
@ -3123,17 +3153,17 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) {
|
||||
* [60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue)
|
||||
*
|
||||
* [ VC: Required Attribute ]
|
||||
* TODO if the default declaration is the keyword #REQUIRED, then the
|
||||
* attribute must be specified for all elements of the type in the
|
||||
* attribute-list declaration.
|
||||
* if the default declaration is the keyword #REQUIRED, then the
|
||||
* attribute must be specified for all elements of the type in the
|
||||
* attribute-list declaration.
|
||||
*
|
||||
* [ VC: Attribute Default Legal ]
|
||||
* The declared default value must meet the lexical constraints of
|
||||
* the declared attribute type c.f. xmlValidateAttributeDecl()
|
||||
*
|
||||
* [ VC: Fixed Attribute Default ]
|
||||
* TODO if an attribute has a default value declared with the #FIXED
|
||||
* keyword, instances of that attribute must match the default value.
|
||||
* if an attribute has a default value declared with the #FIXED
|
||||
* keyword, instances of that attribute must match the default value.
|
||||
*
|
||||
* [ WFC: No < in Attribute Values ]
|
||||
* handled in xmlParseAttValue()
|
||||
@ -3199,7 +3229,7 @@ xmlParseDefaultDecl(xmlParserCtxtPtr ctxt, CHAR **value) {
|
||||
* [58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')'
|
||||
*
|
||||
* [ VC: Notation Attributes ]
|
||||
* TODO Values of this type must match one of the notation names included
|
||||
* Values of this type must match one of the notation names included
|
||||
* in the declaration; all notation names in the declaration must be declared.
|
||||
*
|
||||
* Returns: the notation attribute tree built while parsing
|
||||
@ -3258,7 +3288,7 @@ xmlParseNotationType(xmlParserCtxtPtr ctxt) {
|
||||
* [59] Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')'
|
||||
*
|
||||
* [ VC: Enumeration ]
|
||||
* TODO Values of this type must match one of the Nmtoken tokens in
|
||||
* Values of this type must match one of the Nmtoken tokens in
|
||||
* the declaration
|
||||
*
|
||||
* Returns: the enumeration attribute tree built while parsing
|
||||
@ -3365,26 +3395,26 @@ xmlParseEnumeratedType(xmlParserCtxtPtr ctxt, xmlEnumerationPtr *tree) {
|
||||
* xmlValidateAttributeValue()
|
||||
*
|
||||
* [ VC: ID ]
|
||||
* Values of type ID must match the Name production. TODO A name must not
|
||||
* Values of type ID must match the Name production. A name must not
|
||||
* appear more than once in an XML document as a value of this type;
|
||||
* i.e., ID values must uniquely identify the elements which bear them.
|
||||
*
|
||||
* [ VC: One ID per Element Type ]
|
||||
* TODO No element type may have more than one ID attribute specified.
|
||||
* No element type may have more than one ID attribute specified.
|
||||
*
|
||||
* [ VC: ID Attribute Default ]
|
||||
* TODO An ID attribute must have a declared default of #IMPLIED or #REQUIRED.
|
||||
* An ID attribute must have a declared default of #IMPLIED or #REQUIRED.
|
||||
*
|
||||
* [ VC: IDREF ]
|
||||
* Values of type IDREF must match the Name production, and values
|
||||
* of type IDREFS must match Names; TODO each Name must match the value of
|
||||
* an ID attribute on some element in the XML document; i.e. IDREF
|
||||
* of type IDREFS must match Names; TODO each IDREF Name must match the value
|
||||
* of an ID attribute on some element in the XML document; i.e. IDREF
|
||||
* values must match the value of some ID attribute.
|
||||
*
|
||||
* [ VC: Entity Name ]
|
||||
* Values of type ENTITY must match the Name production, values
|
||||
* of type ENTITIES must match Names; TODO each Name must match the name of
|
||||
* an unparsed entity declared in the DTD.
|
||||
* of type ENTITIES must match Names; TODO each Entity Name must match the
|
||||
* name of an unparsed entity declared in the DTD.
|
||||
*
|
||||
* [ VC: Name Token ]
|
||||
* Values of type NMTOKEN must match the Nmtoken production; values
|
||||
@ -3563,8 +3593,8 @@ xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt) {
|
||||
* [ VC: Proper Group/PE Nesting ] applies to [51] too (see [49])
|
||||
*
|
||||
* [ VC: No Duplicate Types ]
|
||||
* TODO The same name must not appear more than once in a single
|
||||
* mixed-content declaration.
|
||||
* The same name must not appear more than once in a single
|
||||
* mixed-content declaration.
|
||||
*
|
||||
* returns: the list of the xmlElementContentPtr describing the element choices
|
||||
*/
|
||||
@ -3911,7 +3941,7 @@ xmlParseElementContentDecl(xmlParserCtxtPtr ctxt, CHAR *name,
|
||||
* [45] elementdecl ::= '<!ELEMENT' S Name S contentspec S? '>'
|
||||
*
|
||||
* [ VC: Unique Element Type Declaration ]
|
||||
* TODO No element type may be declared more than once
|
||||
* No element type may be declared more than once
|
||||
*
|
||||
* Returns the type of the element, or -1 in case of error
|
||||
*/
|
||||
@ -4037,7 +4067,7 @@ xmlParseMarkupDecl(xmlParserCtxtPtr ctxt) {
|
||||
xmlParseEntityDecl(ctxt);
|
||||
xmlParseNotationDecl(ctxt);
|
||||
xmlParsePI(ctxt);
|
||||
xmlParseComment(ctxt, 0);
|
||||
xmlParseComment(ctxt);
|
||||
/*
|
||||
* This is only for internal subset. On external entities,
|
||||
* the replacement is done before parsing stage
|
||||
@ -4079,15 +4109,10 @@ xmlParseTextDecl(xmlParserCtxtPtr ctxt) {
|
||||
* We may have the VersionInfo here.
|
||||
*/
|
||||
version = xmlParseVersionInfo(ctxt);
|
||||
|
||||
/* TODO: we should actually inherit from the referencing doc if absent
|
||||
if (version == NULL)
|
||||
version = xmlCharStrdup(XML_DEFAULT_VERSION);
|
||||
ctxt->version = xmlStrdup(version);
|
||||
*/
|
||||
|
||||
if (version != NULL)
|
||||
free(version);
|
||||
free(version);
|
||||
|
||||
/*
|
||||
* We must have the encoding declaration
|
||||
@ -4158,8 +4183,6 @@ xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
|
||||
* [30] extSubset ::= textDecl? extSubsetDecl
|
||||
*
|
||||
* [31] extSubsetDecl ::= (markupdecl | conditionalSect | PEReference | S) *
|
||||
*
|
||||
* TODO There is a check [ VC: Proper Declaration/PE Nesting ]
|
||||
*/
|
||||
void
|
||||
xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const CHAR *ExternalID,
|
||||
@ -4170,7 +4193,7 @@ xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const CHAR *ExternalID,
|
||||
xmlParseTextDecl(ctxt);
|
||||
}
|
||||
if (ctxt->myDoc == NULL) {
|
||||
ctxt->myDoc = xmlNewDoc("1.0");
|
||||
ctxt->myDoc = xmlNewDoc(BAD_CAST "1.0");
|
||||
}
|
||||
if ((ctxt->myDoc != NULL) && (ctxt->myDoc->intSubset == NULL))
|
||||
xmlCreateIntSubset(ctxt->myDoc, NULL, ExternalID, SystemID);
|
||||
@ -4180,6 +4203,9 @@ xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const CHAR *ExternalID,
|
||||
while (((CUR == '<') && (NXT(1) == '?')) ||
|
||||
((CUR == '<') && (NXT(1) == '!')) ||
|
||||
IS_BLANK(CUR)) {
|
||||
const CHAR *check = CUR_PTR;
|
||||
int cons = ctxt->input->consumed;
|
||||
|
||||
if ((CUR == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
|
||||
xmlParseConditionalSections(ctxt);
|
||||
} else if (IS_BLANK(CUR)) {
|
||||
@ -4195,6 +4221,13 @@ xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const CHAR *ExternalID,
|
||||
while ((CUR == 0) && (ctxt->inputNr > 1))
|
||||
xmlPopInput(ctxt);
|
||||
|
||||
if ((CUR_PTR == check) && (cons == ctxt->input->consumed)) {
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||
ctxt->sax->error(ctxt->userData,
|
||||
"Content error in the external subset\n");
|
||||
ctxt->wellFormed = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (CUR != 0) {
|
||||
@ -4223,10 +4256,22 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
|
||||
CHAR *val;
|
||||
if (CUR != '&') return;
|
||||
|
||||
if (ctxt->inputNr > 1) {
|
||||
CHAR cur[2] = { '&' , 0 } ;
|
||||
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL))
|
||||
ctxt->sax->characters(ctxt->userData, cur, 1);
|
||||
if (ctxt->token == '&')
|
||||
ctxt->token = 0;
|
||||
else {
|
||||
SKIP(1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (NXT(1) == '#') {
|
||||
CHAR out[2];
|
||||
int val = xmlParseCharRef(ctxt);
|
||||
/* TODO: invalid for UTF-8 variable encoding !!! */
|
||||
/* invalid for UTF-8 variable encoding !!!!! */
|
||||
out[0] = val;
|
||||
out[1] = 0;
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL))
|
||||
@ -4235,15 +4280,21 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
|
||||
ent = xmlParseEntityRef(ctxt);
|
||||
if (ent == NULL) return;
|
||||
if ((ent->name != NULL) &&
|
||||
(ent->type != XML_INTERNAL_PREDEFINED_ENTITY) &&
|
||||
(ctxt->sax != NULL) && (ctxt->sax->reference != NULL) &&
|
||||
(ctxt->replaceEntities == 0)) {
|
||||
(ent->type != XML_INTERNAL_PREDEFINED_ENTITY)) {
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->reference != NULL) &&
|
||||
(ctxt->replaceEntities == 0)) {
|
||||
/*
|
||||
* Create a node.
|
||||
*/
|
||||
ctxt->sax->reference(ctxt->userData, ent->name);
|
||||
return;
|
||||
} else if (ctxt->replaceEntities) {
|
||||
xmlParserInputPtr input;
|
||||
|
||||
/*
|
||||
* Create a node.
|
||||
*/
|
||||
ctxt->sax->reference(ctxt->userData, ent->name);
|
||||
return;
|
||||
input = xmlNewEntityInputStream(ctxt, ent);
|
||||
xmlPushInput(ctxt, input);
|
||||
return;
|
||||
}
|
||||
}
|
||||
val = ent->content;
|
||||
if (val == NULL) return;
|
||||
@ -4378,7 +4429,8 @@ xmlParseEntityRef(xmlParserCtxtPtr ctxt) {
|
||||
* not contain a <.
|
||||
*/
|
||||
else if ((ctxt->instate == XML_PARSER_ATTRIBUTE_VALUE) &&
|
||||
(ent != NULL) && (xmlStrcmp(ent->name, "lt")) &&
|
||||
(ent != NULL) &&
|
||||
(xmlStrcmp(ent->name, BAD_CAST "lt")) &&
|
||||
(ent->content != NULL) &&
|
||||
(xmlStrchr(ent->content, '<'))) {
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||
@ -4404,8 +4456,8 @@ xmlParseEntityRef(xmlParserCtxtPtr ctxt) {
|
||||
|
||||
/*
|
||||
* [ WFC: No Recursion ]
|
||||
* TODO A parsed entity must not contain a recursive
|
||||
* reference to itself, either directly or indirectly.
|
||||
* TODO A parsed entity must not contain a recursive reference
|
||||
* to itself, either directly or indirectly.
|
||||
*/
|
||||
|
||||
} else {
|
||||
@ -4594,25 +4646,25 @@ xmlParseDocTypeDecl(xmlParserCtxtPtr ctxt) {
|
||||
*/
|
||||
while (CUR != ']') {
|
||||
const CHAR *check = CUR_PTR;
|
||||
int cons = ctxt->input->consumed;
|
||||
|
||||
SKIP_BLANKS;
|
||||
xmlParseMarkupDecl(ctxt);
|
||||
xmlParsePEReference(ctxt);
|
||||
|
||||
if (CUR_PTR == check) {
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||
ctxt->sax->error(ctxt->userData,
|
||||
"xmlParseDocTypeDecl: error detected in Markup declaration\n");
|
||||
ctxt->wellFormed = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Pop-up of finished entities.
|
||||
*/
|
||||
while ((CUR == 0) && (ctxt->inputNr > 1))
|
||||
xmlPopInput(ctxt);
|
||||
|
||||
if ((CUR_PTR == check) && (cons = ctxt->input->consumed)) {
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||
ctxt->sax->error(ctxt->userData,
|
||||
"xmlParseDocTypeDecl: error detected in Markup declaration\n");
|
||||
ctxt->wellFormed = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (CUR == ']') NEXT;
|
||||
}
|
||||
@ -4654,7 +4706,7 @@ xmlParseDocTypeDecl(xmlParserCtxtPtr ctxt) {
|
||||
* an attribute value (other than "<") must not contain a <.
|
||||
*
|
||||
* [ VC: Attribute Value Type ]
|
||||
* TODO The attribute must have been declared; the value must be of the type
|
||||
* The attribute must have been declared; the value must be of the type
|
||||
* declared for it.
|
||||
*
|
||||
* [25] Eq ::= S? '=' S?
|
||||
@ -4810,9 +4862,9 @@ xmlParseStartTag(xmlParserCtxtPtr ctxt) {
|
||||
atts[nbatts++] = attvalue;
|
||||
atts[nbatts] = NULL;
|
||||
atts[nbatts + 1] = NULL;
|
||||
failed:
|
||||
}
|
||||
|
||||
failed:
|
||||
SKIP_BLANKS;
|
||||
if ((cons == ctxt->input->consumed) && (q == CUR_PTR)) {
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||
@ -4993,6 +5045,7 @@ xmlParseContent(xmlParserCtxtPtr ctxt) {
|
||||
while ((CUR != '<') || (NXT(1) != '/')) {
|
||||
const CHAR *test = CUR_PTR;
|
||||
int cons = ctxt->input->consumed;
|
||||
CHAR tok = ctxt->token;
|
||||
|
||||
/*
|
||||
* First case : a Processing Instruction.
|
||||
@ -5017,7 +5070,7 @@ xmlParseContent(xmlParserCtxtPtr ctxt) {
|
||||
*/
|
||||
else if ((CUR == '<') && (NXT(1) == '!') &&
|
||||
(NXT(2) == '-') && (NXT(3) == '-')) {
|
||||
xmlParseComment(ctxt, 1);
|
||||
xmlParseComment(ctxt);
|
||||
ctxt->instate = XML_PARSER_CONTENT;
|
||||
}
|
||||
|
||||
@ -5051,7 +5104,8 @@ xmlParseContent(xmlParserCtxtPtr ctxt) {
|
||||
while ((CUR == 0) && (ctxt->inputNr > 1))
|
||||
xmlPopInput(ctxt);
|
||||
|
||||
if ((cons == ctxt->input->consumed) && (test == CUR_PTR)) {
|
||||
if ((cons == ctxt->input->consumed) && (test == CUR_PTR) &&
|
||||
(tok == ctxt->token)) {
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||
ctxt->sax->error(ctxt->userData,
|
||||
"detected an error in element content\n");
|
||||
@ -5074,7 +5128,7 @@ xmlParseContent(xmlParserCtxtPtr ctxt) {
|
||||
* start-tag.
|
||||
*
|
||||
* [ VC: Element Valid ]
|
||||
* TODO An element is valid if there is a declaration matching elementdecl
|
||||
* An element is valid if there is a declaration matching elementdecl
|
||||
* where the Name matches the element type and one of the following holds:
|
||||
* - The declaration matches EMPTY and the element has no content.
|
||||
* - The declaration matches children and the sequence of child elements
|
||||
@ -5542,7 +5596,7 @@ xmlParseMisc(xmlParserCtxtPtr ctxt) {
|
||||
} else if (IS_BLANK(CUR)) {
|
||||
NEXT;
|
||||
} else
|
||||
xmlParseComment(ctxt, 0);
|
||||
xmlParseComment(ctxt);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5574,8 +5628,8 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) {
|
||||
ctxt->sax->setDocumentLocator(ctxt->userData, &xmlDefaultSAXLocator);
|
||||
|
||||
/*
|
||||
* We should check for encoding here and plug-in some
|
||||
* conversion code TODO !!!!
|
||||
* TODO We should check for encoding here and plug-in some
|
||||
* conversion code !!!!
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -5829,7 +5883,7 @@ xmlSAXParseDTD(xmlSAXHandlerPtr sax, const CHAR *ExternalID,
|
||||
xmlSwitchEncoding(ctxt, enc);
|
||||
|
||||
if (input->filename == NULL)
|
||||
input->filename = xmlStrdup(SystemID);
|
||||
input->filename = (char *) xmlStrdup(SystemID); /* !!!!!!! */
|
||||
input->line = 1;
|
||||
input->col = 1;
|
||||
input->base = ctxt->input->cur;
|
||||
@ -5967,7 +6021,7 @@ xmlSAXParseFile(xmlSAXHandlerPtr sax, const char *filename,
|
||||
if ((ctxt->directory == NULL) && (directory == NULL))
|
||||
directory = xmlParserGetDirectory(filename);
|
||||
if ((ctxt->directory == NULL) && (directory != NULL))
|
||||
ctxt->directory = xmlStrdup(directory);
|
||||
ctxt->directory = (char *) xmlStrdup((CHAR *) directory); /* !!!!!!! */
|
||||
|
||||
xmlParseDocument(ctxt);
|
||||
|
||||
@ -6052,11 +6106,11 @@ xmlCreateMemoryParserCtxt(char *buffer, int size) {
|
||||
/*
|
||||
* plug some encoding conversion routines here. !!!
|
||||
*/
|
||||
enc = xmlDetectCharEncoding(buffer);
|
||||
enc = xmlDetectCharEncoding(BAD_CAST buffer);
|
||||
xmlSwitchEncoding(ctxt, enc);
|
||||
|
||||
input->base = buffer;
|
||||
input->cur = buffer;
|
||||
input->base = BAD_CAST buffer;
|
||||
input->cur = BAD_CAST buffer;
|
||||
input->free = NULL;
|
||||
|
||||
inputPush(ctxt, input);
|
||||
|
122
parser.h
122
parser.h
@ -47,6 +47,10 @@ typedef struct xmlParserInput {
|
||||
} xmlParserInput;
|
||||
typedef xmlParserInput *xmlParserInputPtr;
|
||||
|
||||
typedef xmlParserInputPtr (*xmlExternalEntityLoader)(const char *URL,
|
||||
const char *ID,
|
||||
xmlParserInputPtr context);
|
||||
|
||||
/**
|
||||
* the parser can be asked to collect Node informations, i.e. at what
|
||||
* place in the file they were detected.
|
||||
@ -84,7 +88,7 @@ typedef enum xmlParserInputState {
|
||||
XML_PARSER_DTD,
|
||||
XML_PARSER_EPILOG,
|
||||
XML_PARSER_COMMENT,
|
||||
XML_PARSER_CDATA_SECTION,
|
||||
XML_PARSER_CDATA_SECTION
|
||||
} xmlParserInputState;
|
||||
|
||||
/**
|
||||
@ -249,66 +253,104 @@ extern xmlSAXHandler htmlDefaultSAXHandler;
|
||||
* Input functions
|
||||
*/
|
||||
|
||||
int xmlParserInputRead(xmlParserInputPtr in, int len);
|
||||
int xmlParserInputGrow(xmlParserInputPtr in, int len);
|
||||
int xmlParserInputRead (xmlParserInputPtr in,
|
||||
int len);
|
||||
int xmlParserInputGrow (xmlParserInputPtr in,
|
||||
int len);
|
||||
|
||||
/**
|
||||
* CHAR handling
|
||||
*/
|
||||
CHAR *xmlStrdup(const CHAR *cur);
|
||||
CHAR *xmlStrndup(const CHAR *cur, int len);
|
||||
CHAR *xmlStrsub(const CHAR *str, int start, int len);
|
||||
const CHAR *xmlStrchr(const CHAR *str, CHAR val);
|
||||
const CHAR *xmlStrstr(const CHAR *str, CHAR *val);
|
||||
int xmlStrcmp(const CHAR *str1, const CHAR *str2);
|
||||
int xmlStrncmp(const CHAR *str1, const CHAR *str2, int len);
|
||||
int xmlStrlen(const CHAR *str);
|
||||
CHAR *xmlStrcat(CHAR *cur, const CHAR *add);
|
||||
CHAR *xmlStrncat(CHAR *cur, const CHAR *add, int len);
|
||||
CHAR * xmlStrdup (const CHAR *cur);
|
||||
CHAR * xmlStrndup (const CHAR *cur,
|
||||
int len);
|
||||
CHAR * xmlStrsub (const CHAR *str,
|
||||
int start,
|
||||
int len);
|
||||
const CHAR * xmlStrchr (const CHAR *str,
|
||||
CHAR val);
|
||||
const CHAR * xmlStrstr (const CHAR *str,
|
||||
CHAR *val);
|
||||
int xmlStrcmp (const CHAR *str1,
|
||||
const CHAR *str2);
|
||||
int xmlStrncmp (const CHAR *str1,
|
||||
const CHAR *str2,
|
||||
int len);
|
||||
int xmlStrlen (const CHAR *str);
|
||||
CHAR * xmlStrcat (CHAR *cur,
|
||||
const CHAR *add);
|
||||
CHAR * xmlStrncat (CHAR *cur,
|
||||
const CHAR *add,
|
||||
int len);
|
||||
|
||||
/**
|
||||
* Basic parsing Interfaces
|
||||
*/
|
||||
xmlDocPtr xmlParseDoc(CHAR *cur);
|
||||
xmlDocPtr xmlParseMemory(char *buffer, int size);
|
||||
xmlDocPtr xmlParseFile(const char *filename);
|
||||
int xmlSubstituteEntitiesDefault(int val);
|
||||
xmlDocPtr xmlParseDoc (CHAR *cur);
|
||||
xmlDocPtr xmlParseMemory (char *buffer,
|
||||
int size);
|
||||
xmlDocPtr xmlParseFile (const char *filename);
|
||||
int xmlSubstituteEntitiesDefault(int val);
|
||||
|
||||
/**
|
||||
* Recovery mode
|
||||
*/
|
||||
xmlDocPtr xmlRecoverDoc(CHAR *cur);
|
||||
xmlDocPtr xmlRecoverMemory(char *buffer, int size);
|
||||
xmlDocPtr xmlRecoverFile(const char *filename);
|
||||
xmlDocPtr xmlRecoverDoc (CHAR *cur);
|
||||
xmlDocPtr xmlRecoverMemory (char *buffer,
|
||||
int size);
|
||||
xmlDocPtr xmlRecoverFile (const char *filename);
|
||||
|
||||
/**
|
||||
* Less common routines and SAX interfaces
|
||||
*/
|
||||
int xmlParseDocument(xmlParserCtxtPtr ctxt);
|
||||
xmlDocPtr xmlSAXParseDoc(xmlSAXHandlerPtr sax, CHAR *cur, int recovery);
|
||||
xmlDocPtr xmlSAXParseMemory(xmlSAXHandlerPtr sax, char *buffer,
|
||||
int size, int recovery);
|
||||
xmlDocPtr xmlSAXParseFile(xmlSAXHandlerPtr sax, const char *filename,
|
||||
int recovery);
|
||||
xmlDtdPtr xmlParseDTD(const CHAR *ExternalID, const CHAR *SystemID);
|
||||
xmlDtdPtr xmlSAXParseDTD(xmlSAXHandlerPtr sax, const CHAR *ExternalID,
|
||||
const CHAR *SystemID);
|
||||
void xmlInitParserCtxt(xmlParserCtxtPtr ctxt);
|
||||
void xmlClearParserCtxt(xmlParserCtxtPtr ctxt);
|
||||
void xmlSetupParserForBuffer(xmlParserCtxtPtr ctxt, const CHAR* buffer,
|
||||
const char* filename);
|
||||
int xmlParseDocument (xmlParserCtxtPtr ctxt);
|
||||
xmlDocPtr xmlSAXParseDoc (xmlSAXHandlerPtr sax,
|
||||
CHAR *cur,
|
||||
int recovery);
|
||||
xmlDocPtr xmlSAXParseMemory (xmlSAXHandlerPtr sax,
|
||||
char *buffer,
|
||||
int size,
|
||||
int recovery);
|
||||
xmlDocPtr xmlSAXParseFile (xmlSAXHandlerPtr sax,
|
||||
const char *filename,
|
||||
int recovery);
|
||||
xmlDtdPtr xmlParseDTD (const CHAR *ExternalID,
|
||||
const CHAR *SystemID);
|
||||
xmlDtdPtr xmlSAXParseDTD (xmlSAXHandlerPtr sax,
|
||||
const CHAR *ExternalID,
|
||||
const CHAR *SystemID);
|
||||
void xmlInitParserCtxt (xmlParserCtxtPtr ctxt);
|
||||
void xmlClearParserCtxt (xmlParserCtxtPtr ctxt);
|
||||
void xmlSetupParserForBuffer (xmlParserCtxtPtr ctxt,
|
||||
const CHAR* buffer,
|
||||
const char* filename);
|
||||
void xmlDefaultSAXHandlerInit(void);
|
||||
void htmlDefaultSAXHandlerInit(void);
|
||||
|
||||
const xmlParserNodeInfo* xmlParserFindNodeInfo(const xmlParserCtxt* ctxt,
|
||||
/**
|
||||
* Node infos
|
||||
*/
|
||||
const xmlParserNodeInfo*
|
||||
xmlParserFindNodeInfo (const xmlParserCtxt* ctxt,
|
||||
const xmlNode* node);
|
||||
void xmlInitNodeInfoSeq(xmlParserNodeInfoSeqPtr seq);
|
||||
void xmlClearNodeInfoSeq(xmlParserNodeInfoSeqPtr seq);
|
||||
void xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
|
||||
void xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
|
||||
unsigned long xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeq* seq,
|
||||
const xmlNode* node);
|
||||
void xmlParserAddNodeInfo(xmlParserCtxtPtr ctxt,
|
||||
const xmlParserNodeInfo* info);
|
||||
void xmlParserAddNodeInfo (xmlParserCtxtPtr ctxt,
|
||||
const xmlParserNodeInfo* info);
|
||||
|
||||
void xmlDefaultSAXHandlerInit(void);
|
||||
void htmlDefaultSAXHandlerInit(void);
|
||||
/*
|
||||
* External entities handling actually implemented in xmlIO
|
||||
*/
|
||||
|
||||
void xmlSetExternalEntityLoader(xmlExternalEntityLoader f);
|
||||
xmlExternalEntityLoader
|
||||
xmlGetExternalEntityLoader(void);
|
||||
xmlParserInputPtr
|
||||
xmlLoadExternalEntity (const char *URL,
|
||||
const char *ID,
|
||||
xmlParserInputPtr context);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -15,6 +15,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define XML_MAX_NAMELEN 1000
|
||||
|
||||
/**
|
||||
* A few macros needed to help building the parser.
|
||||
*/
|
||||
@ -510,154 +512,112 @@ typedef unsigned char CHARVAL;
|
||||
* entity substitution default behaviour.
|
||||
*/
|
||||
|
||||
int xmlSubstituteEntitiesDefaultValue;
|
||||
int xmlSubstituteEntitiesDefaultValue;
|
||||
|
||||
/**
|
||||
* Parser context
|
||||
*/
|
||||
xmlParserCtxtPtr
|
||||
xmlCreateDocParserCtxt(CHAR *cur);
|
||||
xmlParserCtxtPtr
|
||||
xmlCreateFileParserCtxt(const char *filename);
|
||||
xmlParserCtxtPtr
|
||||
xmlCreateMemoryParserCtxt(char *buffer, int size);
|
||||
void
|
||||
xmlFreeParserCtxt(xmlParserCtxtPtr ctxt);
|
||||
xmlParserCtxtPtr
|
||||
xmlNewParserCtxt();
|
||||
void
|
||||
xmlSwitchEncoding(xmlParserCtxtPtr ctxt, xmlCharEncoding enc);
|
||||
xmlParserCtxtPtr xmlCreateDocParserCtxt (CHAR *cur);
|
||||
xmlParserCtxtPtr xmlCreateFileParserCtxt (const char *filename);
|
||||
xmlParserCtxtPtr xmlCreateMemoryParserCtxt(char *buffer,
|
||||
int size);
|
||||
void xmlFreeParserCtxt (xmlParserCtxtPtr ctxt);
|
||||
xmlParserCtxtPtr xmlNewParserCtxt (void);
|
||||
void xmlSwitchEncoding (xmlParserCtxtPtr ctxt,
|
||||
xmlCharEncoding enc);
|
||||
|
||||
/**
|
||||
* Entities
|
||||
*/
|
||||
void
|
||||
xmlHandleEntity(xmlParserCtxtPtr ctxt, xmlEntityPtr entity);
|
||||
void xmlHandleEntity (xmlParserCtxtPtr ctxt,
|
||||
xmlEntityPtr entity);
|
||||
|
||||
/**
|
||||
* Input Streams
|
||||
*/
|
||||
xmlParserInputPtr
|
||||
xmlNewEntityInputStream(xmlParserCtxtPtr ctxt, xmlEntityPtr entity);
|
||||
void
|
||||
xmlPushInput(xmlParserCtxtPtr ctxt, xmlParserInputPtr input);
|
||||
CHAR
|
||||
xmlPopInput(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlFreeInputStream(xmlParserInputPtr input);
|
||||
xmlParserInputPtr
|
||||
xmlNewInputFromFile(xmlParserCtxtPtr ctxt, const char *filename);
|
||||
xmlParserInputPtr xmlNewEntityInputStream (xmlParserCtxtPtr ctxt,
|
||||
xmlEntityPtr entity);
|
||||
void xmlPushInput (xmlParserCtxtPtr ctxt,
|
||||
xmlParserInputPtr input);
|
||||
CHAR xmlPopInput (xmlParserCtxtPtr ctxt);
|
||||
void xmlFreeInputStream (xmlParserInputPtr input);
|
||||
xmlParserInputPtr xmlNewInputFromFile (xmlParserCtxtPtr ctxt,
|
||||
const char *filename);
|
||||
|
||||
/**
|
||||
* Namespaces.
|
||||
*/
|
||||
CHAR *
|
||||
xmlSplitQName(const CHAR *name, CHAR **prefix);
|
||||
CHAR *
|
||||
xmlNamespaceParseNCName(xmlParserCtxtPtr ctxt);
|
||||
CHAR *
|
||||
xmlNamespaceParseQName(xmlParserCtxtPtr ctxt, CHAR **prefix);
|
||||
CHAR *
|
||||
xmlNamespaceParseNSDef(xmlParserCtxtPtr ctxt);
|
||||
CHAR *
|
||||
xmlParseQuotedString(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParseNamespace(xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlSplitQName (const CHAR *name,
|
||||
CHAR **prefix);
|
||||
CHAR * xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlNamespaceParseQName (xmlParserCtxtPtr ctxt,
|
||||
CHAR **prefix);
|
||||
CHAR * xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlParseQuotedString (xmlParserCtxtPtr ctxt);
|
||||
void xmlParseNamespace (xmlParserCtxtPtr ctxt);
|
||||
|
||||
/**
|
||||
* Generic production rules
|
||||
*/
|
||||
CHAR *
|
||||
xmlScanName(xmlParserCtxtPtr ctxt);
|
||||
CHAR *
|
||||
xmlParseName(xmlParserCtxtPtr ctxt);
|
||||
CHAR *
|
||||
xmlParseNmtoken(xmlParserCtxtPtr ctxt);
|
||||
CHAR *
|
||||
xmlParseEntityValue(xmlParserCtxtPtr ctxt, CHAR **orig);
|
||||
CHAR *
|
||||
xmlParseAttValue(xmlParserCtxtPtr ctxt);
|
||||
CHAR *
|
||||
xmlParseSystemLiteral(xmlParserCtxtPtr ctxt);
|
||||
CHAR *
|
||||
xmlParsePubidLiteral(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParseCharData(xmlParserCtxtPtr ctxt, int cdata);
|
||||
CHAR *
|
||||
xmlParseExternalID(xmlParserCtxtPtr ctxt, CHAR **publicID, int strict);
|
||||
void
|
||||
xmlParseComment(xmlParserCtxtPtr ctxt, int create);
|
||||
CHAR *
|
||||
xmlParsePITarget(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParsePI(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParseNotationDecl(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParseEntityDecl(xmlParserCtxtPtr ctxt);
|
||||
int
|
||||
xmlParseDefaultDecl(xmlParserCtxtPtr ctxt, CHAR **value);
|
||||
xmlEnumerationPtr
|
||||
xmlParseNotationType(xmlParserCtxtPtr ctxt);
|
||||
xmlEnumerationPtr
|
||||
xmlParseEnumerationType(xmlParserCtxtPtr ctxt);
|
||||
int
|
||||
xmlParseEnumeratedType(xmlParserCtxtPtr ctxt, xmlEnumerationPtr *tree);
|
||||
int
|
||||
xmlParseAttributeType(xmlParserCtxtPtr ctxt, xmlEnumerationPtr *tree);
|
||||
void
|
||||
xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt);
|
||||
xmlElementContentPtr
|
||||
xmlParseElementMixedContentDecl(xmlParserCtxtPtr ctxt);
|
||||
xmlElementContentPtr
|
||||
xmlParseElementChildrenContentDecl(xmlParserCtxtPtr ctxt);
|
||||
int
|
||||
xmlParseElementContentDecl(xmlParserCtxtPtr ctxt, CHAR *name,
|
||||
xmlElementContentPtr *result);
|
||||
int
|
||||
xmlParseElementDecl(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParseMarkupDecl(xmlParserCtxtPtr ctxt);
|
||||
int
|
||||
xmlParseCharRef(xmlParserCtxtPtr ctxt);
|
||||
xmlEntityPtr
|
||||
xmlParseEntityRef(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParseReference(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParsePEReference(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParseDocTypeDecl(xmlParserCtxtPtr ctxt);
|
||||
CHAR *
|
||||
xmlParseAttribute(xmlParserCtxtPtr ctxt, CHAR **value);
|
||||
CHAR *
|
||||
xmlParseStartTag(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParseEndTag(xmlParserCtxtPtr ctxt, CHAR *tagname);
|
||||
void
|
||||
xmlParseCDSect(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParseContent(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParseElement(xmlParserCtxtPtr ctxt);
|
||||
CHAR *
|
||||
xmlParseVersionNum(xmlParserCtxtPtr ctxt);
|
||||
CHAR *
|
||||
xmlParseVersionInfo(xmlParserCtxtPtr ctxt);
|
||||
CHAR *
|
||||
xmlParseEncName(xmlParserCtxtPtr ctxt);
|
||||
CHAR *
|
||||
xmlParseEncodingDecl(xmlParserCtxtPtr ctxt);
|
||||
int
|
||||
xmlParseSDDecl(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParseXMLDecl(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParseMisc(xmlParserCtxtPtr ctxt);
|
||||
void
|
||||
xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const CHAR *ExternalID,
|
||||
const CHAR *SystemID);
|
||||
|
||||
CHAR * xmlScanName (xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlParseName (xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlParseNmtoken (xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlParseEntityValue (xmlParserCtxtPtr ctxt,
|
||||
CHAR **orig);
|
||||
CHAR * xmlParseAttValue (xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlParseSystemLiteral (xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlParsePubidLiteral (xmlParserCtxtPtr ctxt);
|
||||
void xmlParseCharData (xmlParserCtxtPtr ctxt,
|
||||
int cdata);
|
||||
CHAR * xmlParseExternalID (xmlParserCtxtPtr ctxt,
|
||||
CHAR **publicID,
|
||||
int strict);
|
||||
void xmlParseComment (xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlParsePITarget (xmlParserCtxtPtr ctxt);
|
||||
void xmlParsePI (xmlParserCtxtPtr ctxt);
|
||||
void xmlParseNotationDecl (xmlParserCtxtPtr ctxt);
|
||||
void xmlParseEntityDecl (xmlParserCtxtPtr ctxt);
|
||||
int xmlParseDefaultDecl (xmlParserCtxtPtr ctxt,
|
||||
CHAR **value);
|
||||
xmlEnumerationPtr xmlParseNotationType (xmlParserCtxtPtr ctxt);
|
||||
xmlEnumerationPtr xmlParseEnumerationType (xmlParserCtxtPtr ctxt);
|
||||
int xmlParseEnumeratedType (xmlParserCtxtPtr ctxt,
|
||||
xmlEnumerationPtr *tree);
|
||||
int xmlParseAttributeType (xmlParserCtxtPtr ctxt,
|
||||
xmlEnumerationPtr *tree);
|
||||
void xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt);
|
||||
xmlElementContentPtr xmlParseElementMixedContentDecl
|
||||
(xmlParserCtxtPtr ctxt);
|
||||
xmlElementContentPtr xmlParseElementChildrenContentDecl
|
||||
(xmlParserCtxtPtr ctxt);
|
||||
int xmlParseElementContentDecl(xmlParserCtxtPtr ctxt,
|
||||
CHAR *name,
|
||||
xmlElementContentPtr *result);
|
||||
int xmlParseElementDecl (xmlParserCtxtPtr ctxt);
|
||||
void xmlParseMarkupDecl (xmlParserCtxtPtr ctxt);
|
||||
int xmlParseCharRef (xmlParserCtxtPtr ctxt);
|
||||
xmlEntityPtr xmlParseEntityRef (xmlParserCtxtPtr ctxt);
|
||||
void xmlParseReference (xmlParserCtxtPtr ctxt);
|
||||
void xmlParsePEReference (xmlParserCtxtPtr ctxt);
|
||||
void xmlParseDocTypeDecl (xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlParseAttribute (xmlParserCtxtPtr ctxt,
|
||||
CHAR **value);
|
||||
CHAR * xmlParseStartTag (xmlParserCtxtPtr ctxt);
|
||||
void xmlParseEndTag (xmlParserCtxtPtr ctxt,
|
||||
CHAR *tagname);
|
||||
void xmlParseCDSect (xmlParserCtxtPtr ctxt);
|
||||
void xmlParseContent (xmlParserCtxtPtr ctxt);
|
||||
void xmlParseElement (xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlParseVersionNum (xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlParseVersionInfo (xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlParseEncName (xmlParserCtxtPtr ctxt);
|
||||
CHAR * xmlParseEncodingDecl (xmlParserCtxtPtr ctxt);
|
||||
int xmlParseSDDecl (xmlParserCtxtPtr ctxt);
|
||||
void xmlParseXMLDecl (xmlParserCtxtPtr ctxt);
|
||||
void xmlParseMisc (xmlParserCtxtPtr ctxt);
|
||||
void xmlParseExternalSubset (xmlParserCtxtPtr ctxt,
|
||||
const CHAR *ExternalID,
|
||||
const CHAR *SystemID);
|
||||
/*
|
||||
* Entities substitution
|
||||
*/
|
||||
@ -666,16 +626,21 @@ xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const CHAR *ExternalID,
|
||||
#define XML_SUBSTITUTE_PEREF 2
|
||||
#define XML_SUBSTITUTE_BOTH 3
|
||||
|
||||
CHAR *
|
||||
xmlDecodeEntities(xmlParserCtxtPtr ctxt, int len, int what,
|
||||
CHAR end, CHAR end2, CHAR end3);
|
||||
CHAR * xmlDecodeEntities (xmlParserCtxtPtr ctxt,
|
||||
int len,
|
||||
int what,
|
||||
CHAR end,
|
||||
CHAR end2,
|
||||
CHAR end3);
|
||||
|
||||
/*
|
||||
* Generated by MACROS on top of parser.c c.f. PUSH_AND_POP
|
||||
*/
|
||||
extern int nodePush(xmlParserCtxtPtr ctxt, xmlNodePtr value);
|
||||
extern xmlNodePtr nodePop(xmlParserCtxtPtr ctxt);
|
||||
extern int inputPush(xmlParserCtxtPtr ctxt, xmlParserInputPtr value);
|
||||
extern xmlParserInputPtr inputPop(xmlParserCtxtPtr ctxt);
|
||||
int nodePush (xmlParserCtxtPtr ctxt,
|
||||
xmlNodePtr value);
|
||||
xmlNodePtr nodePop (xmlParserCtxtPtr ctxt);
|
||||
int inputPush (xmlParserCtxtPtr ctxt,
|
||||
xmlParserInputPtr value);
|
||||
xmlParserInputPtr inputPop (xmlParserCtxtPtr ctxt);
|
||||
|
||||
#endif /* __XML_PARSER_INTERNALS_H__ */
|
||||
|
@ -1,10 +1,10 @@
|
||||
./test/VC/AttributeDefaultLegal:4: validity error: Syntax of default value for attribute At on doc is not valid
|
||||
./test/VC/AttributeDefaultLegal:4: validity error: Attribute doc on At: invalid default value
|
||||
<!ATTLIST doc At NMTOKEN "$$$">
|
||||
^
|
||||
./test/VC/AttributeDefaultLegal:6: validity error: Syntax of default value for attribute bad on doc is not valid
|
||||
./test/VC/AttributeDefaultLegal:6: validity error: Attribute doc on bad: invalid default value
|
||||
<!ATTLIST doc bad IDREF "1abc_2">
|
||||
^
|
||||
./test/VC/AttributeDefaultLegal:8: validity error: Syntax of default value for attribute bad2 on doc is not valid
|
||||
./test/VC/AttributeDefaultLegal:8: validity error: Attribute doc on bad2: invalid default value
|
||||
<!ATTLIST doc bad2 IDREFS "abc:1 1abc_2">
|
||||
^
|
||||
./test/VC/AttributeDefaultLegal:11: validity error: No declaration for attribute val on element doc
|
||||
|
@ -8,13 +8,14 @@ Set contains 1 nodes:
|
||||
TEXT
|
||||
content=& linux too
|
||||
Object is a Node Set :
|
||||
Set contains 6 nodes:
|
||||
1 ELEMENT head
|
||||
2 ELEMENT chapter
|
||||
3 ELEMENT chapter
|
||||
4 ELEMENT chapter
|
||||
5 ELEMENT chapter
|
||||
6 ELEMENT chapter
|
||||
Set contains 1 nodes:
|
||||
1 ELEMENT EXAMPLE
|
||||
ATTRIBUTE prop1
|
||||
TEXT
|
||||
content=gnome is great
|
||||
ATTRIBUTE prop2
|
||||
TEXT
|
||||
content=& linux too
|
||||
Object is a Node Set :
|
||||
Set contains 1 nodes:
|
||||
1 ELEMENT head
|
||||
|
@ -9,7 +9,7 @@ Set contains 1 nodes:
|
||||
content=& linux too
|
||||
Object is a Node Set :
|
||||
Set contains 1 nodes:
|
||||
1 ELEMENT chapter
|
||||
1 ELEMENT head
|
||||
Object is a Node Set :
|
||||
Set contains 1 nodes:
|
||||
1 ELEMENT chapter
|
||||
|
@ -9,7 +9,13 @@ Set contains 1 nodes:
|
||||
content=& linux too
|
||||
Object is a Node Set :
|
||||
Set contains 1 nodes:
|
||||
1 ELEMENT chapter
|
||||
1 ELEMENT EXAMPLE
|
||||
ATTRIBUTE prop1
|
||||
TEXT
|
||||
content=gnome is great
|
||||
ATTRIBUTE prop2
|
||||
TEXT
|
||||
content=& linux too
|
||||
Object is a Node Set :
|
||||
Set contains 1 nodes:
|
||||
1 ELEMENT head
|
||||
|
@ -1,98 +1,98 @@
|
||||
<?xml version="1.0"?>
|
||||
<dia:diagram xmlns:dia="http://www.lysator.liu.se/~alla/dia/">
|
||||
<dia:diagramdata>
|
||||
<dia:attribute name="">
|
||||
<dia:color val=""/>
|
||||
<dia:attribute name="background">
|
||||
<dia:color val="#ffffff"/>
|
||||
</dia:attribute>
|
||||
</dia:diagramdata>
|
||||
<dia:layer name="" visible="">
|
||||
<dia:object type="" version="" id="">
|
||||
<dia:attribute name="">
|
||||
<dia:point val=""/>
|
||||
<dia:layer name="Background" visible="true">
|
||||
<dia:object type="Standard - Line" version="0" id="O0">
|
||||
<dia:attribute name="obj_pos">
|
||||
<dia:point val="1.95,6.85"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:rectangle val=""/>
|
||||
<dia:attribute name="obj_bb">
|
||||
<dia:rectangle val="1.9,6.8;11,8.55"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:point val=""/>
|
||||
<dia:point val=""/>
|
||||
<dia:attribute name="conn_endpoints">
|
||||
<dia:point val="1.95,6.85"/>
|
||||
<dia:point val="10.95,8.5"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:color val=""/>
|
||||
<dia:attribute name="line_color">
|
||||
<dia:color val="#000000"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:real val=""/>
|
||||
<dia:attribute name="line_width">
|
||||
<dia:real val="0.1"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:enum val=""/>
|
||||
<dia:attribute name="line_style">
|
||||
<dia:enum val="0"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:enum val=""/>
|
||||
<dia:attribute name="start_arrow">
|
||||
<dia:enum val="0"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:enum val=""/>
|
||||
<dia:attribute name="end_arrow">
|
||||
<dia:enum val="0"/>
|
||||
</dia:attribute>
|
||||
<dia:connections>
|
||||
<dia:connection handle="" to="" connection=""/>
|
||||
<dia:connection handle="1" to="O2" connection="3"/>
|
||||
</dia:connections>
|
||||
</dia:object>
|
||||
<dia:object type="" version="" id="">
|
||||
<dia:attribute name="">
|
||||
<dia:point val=""/>
|
||||
<dia:object type="Standard - Text" version="0" id="O1">
|
||||
<dia:attribute name="obj_pos">
|
||||
<dia:point val="4.8,4.75"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:rectangle val=""/>
|
||||
<dia:attribute name="obj_bb">
|
||||
<dia:rectangle val="2.579,3.96359;7.021,4.96359"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:composite type="">
|
||||
<dia:attribute name="">
|
||||
<dia:string val=""/>
|
||||
<dia:attribute name="text">
|
||||
<dia:composite type="text">
|
||||
<dia:attribute name="string">
|
||||
<dia:string val="sdfsdfg"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:font name=""/>
|
||||
<dia:attribute name="font">
|
||||
<dia:font name="Courier"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:real val=""/>
|
||||
<dia:attribute name="height">
|
||||
<dia:real val="1"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:point val=""/>
|
||||
<dia:attribute name="pos">
|
||||
<dia:point val="4.8,4.75"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:color val=""/>
|
||||
<dia:attribute name="color">
|
||||
<dia:color val="#000000"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:enum val=""/>
|
||||
<dia:attribute name="alignment">
|
||||
<dia:enum val="1"/>
|
||||
</dia:attribute>
|
||||
</dia:composite>
|
||||
</dia:attribute>
|
||||
</dia:object>
|
||||
<dia:object type="" version="" id="">
|
||||
<dia:attribute name="">
|
||||
<dia:point val=""/>
|
||||
<dia:object type="Standard - Box" version="0" id="O2">
|
||||
<dia:attribute name="obj_pos">
|
||||
<dia:point val="10.95,7.5"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:rectangle val=""/>
|
||||
<dia:attribute name="obj_bb">
|
||||
<dia:rectangle val="10.9,7.45;13.05,9.55"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:point val=""/>
|
||||
<dia:attribute name="elem_corner">
|
||||
<dia:point val="10.95,7.5"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:real val=""/>
|
||||
<dia:attribute name="elem_width">
|
||||
<dia:real val="2.05"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:real val=""/>
|
||||
<dia:attribute name="elem_height">
|
||||
<dia:real val="2"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:real val=""/>
|
||||
<dia:attribute name="border_width">
|
||||
<dia:real val="0.1"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:color val=""/>
|
||||
<dia:attribute name="border_color">
|
||||
<dia:color val="#000000"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:color val=""/>
|
||||
<dia:attribute name="inner_color">
|
||||
<dia:color val="#ffffff"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:enum val=""/>
|
||||
<dia:attribute name="line_style">
|
||||
<dia:enum val="0"/>
|
||||
</dia:attribute>
|
||||
</dia:object>
|
||||
</dia:layer>
|
||||
|
@ -1,98 +1,98 @@
|
||||
<?xml version="1.0"?>
|
||||
<dia:diagram xmlns:dia="http://www.lysator.liu.se/~alla/dia/">
|
||||
<dia:diagramdata>
|
||||
<dia:attribute name="">
|
||||
<dia:color val=""/>
|
||||
<dia:attribute name="background">
|
||||
<dia:color val="#ffffff"/>
|
||||
</dia:attribute>
|
||||
</dia:diagramdata>
|
||||
<dia:layer name="" visible="">
|
||||
<dia:object type="" version="" id="">
|
||||
<dia:attribute name="">
|
||||
<dia:point val=""/>
|
||||
<dia:layer name="Background" visible="true">
|
||||
<dia:object type="Standard - Line" version="0" id="O0">
|
||||
<dia:attribute name="obj_pos">
|
||||
<dia:point val="1.95,6.85"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:rectangle val=""/>
|
||||
<dia:attribute name="obj_bb">
|
||||
<dia:rectangle val="1.9,6.8;11,8.55"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:point val=""/>
|
||||
<dia:point val=""/>
|
||||
<dia:attribute name="conn_endpoints">
|
||||
<dia:point val="1.95,6.85"/>
|
||||
<dia:point val="10.95,8.5"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:color val=""/>
|
||||
<dia:attribute name="line_color">
|
||||
<dia:color val="#000000"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:real val=""/>
|
||||
<dia:attribute name="line_width">
|
||||
<dia:real val="0.1"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:enum val=""/>
|
||||
<dia:attribute name="line_style">
|
||||
<dia:enum val="0"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:enum val=""/>
|
||||
<dia:attribute name="start_arrow">
|
||||
<dia:enum val="0"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:enum val=""/>
|
||||
<dia:attribute name="end_arrow">
|
||||
<dia:enum val="0"/>
|
||||
</dia:attribute>
|
||||
<dia:connections>
|
||||
<dia:connection handle="" to="" connection=""/>
|
||||
<dia:connection handle="1" to="O2" connection="3"/>
|
||||
</dia:connections>
|
||||
</dia:object>
|
||||
<dia:object type="" version="" id="">
|
||||
<dia:attribute name="">
|
||||
<dia:point val=""/>
|
||||
<dia:object type="Standard - Text" version="0" id="O1">
|
||||
<dia:attribute name="obj_pos">
|
||||
<dia:point val="4.8,4.75"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:rectangle val=""/>
|
||||
<dia:attribute name="obj_bb">
|
||||
<dia:rectangle val="2.579,3.96359;7.021,4.96359"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:composite type="">
|
||||
<dia:attribute name="">
|
||||
<dia:string val=""/>
|
||||
<dia:attribute name="text">
|
||||
<dia:composite type="text">
|
||||
<dia:attribute name="string">
|
||||
<dia:string val="sdfsdfg"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:font name=""/>
|
||||
<dia:attribute name="font">
|
||||
<dia:font name="Courier"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:real val=""/>
|
||||
<dia:attribute name="height">
|
||||
<dia:real val="1"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:point val=""/>
|
||||
<dia:attribute name="pos">
|
||||
<dia:point val="4.8,4.75"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:color val=""/>
|
||||
<dia:attribute name="color">
|
||||
<dia:color val="#000000"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:enum val=""/>
|
||||
<dia:attribute name="alignment">
|
||||
<dia:enum val="1"/>
|
||||
</dia:attribute>
|
||||
</dia:composite>
|
||||
</dia:attribute>
|
||||
</dia:object>
|
||||
<dia:object type="" version="" id="">
|
||||
<dia:attribute name="">
|
||||
<dia:point val=""/>
|
||||
<dia:object type="Standard - Box" version="0" id="O2">
|
||||
<dia:attribute name="obj_pos">
|
||||
<dia:point val="10.95,7.5"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:rectangle val=""/>
|
||||
<dia:attribute name="obj_bb">
|
||||
<dia:rectangle val="10.9,7.45;13.05,9.55"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:point val=""/>
|
||||
<dia:attribute name="elem_corner">
|
||||
<dia:point val="10.95,7.5"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:real val=""/>
|
||||
<dia:attribute name="elem_width">
|
||||
<dia:real val="2.05"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:real val=""/>
|
||||
<dia:attribute name="elem_height">
|
||||
<dia:real val="2"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:real val=""/>
|
||||
<dia:attribute name="border_width">
|
||||
<dia:real val="0.1"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:color val=""/>
|
||||
<dia:attribute name="border_color">
|
||||
<dia:color val="#000000"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:color val=""/>
|
||||
<dia:attribute name="inner_color">
|
||||
<dia:color val="#ffffff"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="">
|
||||
<dia:enum val=""/>
|
||||
<dia:attribute name="line_style">
|
||||
<dia:enum val="0"/>
|
||||
</dia:attribute>
|
||||
</dia:object>
|
||||
</dia:layer>
|
||||
|
@ -7,6 +7,6 @@
|
||||
<EXAMPLE>
|
||||
|
||||
This text is about XML, the Extensible Markup Language and this is an embedded
|
||||
<IMG src=""/>
|
||||
<IMG src="image"/>
|
||||
|
||||
</EXAMPLE>
|
||||
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE EXAMPLE SYSTEM "example.dtd" [
|
||||
<!ENTITY xml "Extensible Markup Language">
|
||||
]>
|
||||
<EXAMPLE prop1="a&b" prop2="Extensible Markup Language">
|
||||
Test of entities in attributes.
|
||||
</EXAMPLE>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE EXAMPLE SYSTEM "example.dtd" [
|
||||
<!ENTITY xml "Extensible Markup Language">
|
||||
]>
|
||||
<EXAMPLE>
|
||||
Test of &amp; behaviour a&b .
|
||||
</EXAMPLE>
|
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0"?>
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/TR/WD-rdf-syntax#" p3p="http//www.w3.org/TR/1998/WD-P3P10-syntax#proposal.DTD">
|
||||
<PROP realm="http://www.CoolCatalog.com/catalogue/" entity="CoolCatalog" agreeID="94df1293a3e519bb" assurance="http://www.TrustUs.org">
|
||||
<USES>
|
||||
<STATEMENT purp="2,3" recpnt="0" id="0" consq="a site with clothes you'd appreciate.">
|
||||
<WITH>
|
||||
<PREFIX name="User.">
|
||||
<REF name="Name.First"/>
|
||||
<REF name="Bdate.Year" optional="1"/>
|
||||
<REF name="Gender"/>
|
||||
</PREFIX>
|
||||
</WITH>
|
||||
</STATEMENT>
|
||||
</USES>
|
||||
<USES>
|
||||
<STATEMENT action="read&write" purp="0" recpnt="0" id="1">
|
||||
<REF name="User.Shipping."/>
|
||||
</STATEMENT>
|
||||
</USES>
|
||||
<DISCLOSURE discURI="http://www.CoolCatalog.com/PrivacyPractice.html" access="3" other="0,1"/>
|
||||
</PROP>
|
||||
</RDF:RDF>
|
@ -0,0 +1,81 @@
|
||||
<?xml version="1.0"?>
|
||||
<RDF:RDF xmlns:RPM="http://www.rpm.org/" xmlns:RDF="http://www.w3.org/TR/WD-rdf-syntax#">
|
||||
<RDF:Description HREF="ftp://rufus.w3.org/linux/redhat/redhat-5.1/i386/RedHat/RPMS/rpm-2.5-2.i386.rpm">
|
||||
<RPM:Name>rpm</RPM:Name>
|
||||
<RPM:Version>2.5</RPM:Version>
|
||||
<RPM:Release>2</RPM:Release>
|
||||
<RPM:Arch>i386</RPM:Arch>
|
||||
<RPM:Os>Linux</RPM:Os>
|
||||
<RPM:Distribution>Manhattan </RPM:Distribution>
|
||||
<RPM:Vendor>Red Hat Software</RPM:Vendor>
|
||||
<RPM:Packager>Red Hat Software <bugs@redhat.com></RPM:Packager>
|
||||
<RPM:Group>Utilities/System</RPM:Group>
|
||||
<RPM:Summary>Red Hat Package Manager</RPM:Summary>
|
||||
<RPM:Description>RPM is a powerful package manager, which can be used to build, install,
|
||||
query, verify, update, and uninstall individual software packages. A
|
||||
package consists of an archive of files, and package information, including
|
||||
name, version, and description.</RPM:Description>
|
||||
<RPM:Copyright>GPL</RPM:Copyright>
|
||||
<RPM:Changelog>* Sun May 10 1998 Prospector System <bugs@redhat.com>
|
||||
- translations modified for de, fr, tr
|
||||
</RPM:Changelog>
|
||||
<RPM:Sources>rpm-2.5-2.src.rpm</RPM:Sources>
|
||||
<RPM:SourcesFtp>ftp://ftp.redhat.com/pub/redhat/redhat-5.1/SRPMS</RPM:SourcesFtp>
|
||||
<RPM:BuildDate>Sun May 10 14:52:32 1998</RPM:BuildDate>
|
||||
<RPM:Date>894826352</RPM:Date>
|
||||
<RPM:Size>850599</RPM:Size>
|
||||
<RPM:BuildHost>porky.redhat.com</RPM:BuildHost>
|
||||
<RPM:Provides>
|
||||
<RDF:Bag>
|
||||
<RPM:Resource>rpm</RPM:Resource>
|
||||
</RDF:Bag>
|
||||
</RPM:Provides>
|
||||
<RPM:Requires>
|
||||
<RDF:Bag>
|
||||
<RPM:Resource>/bin/sh</RPM:Resource>
|
||||
<RPM:Resource>ld-linux.so.2</RPM:Resource>
|
||||
<RPM:Resource>libc.so.6</RPM:Resource>
|
||||
<RPM:Resource>libdb.so.2</RPM:Resource>
|
||||
<RPM:Resource>libz.so.1</RPM:Resource>
|
||||
<RPM:Resource>/bin/bash</RPM:Resource>
|
||||
<RPM:Resource>/bin/sh</RPM:Resource>
|
||||
</RDF:Bag>
|
||||
</RPM:Requires>
|
||||
<RPM:Files>/bin/rpm
|
||||
/usr/bin/find-provides
|
||||
/usr/bin/find-requires
|
||||
/usr/bin/gendiff
|
||||
/usr/bin/rpm2cpio
|
||||
/usr/doc/rpm-2.5
|
||||
/usr/doc/rpm-2.5/CHANGES
|
||||
/usr/doc/rpm-2.5/RPM-PGP-KEY
|
||||
/usr/doc/rpm-2.5/buildroot
|
||||
/usr/doc/rpm-2.5/dependencies
|
||||
/usr/doc/rpm-2.5/format
|
||||
/usr/doc/rpm-2.5/groups
|
||||
/usr/doc/rpm-2.5/macros
|
||||
/usr/doc/rpm-2.5/queryformat
|
||||
/usr/doc/rpm-2.5/relocatable
|
||||
/usr/doc/rpm-2.5/signatures
|
||||
/usr/doc/rpm-2.5/spec
|
||||
/usr/doc/rpm-2.5/triggers
|
||||
/usr/lib/rpmpopt
|
||||
/usr/lib/rpmrc
|
||||
/usr/man/man8/rpm.8
|
||||
/usr/man/man8/rpm2cpio.8
|
||||
/usr/share/locale/de/LC_MESSAGES/rpm.mo
|
||||
/usr/share/locale/fr/LC_MESSAGES/rpm.mo
|
||||
/usr/share/locale/pt-br/LC_MESSAGES/rpm.mo
|
||||
/usr/share/locale/sv/LC_MESSAGES/rpm.mo
|
||||
/usr/share/locale/tr/LC_MESSAGES/rpm.mo
|
||||
/usr/src/redhat
|
||||
/usr/src/redhat/BUILD
|
||||
/usr/src/redhat/RPMS
|
||||
/usr/src/redhat/RPMS/i386
|
||||
/usr/src/redhat/RPMS/noarch
|
||||
/usr/src/redhat/SOURCES
|
||||
/usr/src/redhat/SPECS
|
||||
/usr/src/redhat/SRPMS
|
||||
</RPM:Files>
|
||||
</RDF:Description>
|
||||
</RDF:RDF>
|
1899
result/noent/rdf2
1899
result/noent/rdf2
File diff suppressed because it is too large
Load Diff
@ -1,161 +1,161 @@
|
||||
<?xml version="1.0" standalone="yes"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
|
||||
<svg width="" height="">
|
||||
<g style=""/>
|
||||
<g style="">
|
||||
<polyline verts=""/>
|
||||
<svg width="242px" height="383px">
|
||||
<g style="stroke: #000000"/>
|
||||
<g style="fill: #f2cc99">
|
||||
<polyline verts=" 69,18 82,8 99,3 118,5 135,12 149,21 156,13 165,9 177,13 183,28 180,50 164,91 155,107 154,114 151,121 141,127 139,136 155,206 157,251 126,342 133,357 128,376 83,376 75,368 67,350 61,350 53,369 4,369 2,361 5,354 12,342 16,321 4,257 4,244 7,218 9,179 26,127 43,93 32,77 30,70 24,67 16,49 17,35 18,23 30,12 40,7 53,7 62,12 69,18 69,18 69,18"/>
|
||||
</g>
|
||||
<g style="">
|
||||
<polyline verts=""/>
|
||||
<g style="fill: #e5b27f">
|
||||
<polyline verts=" 142,79 136,74 138,82 133,78 133,84 127,78 128,85 124,80 125,87 119,82 119,90 125,99 125,96 128,100 128,94 131,98 132,93 135,97 136,93 138,97 139,94 141,98 143,94 144,85 142,79 142,79 142,79"/>
|
||||
</g>
|
||||
<g style="">
|
||||
<polyline verts=""/>
|
||||
<g style="fill: #eb8080">
|
||||
<polyline verts=" 127,101 132,100 137,99 144,101 143,105 135,110 127,101 127,101 127,101"/>
|
||||
</g>
|
||||
<g style="">
|
||||
<polyline verts=""/>
|
||||
<g style="fill: #f2cc99">
|
||||
<polyline verts=" 178,229 157,248 139,296 126,349 137,356 158,357 183,342 212,332 235,288 235,261 228,252 212,250 188,251 178,229 178,229 178,229"/>
|
||||
</g>
|
||||
<g style="">
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<g style="fill: #9c826b">
|
||||
<polyline verts=" 56,229 48,241 48,250 57,281 63,325 71,338 81,315 76,321 79,311 83,301 75,308 80,298 73,303 76,296 71,298 74,292 69,293 74,284 78,278 71,278 74,274 68,273 70,268 66,267 68,261 60,266 62,259 65,253 57,258 59,251 55,254 55,248 60,237 54,240 58,234 54,236 56,229 56,229 56,229"/>
|
||||
<polyline verts=" 74,363 79,368 81,368 85,362 89,363 92,370 96,373 101,372 108,361 110,371 113,373 116,371 120,358 122,363 123,371 126,371 129,367 132,357 135,361 130,376 127,377 94,378 84,376 76,371 74,363 74,363 74,363"/>
|
||||
<polyline verts=" 212,250 219,251 228,258 236,270 235,287 225,304 205,332 177,343 171,352 158,357 166,352 168,346 168,339 165,333 155,327 155,323 161,320 165,316 169,316 167,312 171,313 168,308 173,309 170,306 177,306 175,308 177,311 174,311 176,316 171,315 174,319 168,320 168,323 175,327 179,332 183,326 184,332 189,323 190,328 194,320 194,325 199,316 201,320 204,313 206,316 208,310 211,305 219,298 226,288 229,279 228,266 224,259 217,253 212,250 212,250 212,250"/>
|
||||
<polyline verts=" 151,205 151,238 149,252 141,268 128,282 121,301 130,300 126,313 118,324 116,337 120,346 133,352 133,340 137,333 145,329 156,327 153,319 153,291 157,271 170,259 178,277 193,250 174,216 151,205 151,205 151,205"/>
|
||||
<polyline verts=" 78,127 90,142 95,155 108,164 125,167 139,175 150,206 152,191 141,140 121,148 100,136 78,127 78,127 78,127"/>
|
||||
<polyline verts=" 21,58 35,63 38,68 32,69 42,74 40,79 47,80 54,83 45,94 34,81 32,73 24,66 21,58 21,58 21,58"/>
|
||||
<polyline verts=" 71,34 67,34 66,27 59,24 54,17 48,17 39,22 30,26 28,31 31,39 38,46 29,45 36,54 41,61 41,70 50,69 54,71 55,58 67,52 76,43 76,39 68,44 71,34 71,34 71,34"/>
|
||||
<polyline verts=" 139,74 141,83 143,89 144,104 148,104 155,106 154,86 157,77 155,72 150,77 144,77 139,74 139,74 139,74"/>
|
||||
<polyline verts=" 105,44 102,53 108,58 111,62 112,55 105,44 105,44 105,44"/>
|
||||
<polyline verts=" 141,48 141,54 144,58 139,62 137,66 136,59 137,52 141,48 141,48 141,48"/>
|
||||
<polyline verts=" 98,135 104,130 105,134 108,132 108,135 112,134 113,137 116,136 116,139 119,139 124,141 128,140 133,138 140,133 139,140 126,146 104,144 98,135 98,135 98,135"/>
|
||||
<polyline verts=" 97,116 103,119 103,116 111,118 116,117 122,114 127,107 135,111 142,107 141,114 145,118 149,121 145,125 140,124 127,121 113,125 100,124 97,116 97,116 97,116"/>
|
||||
<polyline verts=" 147,33 152,35 157,34 153,31 160,31 156,28 161,28 159,24 163,25 163,21 165,22 170,23 167,17 172,21 174,18 175,23 176,22 177,28 177,33 174,37 176,39 174,44 171,49 168,53 164,57 159,68 156,70 154,60 150,51 146,43 144,35 147,33 147,33 147,33"/>
|
||||
<polyline verts=" 85,72 89,74 93,75 100,76 105,75 102,79 94,79 88,76 85,72 85,72 85,72"/>
|
||||
<polyline verts=" 86,214 79,221 76,232 82,225 78,239 82,234 78,245 81,243 79,255 84,250 84,267 87,254 90,271 90,257 95,271 93,256 95,249 92,252 93,243 89,253 89,241 86,250 87,236 83,245 87,231 82,231 90,219 84,221 86,214 86,214 86,214"/>
|
||||
</g>
|
||||
<g style="">
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<g style="fill: #ffcc7f">
|
||||
<polyline verts=" 93,68 96,72 100,73 106,72 108,66 105,63 100,62 93,68 93,68 93,68"/>
|
||||
<polyline verts=" 144,64 142,68 142,73 146,74 150,73 154,64 149,62 144,64 144,64 144,64"/>
|
||||
</g>
|
||||
<g style="">
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<g style="fill: #9c826b">
|
||||
<polyline verts=" 57,91 42,111 52,105 41,117 53,112 46,120 53,116 50,124 57,119 55,127 61,122 60,130 67,126 66,134 71,129 72,136 77,130 76,137 80,133 82,138 86,135 96,135 94,129 86,124 83,117 77,123 79,117 73,120 75,112 68,116 71,111 65,114 69,107 63,110 68,102 61,107 66,98 61,103 63,97 57,99 57,91 57,91 57,91"/>
|
||||
<polyline verts=" 83,79 76,79 67,82 75,83 65,88 76,87 65,92 76,91 68,96 77,95 70,99 80,98 72,104 80,102 76,108 85,103 92,101 87,98 93,96 86,94 91,93 85,91 93,89 99,89 105,93 107,85 102,82 92,80 83,79 83,79 83,79"/>
|
||||
<polyline verts=" 109,77 111,83 109,89 113,94 117,90 117,81 114,78 109,77 109,77 109,77"/>
|
||||
<polyline verts=" 122,128 127,126 134,127 136,129 134,130 130,128 124,129 122,128 122,128 122,128"/>
|
||||
<polyline verts=" 78,27 82,32 80,33 82,36 78,37 82,40 78,42 81,46 76,47 78,49 74,50 82,52 87,50 83,48 91,46 86,45 91,42 88,40 92,37 86,34 90,31 86,29 89,26 78,27 78,27 78,27"/>
|
||||
<polyline verts=" 82,17 92,20 79,21 90,25 81,25 94,28 93,26 101,30 101,26 107,33 108,28 111,40 113,34 115,45 117,39 119,54 121,46 124,58 126,47 129,59 130,49 134,58 133,44 137,48 133,37 137,40 133,32 126,20 135,26 132,19 138,23 135,17 142,18 132,11 116,6 94,6 78,11 92,12 80,14 90,16 82,17 82,17 82,17"/>
|
||||
<polyline verts=" 142,234 132,227 124,223 115,220 110,225 118,224 127,229 135,236 122,234 115,237 113,242 121,238 139,243 121,245 111,254 95,254 102,244 104,235 110,229 100,231 104,224 113,216 122,215 132,217 141,224 145,230 149,240 142,234 142,234 142,234"/>
|
||||
<polyline verts=" 115,252 125,248 137,249 143,258 134,255 125,254 115,252 115,252 115,252"/>
|
||||
<polyline verts=" 114,212 130,213 140,219 147,225 144,214 137,209 128,207 114,212 114,212 114,212"/>
|
||||
<polyline verts=" 102,263 108,258 117,257 131,258 116,260 109,265 102,263 102,263 102,263"/>
|
||||
<polyline verts=" 51,241 35,224 40,238 23,224 31,242 19,239 28,247 17,246 25,250 37,254 39,263 44,271 47,294 48,317 51,328 60,351 60,323 53,262 47,246 51,241 51,241 51,241"/>
|
||||
<polyline verts=" 2,364 9,367 14,366 18,355 20,364 26,366 31,357 35,364 39,364 42,357 47,363 53,360 59,357 54,369 7,373 2,364 2,364 2,364"/>
|
||||
<polyline verts=" 7,349 19,345 25,339 18,341 23,333 28,326 23,326 27,320 23,316 25,311 20,298 15,277 12,264 9,249 10,223 3,248 5,261 15,307 17,326 11,343 7,349 7,349 7,349"/>
|
||||
<polyline verts=" 11,226 15,231 25,236 18,227 11,226 11,226 11,226"/>
|
||||
<polyline verts=" 13,214 19,217 32,227 23,214 16,208 15,190 24,148 31,121 24,137 14,170 8,189 13,214 13,214 13,214"/>
|
||||
<polyline verts=" 202,254 195,258 199,260 193,263 197,263 190,268 196,268 191,273 188,282 200,272 194,272 201,266 197,265 204,262 200,258 204,256 202,254 202,254 202,254"/>
|
||||
</g>
|
||||
<g style="">
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<g style="fill: #845433">
|
||||
<polyline verts=" 151,213 165,212 179,225 189,246 187,262 179,275 176,263 177,247 171,233 163,230 165,251 157,264 146,298 145,321 133,326 143,285 154,260 153,240 151,213 151,213 151,213"/>
|
||||
<polyline verts=" 91,132 95,145 97,154 104,148 107,155 109,150 111,158 115,152 118,159 120,153 125,161 126,155 133,164 132,154 137,163 137,152 142,163 147,186 152,192 148,167 141,143 124,145 105,143 91,132 91,132 91,132"/>
|
||||
</g>
|
||||
<g style="">
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<g style="fill: #9c826b">
|
||||
<polyline verts=" 31,57 23,52 26,51 20,44 23,42 21,36 22,29 25,23 24,32 30,43 26,41 30,50 26,48 31,57 31,57 31,57"/>
|
||||
<polyline verts=" 147,21 149,28 155,21 161,16 167,14 175,15 173,11 161,9 147,21 147,21 147,21"/>
|
||||
<polyline verts=" 181,39 175,51 169,57 171,65 165,68 165,75 160,76 162,91 171,71 180,51 181,39 181,39 181,39"/>
|
||||
<polyline verts=" 132,346 139,348 141,346 142,341 147,342 143,355 133,350 132,346 132,346 132,346"/>
|
||||
<polyline verts=" 146,355 151,352 155,348 157,343 160,349 151,356 147,357 146,355 146,355 146,355"/>
|
||||
<polyline verts=" 99,266 100,281 94,305 86,322 78,332 72,346 73,331 91,291 99,266 99,266 99,266"/>
|
||||
<polyline verts=" 20,347 32,342 45,340 54,345 45,350 42,353 38,350 31,353 29,356 23,350 19,353 15,349 20,347 20,347 20,347"/>
|
||||
<polyline verts=" 78,344 86,344 92,349 88,358 84,352 78,344 78,344 78,344"/>
|
||||
<polyline verts=" 93,347 104,344 117,345 124,354 121,357 116,351 112,351 108,355 102,351 93,347 93,347 93,347"/>
|
||||
</g>
|
||||
<g style="">
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<g style="fill: #000000">
|
||||
<polyline verts=" 105,12 111,18 113,24 113,29 119,34 116,23 112,16 105,12 105,12 105,12"/>
|
||||
<polyline verts=" 122,27 125,34 127,43 128,34 125,29 122,27 122,27 122,27"/>
|
||||
<polyline verts=" 115,13 122,19 122,15 113,10 115,13 115,13 115,13"/>
|
||||
</g>
|
||||
<g style="">
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<g style="fill: #ffe5b2">
|
||||
<polyline verts=" 116,172 107,182 98,193 98,183 90,199 89,189 84,207 88,206 87,215 95,206 93,219 91,230 98,216 97,226 104,214 112,209 104,208 113,202 126,200 139,207 132,198 142,203 134,192 142,195 134,187 140,185 130,181 136,177 126,177 125,171 116,180 116,172 116,172 116,172"/>
|
||||
<polyline verts=" 74,220 67,230 67,221 59,235 63,233 60,248 70,232 65,249 71,243 67,256 73,250 69,262 73,259 71,267 76,262 72,271 78,270 76,275 82,274 78,290 86,279 86,289 92,274 88,275 87,264 82,270 82,258 77,257 78,247 73,246 77,233 72,236 74,220 74,220 74,220"/>
|
||||
<polyline verts=" 133,230 147,242 148,250 145,254 138,247 129,246 142,245 138,241 128,237 137,238 133,230 133,230 133,230"/>
|
||||
<polyline verts=" 133,261 125,261 116,263 111,267 125,265 133,261 133,261 133,261"/>
|
||||
<polyline verts=" 121,271 109,273 103,279 99,305 92,316 85,327 83,335 89,340 97,341 94,336 101,336 96,331 103,330 97,327 108,325 99,322 109,321 100,318 110,317 105,314 110,312 107,310 113,308 105,306 114,303 105,301 115,298 107,295 115,294 108,293 117,291 109,289 117,286 109,286 118,283 112,281 118,279 114,278 119,276 115,274 121,271 121,271 121,271"/>
|
||||
<polyline verts=" 79,364 74,359 74,353 76,347 80,351 83,356 82,360 79,364 79,364 79,364"/>
|
||||
<polyline verts=" 91,363 93,356 97,353 103,355 105,360 103,366 99,371 94,368 91,363 91,363 91,363"/>
|
||||
<polyline verts=" 110,355 114,353 118,357 117,363 113,369 111,362 110,355 110,355 110,355"/>
|
||||
<polyline verts=" 126,354 123,358 124,367 126,369 129,361 129,357 126,354 126,354 126,354"/>
|
||||
<polyline verts=" 30,154 24,166 20,182 23,194 29,208 37,218 41,210 41,223 46,214 46,227 52,216 52,227 61,216 59,225 68,213 73,219 70,207 77,212 69,200 77,202 70,194 78,197 68,187 76,182 64,182 58,175 58,185 53,177 50,186 46,171 44,182 39,167 36,172 36,162 30,166 30,154 30,154 30,154"/>
|
||||
<polyline verts=" 44,130 41,137 45,136 43,150 48,142 48,157 53,150 52,164 60,156 61,169 64,165 66,175 70,167 74,176 77,168 80,183 85,172 90,182 93,174 98,181 99,173 104,175 105,169 114,168 102,163 95,157 94,166 90,154 87,162 82,149 75,159 72,148 68,155 67,143 62,148 62,138 58,145 56,133 52,142 52,128 49,134 47,125 44,130 44,130 44,130"/>
|
||||
<polyline verts=" 13,216 19,219 36,231 22,223 16,222 22,227 12,224 13,220 16,220 13,216 13,216 13,216"/>
|
||||
<polyline verts=" 10,231 14,236 25,239 27,237 19,234 10,231 10,231 10,231"/>
|
||||
<polyline verts=" 9,245 14,242 25,245 13,245 9,245 9,245 9,245"/>
|
||||
<polyline verts=" 33,255 26,253 18,254 25,256 18,258 27,260 18,263 27,265 19,267 29,270 21,272 29,276 21,278 30,281 22,283 31,287 24,288 32,292 23,293 34,298 26,299 37,303 32,305 39,309 33,309 39,314 34,314 40,318 34,317 40,321 34,321 41,326 33,326 40,330 33,332 39,333 33,337 42,337 54,341 49,337 52,335 47,330 50,330 45,325 49,325 45,321 48,321 45,316 46,306 45,286 43,274 36,261 33,255 33,255 33,255"/>
|
||||
<polyline verts=" 7,358 9,351 14,351 17,359 11,364 7,358 7,358 7,358"/>
|
||||
<polyline verts=" 44,354 49,351 52,355 49,361 44,354 44,354 44,354"/>
|
||||
<polyline verts=" 32,357 37,353 40,358 36,361 32,357 32,357 32,357"/>
|
||||
<polyline verts=" 139,334 145,330 154,330 158,334 154,341 152,348 145,350 149,340 147,336 141,339 139,345 136,342 136,339 139,334 139,334 139,334"/>
|
||||
<polyline verts=" 208,259 215,259 212,255 220,259 224,263 225,274 224,283 220,292 208,300 206,308 203,304 199,315 197,309 195,318 193,313 190,322 190,316 185,325 182,318 180,325 172,321 178,320 176,313 186,312 180,307 188,307 184,303 191,302 186,299 195,294 187,290 197,288 192,286 201,283 194,280 203,277 198,275 207,271 200,269 209,265 204,265 212,262 208,259 208,259 208,259"/>
|
||||
<polyline verts=" 106,126 106,131 109,132 111,134 115,132 115,135 119,133 118,137 123,137 128,137 133,134 136,130 136,127 132,124 118,128 112,128 106,126 106,126 106,126"/>
|
||||
<polyline verts=" 107,114 101,110 98,102 105,97 111,98 119,102 121,108 118,112 113,115 107,114 107,114 107,114"/>
|
||||
<polyline verts=" 148,106 145,110 146,116 150,118 152,111 151,107 148,106 148,106 148,106"/>
|
||||
<polyline verts=" 80,55 70,52 75,58 63,57 72,61 57,61 67,66 57,67 62,69 54,71 61,73 54,77 63,78 53,85 60,84 56,90 69,84 63,82 75,76 70,75 77,72 72,71 78,69 72,66 81,67 78,64 82,63 80,60 86,62 80,55 80,55 80,55"/>
|
||||
<polyline verts=" 87,56 91,52 96,50 102,56 98,56 92,60 87,56 87,56 87,56"/>
|
||||
<polyline verts=" 85,68 89,73 98,76 106,74 96,73 91,70 85,68 85,68 85,68"/>
|
||||
<polyline verts=" 115,57 114,64 111,64 115,75 122,81 122,74 126,79 126,74 131,78 130,72 133,77 131,68 126,61 119,57 115,57 115,57 115,57"/>
|
||||
<polyline verts=" 145,48 143,53 147,59 151,59 150,55 145,48 145,48 145,48"/>
|
||||
<polyline verts=" 26,22 34,15 43,10 52,10 59,16 47,15 32,22 26,22 26,22 26,22"/>
|
||||
<polyline verts=" 160,19 152,26 149,34 154,33 152,30 157,30 155,26 158,27 157,23 161,23 160,19 160,19 160,19"/>
|
||||
</g>
|
||||
<g style="">
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<polyline verts=""/>
|
||||
<g style="fill: #000000">
|
||||
<polyline verts=" 98,117 105,122 109,122 105,117 113,120 121,120 130,112 128,108 123,103 123,99 128,101 132,106 135,109 142,105 142,101 145,101 145,91 148,101 145,105 136,112 135,116 143,124 148,120 150,122 142,128 133,122 121,125 112,126 103,125 100,129 96,124 98,117 98,117 98,117"/>
|
||||
<polyline verts=" 146,118 152,118 152,115 149,115 146,118 146,118 146,118"/>
|
||||
<polyline verts=" 148,112 154,111 154,109 149,109 148,112 148,112 148,112"/>
|
||||
<polyline verts=" 106,112 108,115 114,116 118,114 106,112 106,112 106,112"/>
|
||||
<polyline verts=" 108,108 111,110 116,110 119,108 108,108 108,108 108,108"/>
|
||||
<polyline verts=" 106,104 109,105 117,106 115,104 106,104 106,104 106,104"/>
|
||||
<polyline verts=" 50,25 41,26 34,33 39,43 49,58 36,51 47,68 55,69 54,59 61,57 74,46 60,52 67,42 57,48 61,40 54,45 60,36 59,29 48,38 52,30 47,32 50,25 50,25 50,25"/>
|
||||
<polyline verts=" 147,34 152,41 155,49 161,53 157,47 164,47 158,43 168,44 159,40 164,37 169,37 164,33 169,34 165,28 170,30 170,25 173,29 175,27 176,32 173,36 175,39 172,42 172,46 168,49 170,55 162,57 158,63 155,58 153,50 149,46 147,34 147,34 147,34"/>
|
||||
<polyline verts=" 155,71 159,80 157,93 157,102 155,108 150,101 149,93 154,101 152,91 151,83 155,79 155,71 155,71 155,71"/>
|
||||
<polyline verts=" 112,78 115,81 114,91 112,87 113,82 112,78 112,78 112,78"/>
|
||||
<polyline verts=" 78,28 64,17 58,11 47,9 36,10 28,16 21,26 18,41 20,51 23,61 33,65 28,68 37,74 36,81 43,87 48,90 43,100 40,98 39,90 31,80 30,72 22,71 17,61 14,46 16,28 23,17 33,9 45,6 54,6 65,12 78,28 78,28 78,28"/>
|
||||
<polyline verts=" 67,18 76,9 87,5 101,2 118,3 135,8 149,20 149,26 144,19 132,12 121,9 105,7 89,8 76,14 70,20 67,18 67,18 67,18"/>
|
||||
<polyline verts=" 56,98 48,106 56,103 47,112 56,110 52,115 57,113 52,121 62,115 58,123 65,119 63,125 69,121 68,127 74,125 74,129 79,128 83,132 94,135 93,129 85,127 81,122 76,126 75,121 71,124 71,117 66,121 66,117 62,117 64,112 60,113 60,110 57,111 61,105 57,107 60,101 55,102 56,98 56,98 56,98"/>
|
||||
<polyline verts=" 101,132 103,138 106,134 106,139 112,136 111,142 115,139 114,143 119,142 125,145 131,142 135,138 140,134 140,129 143,135 145,149 150,171 149,184 145,165 141,150 136,147 132,151 131,149 126,152 125,150 121,152 117,148 111,152 110,148 105,149 104,145 98,150 96,138 94,132 94,130 98,132 101,132 101,132 101,132"/>
|
||||
<polyline verts=" 41,94 32,110 23,132 12,163 6,190 7,217 5,236 3,247 9,230 12,211 12,185 18,160 26,134 35,110 43,99 41,94 41,94 41,94"/>
|
||||
<polyline verts=" 32,246 41,250 50,257 52,267 53,295 53,323 59,350 54,363 51,365 44,366 42,360 40,372 54,372 59,366 62,353 71,352 75,335 73,330 66,318 68,302 64,294 67,288 63,286 63,279 59,275 58,267 56,262 50,247 42,235 44,246 32,236 35,244 32,246 32,246 32,246"/>
|
||||
<polyline verts=" 134,324 146,320 159,322 173,327 179,337 179,349 172,355 158,357 170,350 174,343 170,333 163,328 152,326 134,329 134,324 134,324 134,324"/>
|
||||
<polyline verts=" 173,339 183,334 184,338 191,329 194,332 199,323 202,325 206,318 209,320 213,309 221,303 228,296 232,289 234,279 233,269 230,262 225,256 219,253 208,252 198,252 210,249 223,250 232,257 237,265 238,277 238,291 232,305 221,323 218,335 212,342 200,349 178,348 173,339 173,339 173,339"/>
|
||||
<polyline verts=" 165,296 158,301 156,310 156,323 162,324 159,318 162,308 162,304 165,296 165,296 165,296"/>
|
||||
<polyline verts=" 99,252 105,244 107,234 115,228 121,228 131,235 122,233 113,235 109,246 121,239 133,243 121,243 110,251 99,252 99,252 99,252"/>
|
||||
<polyline verts=" 117,252 124,247 134,249 136,253 126,252 117,252 117,252 117,252"/>
|
||||
<polyline verts=" 117,218 132,224 144,233 140,225 132,219 117,218 117,218 117,218"/>
|
||||
<polyline verts=" 122,212 134,214 143,221 141,213 132,210 122,212 122,212 122,212"/>
|
||||
<polyline verts=" 69,352 70,363 76,373 86,378 97,379 108,379 120,377 128,378 132,373 135,361 133,358 132,366 127,375 121,374 121,362 119,367 117,374 110,376 110,362 107,357 106,371 104,375 97,376 90,375 90,368 86,362 83,364 86,369 85,373 78,370 73,362 71,351 69,352 69,352 69,352"/>
|
||||
<polyline verts=" 100,360 96,363 99,369 102,364 100,360 100,360 100,360"/>
|
||||
<polyline verts=" 115,360 112,363 114,369 117,364 115,360 115,360 115,360"/>
|
||||
<polyline verts=" 127,362 125,364 126,369 128,365 127,362 127,362 127,362"/>
|
||||
<polyline verts=" 5,255 7,276 11,304 15,320 13,334 6,348 2,353 0,363 5,372 12,374 25,372 38,372 44,369 42,367 36,368 31,369 30,360 27,368 20,370 16,361 15,368 10,369 3,366 3,359 6,352 11,348 17,331 19,316 12,291 9,274 5,255 5,255 5,255"/>
|
||||
<polyline verts=" 10,358 7,362 10,366 11,362 10,358 10,358 10,358"/>
|
||||
<polyline verts=" 25,357 22,360 24,366 27,360 25,357 25,357 25,357"/>
|
||||
<polyline verts=" 37,357 34,361 36,365 38,361 37,357 37,357 37,357"/>
|
||||
<polyline verts=" 49,356 46,359 47,364 50,360 49,356 49,356 49,356"/>
|
||||
<polyline verts=" 130,101 132,102 135,101 139,102 143,103 142,101 137,100 133,100 130,101 130,101 130,101"/>
|
||||
<polyline verts=" 106,48 105,52 108,56 109,52 106,48 106,48 106,48"/>
|
||||
<polyline verts=" 139,52 139,56 140,60 142,58 141,56 139,52 139,52 139,52"/>
|
||||
<polyline verts=" 25,349 29,351 30,355 33,350 37,348 42,351 45,347 49,345 44,343 36,345 25,349 25,349 25,349"/>
|
||||
<polyline verts=" 98,347 105,351 107,354 109,349 115,349 120,353 118,349 113,346 104,346 98,347 98,347 98,347"/>
|
||||
<polyline verts=" 83,348 87,352 87,357 89,351 87,348 83,348 83,348 83,348"/>
|
||||
<polyline verts=" 155,107 163,107 170,107 186,108 175,109 155,109 155,107 155,107 155,107"/>
|
||||
<polyline verts=" 153,114 162,113 175,112 192,114 173,114 154,115 153,114 153,114 153,114"/>
|
||||
<polyline verts=" 152,118 164,120 180,123 197,129 169,123 151,120 152,118 152,118 152,118"/>
|
||||
<polyline verts=" 68,109 87,106 107,106 106,108 88,108 68,109 68,109 68,109"/>
|
||||
<polyline verts=" 105,111 95,112 79,114 71,116 85,115 102,113 105,111 105,111 105,111"/>
|
||||
<polyline verts=" 108,101 98,99 87,99 78,99 93,100 105,102 108,101 108,101 108,101"/>
|
||||
<polyline verts=" 85,63 91,63 97,60 104,60 108,62 111,69 112,75 110,74 108,71 103,73 106,69 105,65 103,64 103,67 102,70 99,70 97,66 94,67 97,72 88,67 84,66 85,63 85,63 85,63"/>
|
||||
<polyline verts=" 140,74 141,66 144,61 150,61 156,62 153,70 150,73 152,65 150,65 151,68 149,71 146,71 144,66 143,70 143,74 140,74 140,74 140,74"/>
|
||||
<polyline verts=" 146,20 156,11 163,9 172,9 178,14 182,18 184,32 182,42 182,52 177,58 176,67 171,76 165,90 157,105 160,92 164,85 168,78 167,73 173,66 172,62 175,59 174,55 177,53 180,46 181,29 179,21 173,13 166,11 159,13 153,18 148,23 146,20 146,20 146,20"/>
|
||||
<polyline verts=" 150,187 148,211 150,233 153,247 148,267 135,283 125,299 136,292 131,313 122,328 122,345 129,352 133,359 133,367 137,359 148,356 140,350 131,347 129,340 132,332 140,328 137,322 140,304 154,265 157,244 155,223 161,220 175,229 186,247 185,260 176,275 178,287 185,277 188,261 196,253 189,236 174,213 150,187 150,187 150,187"/>
|
||||
<polyline verts=" 147,338 142,341 143,345 141,354 147,343 147,338 147,338 147,338"/>
|
||||
<polyline verts=" 157,342 156,349 150,356 157,353 163,346 162,342 157,342 157,342 157,342"/>
|
||||
<polyline verts=" 99,265 96,284 92,299 73,339 73,333 87,300 99,265 99,265 99,265"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 20 KiB |
@ -1,22 +1,22 @@
|
||||
<?xml version="1.0" standalone="yes"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
|
||||
<svg width="" height="">
|
||||
<g style="">
|
||||
<path d=""/>
|
||||
<path d=""/>
|
||||
<svg width="268px" height="207px">
|
||||
<g style="stroke: #000000">
|
||||
<path d=" M 29 28 "/>
|
||||
<path d=" L 19 74 "/>
|
||||
</g>
|
||||
<g style="">
|
||||
<polyline verts=""/>
|
||||
<g style="stroke: #800040">
|
||||
<polyline verts=" 32,100 72,50 90,82 73,16 120,64 152,9 177,107"/>
|
||||
</g>
|
||||
<g style=""/>
|
||||
<g style="">
|
||||
<rect x="" y="" width="" height=""/>
|
||||
<g style="stroke: #000000"/>
|
||||
<g style="stroke: #0000ff">
|
||||
<rect x="30" y="101" width="51" height="33"/>
|
||||
</g>
|
||||
<g style="">
|
||||
<ellipse cx="" cy="" major="" minor="" angle=""/>
|
||||
<g style="fill: #0000ff">
|
||||
<ellipse cx="182" cy="127" major="37" minor="31" angle="90"/>
|
||||
</g>
|
||||
<g style="">
|
||||
<polyline verts=""/>
|
||||
<g style="fill: #ff0000">
|
||||
<polyline verts=" 78,180 76,151 131,149 136,182 135,182 134,183 127,185 117,186 109,192 104,194 98,199 96,200 95,201 94,202 92,202 85,202 70,200 54,199 47,198 46,197 45,197 37,195 26,193 17,187 9,181 8,181 7,176 6,175 6,173 6,172 6,170 8,164 8,163 8,162 9,162 10,162 11,162 13,162 20,162 26,162 27,162 28,162 30,162 30,163 31,163 32,164 34,166 35,166 36,167 36,168 37,169 38,169 39,169 41,170 43,170 45,170 47,170 49,170 50,168 50,161 50,160 50,159 47,162 78,180"/>
|
||||
<g>
|
||||
<desc> Java Font definition:Dialog 0</desc>
|
||||
</g>
|
||||
@ -24,10 +24,10 @@
|
||||
<desc> Java Font definition:Helvetica 0</desc>
|
||||
</g>
|
||||
</g>
|
||||
<g style="">
|
||||
<text x="" y="">this is text</text>
|
||||
<g style="stroke: #000000">
|
||||
<text x="188" y="36">this is text</text>
|
||||
</g>
|
||||
<g style="">
|
||||
<g style="stroke: #000000">
|
||||
<g>
|
||||
<desc> Java Font definition:Dialog 0</desc>
|
||||
</g>
|
||||
@ -35,15 +35,15 @@
|
||||
<desc> Java Font definition:Helvetica 700</desc>
|
||||
</g>
|
||||
</g>
|
||||
<g style="">
|
||||
<text x="" y="">sadfsadfsad</text>
|
||||
<g style="stroke: #008080">
|
||||
<text x="176" y="85">sadfsadfsad</text>
|
||||
</g>
|
||||
<g style=""/>
|
||||
<g style="">
|
||||
<ellipse cx="" cy="" major="" minor="" angle=""/>
|
||||
<g style="stroke: #000000"/>
|
||||
<g style="fill: #800040">
|
||||
<ellipse cx="208" cy="180" major="45" minor="31" angle="0"/>
|
||||
</g>
|
||||
<g style=""/>
|
||||
<g style="">
|
||||
<g style="stroke: #000000"/>
|
||||
<g style="fill: #ffffff">
|
||||
<g>
|
||||
<desc> Java Font definition:Dialog 700</desc>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.9 KiB |
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 98 KiB |
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE test [
|
||||
<!ENTITY example "<p>An ampersand (&#38;) may be escaped
|
||||
numerically (&#38;#38;) or with a general entity
|
||||
(&amp;).</p>">
|
||||
]>
|
||||
<test>
|
||||
<p>An ampersand (&) may be escaped
|
||||
numerically (&#38;) or with a general entity
|
||||
(&amp;amp;).</p>
|
||||
</test>
|
@ -29,6 +29,15 @@
|
||||
<!ENTITY doc.distribution "may be distributed freely, as long as
|
||||
all text and legal notices remain intact">
|
||||
]>
|
||||
<!-- LAST TOUCHED BY: Tim Bray, 8 February 1997 -->
|
||||
<!-- The words 'FINAL EDIT' in comments mark places where changes
|
||||
need to be made after approval of the document by the ERB, before
|
||||
publication. -->
|
||||
<!-- —, but nsgmls doesn't grok hex -->
|
||||
<!-- <!ENTITY nbsp " "> -->
|
||||
<!-- audience and distribution status: for use at publication time -->
|
||||
<!-- for Panorama *-->
|
||||
<?VERBATIM "eg" ?>
|
||||
<spec>
|
||||
<header>
|
||||
<title>Extensible Markup Language (XML) 1.0</title>
|
||||
@ -69,7 +78,8 @@ http://www.w3.org/TR/WD-xml-lang-970630</loc>
|
||||
<loc href='http://www.w3.org/TR/WD-xml-970807'>
|
||||
http://www.w3.org/TR/WD-xml-970807</loc>
|
||||
<loc href='http://www.w3.org/TR/WD-xml-971117'>
|
||||
http://www.w3.org/TR/WD-xml-971117</loc>--> </prevlocs>
|
||||
http://www.w3.org/TR/WD-xml-971117</loc>-->
|
||||
</prevlocs>
|
||||
<authlist>
|
||||
<author>
|
||||
<name>Tim Bray</name>
|
||||
@ -473,6 +483,7 @@ and construct computer programs to process it.</p>
|
||||
<p>This version of the XML specification
|
||||
|
||||
<!-- is for &doc.audience;.-->
|
||||
|
||||
&doc.distribution;. </p>
|
||||
</div2>
|
||||
<div2 id="sec-terminology">
|
||||
@ -501,6 +512,7 @@ are required to behave as described; otherwise they are in error.
|
||||
|
||||
<!-- do NOT change this! this is what defines a violation of
|
||||
a 'must' clause as 'an error'. -MSM -->
|
||||
|
||||
</p>
|
||||
</def>
|
||||
</gitem>
|
||||
@ -625,7 +637,8 @@ processors which predate the
|
||||
</p>
|
||||
</div2>
|
||||
</div1>
|
||||
<!-- &Docs; --> <div1 id="sec-documents">
|
||||
<!-- &Docs; -->
|
||||
<div1 id="sec-documents">
|
||||
<head>Documents</head>
|
||||
<p>
|
||||
<termdef id="dt-xml-doc" term="XML Document">
|
||||
@ -721,7 +734,8 @@ matching the grammar, and that means by definition it's
|
||||
logically redundant. I don't think it's rhetorically
|
||||
redundant or unnecessary, though, so I'm keeping it. It
|
||||
could however use some recasting when the editors are feeling
|
||||
stronger. -MSM *--> <item>
|
||||
stronger. -MSM *-->
|
||||
<item>
|
||||
<p>
|
||||
<termdef id="dt-root" term="Root Element">There is exactly
|
||||
one element, called the
|
||||
@ -816,7 +830,8 @@ discussed later, in
|
||||
10646 character set may be referred to by the decimal or hexadecimal
|
||||
equivalent of its
|
||||
UCS-4 code value.
|
||||
</p>--> </div2>
|
||||
</p>-->
|
||||
</div2>
|
||||
<div2 id="sec-common-syn">
|
||||
<head>Common Syntactic Constructs</head>
|
||||
<p>This section defines some symbols used widely in the grammar.</p>
|
||||
@ -1060,6 +1075,7 @@ value</termref>
|
||||
<specref ref="wf-entities"/>
|
||||
.
|
||||
<!-- FINAL EDIT: restore internal entity decl or leave it out. -->
|
||||
|
||||
If they are needed elsewhere,
|
||||
they must be <termref def="dt-escape">escaped</termref>
|
||||
|
||||
@ -1634,6 +1650,7 @@ example:
|
||||
If both the external and internal subsets are used, the
|
||||
internal subset is considered to occur before the external subset.
|
||||
<!-- 'is considered to'? boo. whazzat mean? -->
|
||||
|
||||
This has the effect that entity and attribute-list declarations in the
|
||||
internal subset take precedence over those in the external subset.
|
||||
</p>
|
||||
@ -1957,7 +1974,8 @@ are case insensitive.</p>
|
||||
<!--<p>The xml:lang value is considered to apply both to the contents of an
|
||||
element and
|
||||
(unless otherwise via attribute default values) to the
|
||||
values of all of its attributes with free-text (CDATA) values. --> <p>The intent declared with
|
||||
values of all of its attributes with free-text (CDATA) values. -->
|
||||
<p>The intent declared with
|
||||
<kw>xml:lang</kw>
|
||||
is considered to apply to
|
||||
all attributes and content of the element where it is specified,
|
||||
@ -1978,7 +1996,8 @@ value for xml:lang:
|
||||
|
||||
The application, not the XML processor, is responsible for this '
|
||||
inheritance' of attribute values.
|
||||
--> <p>A simple declaration for
|
||||
-->
|
||||
<p>A simple declaration for
|
||||
<kw>xml:lang</kw>
|
||||
might take
|
||||
the form
|
||||
@ -1995,7 +2014,8 @@ notes in English, the xml:lang attribute might be declared this way:
|
||||
</p>
|
||||
</div2>
|
||||
</div1>
|
||||
<!-- &Elements; --> <div1 id="sec-logical-struct">
|
||||
<!-- &Elements; -->
|
||||
<div1 id="sec-logical-struct">
|
||||
<head>Logical Structures</head>
|
||||
<p>
|
||||
<termdef id="dt-element" term="Element">Each
|
||||
@ -2512,7 +2532,9 @@ match more than one occurrence of an element type in the content model.
|
||||
For more information, see <specref ref="determinism"/>
|
||||
.
|
||||
<!-- appendix <specref ref="determinism"/>. -->
|
||||
|
||||
<!-- appendix on deterministic content models. -->
|
||||
|
||||
</p>
|
||||
<vcnote id="vc-PEinGroup">
|
||||
<head>Proper Group/PE Nesting</head>
|
||||
@ -2849,7 +2871,8 @@ match <termref def="NT-Nmtokens">Nmtokens</termref>
|
||||
<!-- why?
|
||||
<p>The XML processor must normalize attribute values before
|
||||
passing them to the application, as described in
|
||||
<specref ref="AVNormalize"/>.</p>--> <p>
|
||||
<specref ref="AVNormalize"/>.</p>-->
|
||||
<p>
|
||||
<termdef id="dt-enumerated" term="Enumerated Attribute
|
||||
Values">
|
||||
<term>Enumerated attributes</term>
|
||||
@ -2986,6 +3009,7 @@ from an element of this type,
|
||||
the XML processor must inform the application
|
||||
that no value was specified; no constraint is placed on the behavior
|
||||
of the application. -->
|
||||
|
||||
<termdef id="dt-default" term="Attribute Default">If the
|
||||
declaration
|
||||
is neither
|
||||
@ -3213,8 +3237,10 @@ values are specified.
|
||||
</ulist>
|
||||
</p>
|
||||
</div2>
|
||||
--> </div1>
|
||||
<!-- &Entities; --> <div1 id="sec-physical-struct">
|
||||
-->
|
||||
</div1>
|
||||
<!-- &Entities; -->
|
||||
<div1 id="sec-physical-struct">
|
||||
<head>Physical Structures</head>
|
||||
<p>
|
||||
<termdef id="dt-entity" term="Entity">An XML document may consist
|
||||
@ -3435,7 +3461,8 @@ Similarly, the declaration of a general entity must precede any
|
||||
reference to it which appears in a default value in an attribute-list
|
||||
declaration. </p>
|
||||
</vcnote>
|
||||
<!-- FINAL EDIT: is this duplication too clumsy? --> <wfcnote id="textent">
|
||||
<!-- FINAL EDIT: is this duplication too clumsy? -->
|
||||
<wfcnote id="textent">
|
||||
<head>Parsed Entity</head>
|
||||
<p>
|
||||
An entity reference must not contain the name of an
|
||||
@ -3494,9 +3521,11 @@ Entities are declared thus:
|
||||
<rhs>
|
||||
<nt def="NT-GEDecl">GEDecl</nt>
|
||||
<!--</rhs><com>General entities</com>
|
||||
<rhs>--> | <nt def="NT-PEDecl">PEDecl</nt>
|
||||
<rhs>-->
|
||||
| <nt def="NT-PEDecl">PEDecl</nt>
|
||||
</rhs>
|
||||
<!--<com>Parameter entities</com>--> </prod>
|
||||
<!--<com>Parameter entities</com>-->
|
||||
</prod>
|
||||
<prod id="NT-GEDecl">
|
||||
<lhs>GEDecl</lhs>
|
||||
<rhs>'<!ENTITY'
|
||||
@ -3521,19 +3550,23 @@ Entities are declared thus:
|
||||
<nt def="NT-PEDef">PEDef</nt>
|
||||
<nt def="NT-S">S</nt>
|
||||
? '>' </rhs>
|
||||
<!--<com>Parameter entities</com>--> </prod>
|
||||
<!--<com>Parameter entities</com>-->
|
||||
</prod>
|
||||
<prod id="NT-EntityDef">
|
||||
<lhs>EntityDef</lhs>
|
||||
<rhs>
|
||||
<nt def="NT-EntityValue">EntityValue</nt>
|
||||
|
||||
<!--</rhs>
|
||||
<rhs>-->| ( <nt def="NT-ExternalID">ExternalID</nt>
|
||||
<rhs>-->
|
||||
| ( <nt def="NT-ExternalID">ExternalID</nt>
|
||||
|
||||
<nt def="NT-NDataDecl">NDataDecl</nt>
|
||||
?) </rhs>
|
||||
<!-- <nt def='NT-ExternalDef'>ExternalDef</nt></rhs> --> </prod>
|
||||
<!-- FINAL EDIT: what happened to WFs here? --> <prod id="NT-PEDef">
|
||||
<!-- <nt def='NT-ExternalDef'>ExternalDef</nt></rhs> -->
|
||||
</prod>
|
||||
<!-- FINAL EDIT: what happened to WFs here? -->
|
||||
<prod id="NT-PEDef">
|
||||
<lhs>PEDef</lhs>
|
||||
<rhs>
|
||||
<nt def="NT-EntityValue">EntityValue</nt>
|
||||
@ -3601,7 +3634,8 @@ entity</term>
|
||||
<head>External Entity Declaration</head>
|
||||
<!--
|
||||
<prod id='NT-ExternalDef'><lhs>ExternalDef</lhs>
|
||||
<rhs></prod> --> <prod id="NT-ExternalID">
|
||||
<rhs></prod> -->
|
||||
<prod id="NT-ExternalID">
|
||||
<lhs>ExternalID</lhs>
|
||||
<rhs>'SYSTEM'
|
||||
<nt def="NT-S">S</nt>
|
||||
@ -3850,7 +3884,8 @@ declaration is part of the <termref def="dt-xmldecl">XML declaration
|
||||
The <nt def="NT-EncName">EncName</nt>
|
||||
is the name of the encoding used.
|
||||
</p>
|
||||
<!-- FINAL EDIT: check name of IANA and charset names --> <p>In an encoding declaration, the values
|
||||
<!-- FINAL EDIT: check name of IANA and charset names -->
|
||||
<p>In an encoding declaration, the values
|
||||
"
|
||||
<code>UTF-8</code>
|
||||
",
|
||||
@ -4470,7 +4505,8 @@ well appear on a processor input stream
|
||||
without any identification at all. </p>
|
||||
</div2>
|
||||
</div1>
|
||||
<!-- &Conformance; --> <div1 id="sec-conformance">
|
||||
<!-- &Conformance; -->
|
||||
<div1 id="sec-conformance">
|
||||
<head>Conformance</head>
|
||||
<div2 id="proc-types">
|
||||
<head>Validating and Non-Validating Processors</head>
|
||||
@ -4816,7 +4852,9 @@ a production. </p>
|
||||
</div1>
|
||||
</body>
|
||||
<back>
|
||||
<!-- &SGML; --><!-- &Biblio; --> <div1 id="sec-bibliography">
|
||||
<!-- &SGML; -->
|
||||
<!-- &Biblio; -->
|
||||
<div1 id="sec-bibliography">
|
||||
<head>References</head>
|
||||
<div2 id="sec-existing-stds">
|
||||
<head>Normative References</head>
|
||||
@ -4881,7 +4919,7 @@ Ravi Sethi, and Jeffrey D. Ullman.
|
||||
<emph>Compilers: Principles, Techniques, and Tools</emph>
|
||||
.
|
||||
Reading: Addison-Wesley, 1986, rpt. corr. 1988. </bibl>
|
||||
<bibl id="Berners-Lee" xml-link="simple" key="Berners-Lee et al.">
|
||||
<bibl xml-link="simple" id="Berners-Lee" key="Berners-Lee et al.">
|
||||
Berners-Lee, T., R. Fielding, and L. Masinter.
|
||||
|
||||
<emph>Uniform Resource Identifiers (URI): Generic Syntax and
|
||||
@ -4912,7 +4950,7 @@ Comparison of SGML and XML. See
|
||||
<loc href="http://www.w3.org/TR/NOTE-sgml-xml-971215">http://www.w3.org/TR/NOTE-sgml-xml-971215</loc>
|
||||
.
|
||||
</bibl>
|
||||
<bibl id="RFC1738" xml-link="simple" key="IETF RFC1738">
|
||||
<bibl xml-link="simple" id="RFC1738" key="IETF RFC1738">
|
||||
IETF (Internet Engineering Task Force).
|
||||
|
||||
<emph>RFC 1738: Uniform Resource Locators (URL)</emph>
|
||||
@ -4920,7 +4958,7 @@ IETF (Internet Engineering Task Force).
|
||||
ed. T. Berners-Lee, L. Masinter, M. McCahill.
|
||||
1994.
|
||||
</bibl>
|
||||
<bibl id="RFC1808" xml-link="simple" key="IETF RFC1808">
|
||||
<bibl xml-link="simple" id="RFC1808" key="IETF RFC1808">
|
||||
IETF (Internet Engineering Task Force).
|
||||
|
||||
<emph>RFC 1808: Relative Uniform Resource Locators</emph>
|
||||
@ -4928,7 +4966,7 @@ IETF (Internet Engineering Task Force).
|
||||
ed. R. Fielding.
|
||||
1995.
|
||||
</bibl>
|
||||
<bibl id="RFC2141" xml-link="simple" key="IETF RFC2141">
|
||||
<bibl xml-link="simple" id="RFC2141" key="IETF RFC2141">
|
||||
IETF (Internet Engineering Task Force).
|
||||
|
||||
<emph>RFC 2141: URN Syntax</emph>
|
||||
@ -5519,7 +5557,8 @@ recognized, and it is expanded, so the full content of the
|
||||
required
|
||||
that content models in element type declarations be deterministic.
|
||||
</p>
|
||||
<!-- FINAL EDIT: WebSGML allows ambiguity? --> <p>SGML
|
||||
<!-- FINAL EDIT: WebSGML allows ambiguity? -->
|
||||
<p>SGML
|
||||
requires deterministic content models (it calls them
|
||||
"unambiguous"); XML processors built using SGML systems may
|
||||
flag non-deterministic content models as errors.</p>
|
||||
@ -5824,3 +5863,11 @@ Co-editor</role>
|
||||
</inform-div1>
|
||||
</back>
|
||||
</spec>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-default-dtd-file:"~/sgml/spec.ced"
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
End:
|
||||
-->
|
||||
|
@ -3,12 +3,20 @@
|
||||
<!ENTITY doc-type "WD">
|
||||
<!ENTITY iso6.doc.date "29-May-1999">
|
||||
]>
|
||||
<!--ArborText, Inc., 1988-1998, v.4002-->
|
||||
<?Pub UDT _bookmark _target?>
|
||||
<?Pub Inc?>
|
||||
<?xml-stylesheet href="file:///C|/Program%20Files/SoftQuad/XMetaL%201/display/xmlspec.css"
|
||||
type="text/css"?>
|
||||
<spec>
|
||||
<!-- Last edited: 27 May 1999 by bent --> <header>
|
||||
<!-- Last edited: 27 May 1999 by bent -->
|
||||
<header>
|
||||
<?Pub Dtl?>
|
||||
<title>XML Linking Language (XLink)</title>
|
||||
<version>Version 1.0</version>
|
||||
<w3c-designation>
|
||||
<!-- &doc-type;-&iso6.doc.date; --> WD-xlink-19990527 </w3c-designation>
|
||||
<!-- &doc-type;-&iso6.doc.date; -->
|
||||
WD-xlink-19990527 </w3c-designation>
|
||||
<w3c-doctype>World Wide Web Consortium Working Draft</w3c-doctype>
|
||||
<pubdate>
|
||||
<day>29</day>
|
||||
@ -22,13 +30,16 @@
|
||||
<loc href="http://www.w3.org/XML/Group/1999/05/WD-xlink-current">http://www.w3.org/XML/Group/1999/05/WD-xlink-current</loc>
|
||||
</publoc>
|
||||
<prevlocs>
|
||||
<!--Check: was it actually August?--> <loc href="http://www.w3.org/XML/Group/1999/05/WD-xlink-19990527">http://www.w3.org/XML/Group/1999/05/WD-xlink-19990527</loc>
|
||||
<!--Check: was it actually August?-->
|
||||
<loc href="http://www.w3.org/XML/Group/1999/05/WD-xlink-19990527">http://www.w3.org/XML/Group/1999/05/WD-xlink-19990527</loc>
|
||||
<loc href="http://www.w3.org/XML/Group/1999/05/WD-xlink-19990505">http://www.w3.org/XML/Group/1999/05/WD-xlink-19990505</loc>
|
||||
<loc href="http://www.w3.org/TR/1998/WD-xlink-19980303">http://www.w3.org/TR/1998/WD-xlink-19980303</loc>
|
||||
<loc href="http://www.w3.org/TR/WD-xml-link-970630">http://www.w3.org/TR/WD-xml-link-970630</loc>
|
||||
</prevlocs>
|
||||
<authlist>
|
||||
<!--Updated author hrefs dorchard--><!-- Update Steve's email - bent --> <author>
|
||||
<!--Updated author hrefs dorchard-->
|
||||
<!-- Update Steve's email - bent -->
|
||||
<author>
|
||||
<name>Steve DeRose</name>
|
||||
<affiliation>Inso Corp. and Brown University</affiliation>
|
||||
<email href="mailto:Steven_DeRose@Brown.edu">Steven_DeRose@Brown.edu</email>
|
||||
@ -47,7 +58,8 @@
|
||||
also ought to add Gabe Beged-Dov there, as well. bent
|
||||
how shall we cite Tim? sjd What about with an Acknowledgments section?
|
||||
-elm <AUTHOR> <NAME>Tim Bray</NAME> <AFFILIATION>Textuality</AFFILIATION>
|
||||
<EMAIL>tbray@textuality.com</EMAIL> </AUTHOR>--> </authlist>
|
||||
<EMAIL>tbray@textuality.com</EMAIL> </AUTHOR>-->
|
||||
</authlist>
|
||||
<status>
|
||||
<p>This is a W3C Working Draft for review by W3C members and other interested parties. It is a draft document and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use W3C Working Drafts as reference material or to cite them as other than "work in progress". A list of current W3C working drafts can be found at
|
||||
<loc href="http://www.w3.org/TR">http://www.w3.org/TR</loc>
|
||||
@ -69,7 +81,8 @@
|
||||
for the XLink requirements that this document attempts to satisfy. </p>
|
||||
</status>
|
||||
<abstract>
|
||||
<!-- edited the abstract for further clarity - bent --> <p>This specification defines constructs that may be inserted into XML DTDs, schemas and document instances to describe links between objects. It uses XML syntax to create structures that can describe the simple unidirectional hyperlinks of today's HTML as well as more sophisticated links.</p>
|
||||
<!-- edited the abstract for further clarity - bent -->
|
||||
<p>This specification defines constructs that may be inserted into XML DTDs, schemas and document instances to describe links between objects. It uses XML syntax to create structures that can describe the simple unidirectional hyperlinks of today's HTML as well as more sophisticated links.</p>
|
||||
</abstract>
|
||||
<pubstmt>
|
||||
<p>Burlington, Seekonk, et al.: World-Wide Web Consortium, XML Working Group, 1998.</p>
|
||||
@ -106,6 +119,7 @@
|
||||
</header>
|
||||
<body>
|
||||
<div1>
|
||||
<?Pub Dtl?>
|
||||
<head>Introduction</head>
|
||||
<p>This specification defines constructs that may be inserted into XML DTDs, schemas, and document instances to describe links between objects. A
|
||||
<termref def="dt-link">link</termref>
|
||||
@ -178,7 +192,8 @@
|
||||
</p>
|
||||
</div2>
|
||||
<!--Changed the list of requirements to reflect current XLink requirements
|
||||
document. bent--> <div2>
|
||||
document. bent-->
|
||||
<div2>
|
||||
<head>Relationship to Existing Standards</head>
|
||||
<p>Three standards have been especially influential:
|
||||
|
||||
@ -192,6 +207,7 @@ document. bent--> <div2>
|
||||
<p>
|
||||
<emph>HyTime:</emph>
|
||||
Defines inline and out-of-line link structures and some semantic features, including traversal control and presentation of objects. <!--Changed from "placement of objects into a display or other space" -elm-->
|
||||
|
||||
</p>
|
||||
</item>
|
||||
<item>
|
||||
@ -209,6 +225,7 @@ document. bent--> <div2>
|
||||
<p>The following basic terms apply in this document.
|
||||
<!--<IMG
|
||||
SRC="local://./linkdiag.gif">(figure to be inserted)-->
|
||||
|
||||
<glist>
|
||||
<gitem>
|
||||
<label>
|
||||
@ -348,6 +365,7 @@ linking element. Note that the content of the linking element could be explicitl
|
||||
. Examples include files, images, documents, programs, and query results. Concretely, anything reachable by the use of a <termref def="dt-locator">locator</termref>
|
||||
in some <termref def="dt-linkel">linking element</termref>
|
||||
. Note that this term and its definition are taken from the basic specifications governing the World Wide Web. <!--Joel notes: need link here. bent asks: A link?-->
|
||||
|
||||
</p>
|
||||
</def>
|
||||
</gitem>
|
||||
@ -381,14 +399,17 @@ linking element. Note that the content of the linking element could be explicitl
|
||||
<termref def="dt-locator">locators</termref>
|
||||
is given using a simple Extended Backus-Naur Form (EBNF) location, as described in <xspecref href="http://www.w3.org/TR/REC-xml#sec-notation">the XML specification</xspecref>
|
||||
. </p>
|
||||
<!-- fixed link to XML spec - bent --> </div2>
|
||||
<!-- fixed link to XML spec - bent -->
|
||||
</div2>
|
||||
</div1>
|
||||
<div1 id="addressing">
|
||||
<?Pub Dtl?>
|
||||
<head>Locator Syntax</head>
|
||||
<p>The locator for a
|
||||
<termref def="dt-resource">resource</termref>
|
||||
is typically provided by means of a Uniform Resource Identifier, or URI. XPointers can be used in conjunction with the URI structure, as fragment identifiers, to specify a more precise sub-resource. </p>
|
||||
<!-- Removed the discussion of queries from the previous paragraph, due to contention within the WG. bent --> <p>A locator generally contains a URI, as described in IETF RFCs
|
||||
<!-- Removed the discussion of queries from the previous paragraph, due to contention within the WG. bent -->
|
||||
<p>A locator generally contains a URI, as described in IETF RFCs
|
||||
<bibref ref="rfc1738"/>
|
||||
and <bibref ref="rfc1808"/>
|
||||
. As these RFCs state, the URI may include a trailing <emph>query</emph>
|
||||
@ -396,7 +417,8 @@ linking element. Note that the content of the linking element could be explicitl
|
||||
"), and be followed by a " <code>#</code>
|
||||
" and a <emph>fragment identifier</emph>
|
||||
, with the query interpreted by the host providing the indicated resource, and the interpretation of the fragment identifier dependent on the data type of the indicated resource. </p>
|
||||
<!--Is there some restriction on URNs having queries and/or fragment identifiers? Since these RFCs don't mention URIs explicitly, should the wording here lead from URLs to URIs more explicitly? -elm--> <p>In order to locate XML documents and portions of documents, a locator value may contain either a
|
||||
<!--Is there some restriction on URNs having queries and/or fragment identifiers? Since these RFCs don't mention URIs explicitly, should the wording here lead from URLs to URIs more explicitly? -elm-->
|
||||
<p>In order to locate XML documents and portions of documents, a locator value may contain either a
|
||||
<xtermref href="http://www.w3.org/Addressing/rfc1738.txt"> URI</xtermref>
|
||||
or a fragment identifier, or both. Any fragment identifier for pointing into XML must be an <xtermref href="http://www.w3.org/TR/WD-xptr#dt-xpointer"> XPointer</xtermref>
|
||||
. </p>
|
||||
@ -461,7 +483,8 @@ linking element. Note that the content of the linking element could be explicitl
|
||||
</p>
|
||||
</item>
|
||||
<!--Is this now incorrect, given the nature of the switch from here() to origin()? -elm
|
||||
Oy, yes, i think so. it will require some fun wording, though, so i haven't fixed it yet here -sjd--> <item>
|
||||
Oy, yes, i think so. it will require some fun wording, though, so i haven't fixed it yet here -sjd-->
|
||||
<item>
|
||||
<p>If the
|
||||
<nt def="nt-connector">Connector</nt>
|
||||
is followed directly by a <xnt href="http://www.w3.org/TR/REC-xml#NT-Name">Name</xnt>
|
||||
@ -473,7 +496,8 @@ linking element. Note that the content of the linking element could be explicitl
|
||||
. This shorthand is to encourage use of the robust <code>id</code>
|
||||
addressing mode. </p>
|
||||
</item>
|
||||
<!-- fixed links to the XML recommendation - bent --> <item>
|
||||
<!-- fixed links to the XML recommendation - bent -->
|
||||
<item>
|
||||
<p>If the connector is "
|
||||
<code>#</code>
|
||||
", this signals an intent that the containing resource is to be fetched as a whole from the host that provides it, and that the XPointer processing to extract the sub-resource
|
||||
@ -502,8 +526,10 @@ linking element. Note that the content of the linking element could be explicitl
|
||||
</scrap>
|
||||
|
||||
</p>
|
||||
<!-- fixed link to XML recommendation - bent --> </div1>
|
||||
<!-- fixed link to XML recommendation - bent -->
|
||||
</div1>
|
||||
<div1>
|
||||
<?Pub Dtl?>
|
||||
<head>Link Recognition</head>
|
||||
<p>The existence of a
|
||||
<termref def="dt-link">link</termref>
|
||||
@ -522,8 +548,10 @@ title="The XLink Working Draft">The XLink Working Draft</xlink:s
|
||||
Any arbitrary element can be made into an XLink by using the <code>xlink:type</code>
|
||||
attribute. And, of course, the explicit XLink elements may be used, as well. This document will go on to describe the linking attributes that are associated with linking elements. It may be assumed by the reader that these attributes would require the <code>xlink</code>
|
||||
namespace prefix if they existed within an arbitrary element, or that they may be used directly if they exist within an explicit Xlink element. </p>
|
||||
<!-- heavily modified this section to accomodate namespace-aware link recognition - bent --> </div1>
|
||||
<!-- Rewrote this entire section. - bent --> <div1>
|
||||
<!-- heavily modified this section to accomodate namespace-aware link recognition - bent -->
|
||||
</div1>
|
||||
<!-- Rewrote this entire section. - bent -->
|
||||
<div1>
|
||||
<head>Linking Attributes</head>
|
||||
<p>XLink has several attributes associated with the variety of links it may represent. These attributes define four main concepts: locators, arcs, behaviors, and semantics.
|
||||
<emph>Locators</emph>
|
||||
@ -552,7 +580,8 @@ title="The XLink Working Draft">The XLink Working Draft</xlink:s
|
||||
attribute from the resource being linked to. The purpose of the <code>to</code>
|
||||
attribute is to define where this link traverses to. </p>
|
||||
<p>The application may use this information in a number of ways, especially in a complex hypertext system, but it is mainly useful in providing context for application behavior.</p>
|
||||
<!-- I'm at a loss as to how to describe arcs more clearly than this. I don't want to devolve into discussions of directed graphs and n-ary links. -bent --> </div2>
|
||||
<!-- I'm at a loss as to how to describe arcs more clearly than this. I don't want to devolve into discussions of directed graphs and n-ary links. -bent -->
|
||||
</div2>
|
||||
<div2 id="link-behaviors">
|
||||
<head>Behavior Attributes</head>
|
||||
<p>There are two attributes associated with behavior:
|
||||
@ -574,7 +603,8 @@ title="The XLink Working Draft">The XLink Working Draft</xlink:s
|
||||
option indicates that the link must be initiated by some sort of human-initiated selection, such as clicking on an HTML anchor. The <code>auto</code>
|
||||
option indicates that the link is automatically initiated when the application deems that the user has reached the link. It then follows the behavior set out in the <code>show</code>
|
||||
option. </p>
|
||||
<!-- Something should be put here in terms of an example. Idea: "A" link versus automatically updating encyclopedia. -bent --> </div2>
|
||||
<!-- Something should be put here in terms of an example. Idea: "A" link versus automatically updating encyclopedia. -bent -->
|
||||
</div2>
|
||||
<div2 id="link-semantics">
|
||||
<head>Semantic Attributes</head>
|
||||
<p>There are two attributes associated with semantics,
|
||||
@ -747,7 +777,8 @@ The XLink Working Draft.</foo></eg>
|
||||
<term>arc</term>
|
||||
is contained within an extended link for the purpose of defining traversal behavior. </termdef>
|
||||
More than one arc may be associated with a link. Otherwise, arc elements function exactly as the arc attributes might lead on to expect. </p>
|
||||
<!-- More here? -bent --> </div2>
|
||||
<!-- More here? -bent -->
|
||||
</div2>
|
||||
</div1>
|
||||
<div1>
|
||||
<head>Conformance</head>
|
||||
@ -779,7 +810,8 @@ prescribed.
|
||||
<!--If/when we split out the XLinkfunctionality
|
||||
(e.g. inline links and out-of-line links), the
|
||||
conformance language will have to address the different
|
||||
levels of support. -elm--> </p>
|
||||
levels of support. -elm-->
|
||||
</p>
|
||||
</div1>
|
||||
</body>
|
||||
<back>
|
||||
@ -815,7 +847,8 @@ Annex.</titleref>
|
||||
1996. (See <loc href="http://www.ornl.gov/sgml/wg8/hytime/html/is10744r.html">http://www.ornl.go
|
||||
v/sgml/wg8/hytime/html/is10744r.html </loc>
|
||||
<!--p m-r says this link is
|
||||
broken. elm --> ). </bibl>
|
||||
broken. elm -->
|
||||
). </bibl>
|
||||
<bibl id="rfc1738" key="IETF RFC 1738">IETF (Internet Engineering Task
|
||||
Force).
|
||||
<titleref>
|
||||
@ -838,7 +871,8 @@ Guidelines for Electronic Text Encoding and Interchange</titleref>
|
||||
for Computers and the Humanities (ACH), Association for Computational
|
||||
Linguistics
|
||||
(ACL), and Association for Literary and Linguistic Computing (ALLC). Chicago,
|
||||
Oxford: Text Encoding Initiative, 1994. <!-- add cite to DOM work --> </bibl>
|
||||
Oxford: Text Encoding Initiative, 1994. <!-- add cite to DOM work -->
|
||||
</bibl>
|
||||
<bibl id="chum" key="CHUM">]Steven J. DeRose and David G. Durand. 1995. "The
|
||||
TEI Hypertext Guidelines." In
|
||||
<titleref>Computing and the Humanities
|
||||
@ -847,8 +881,10 @@ TEI Hypertext Guidelines." In
|
||||
Reprinted in <titleref>Text Encoding Initiative: Background and
|
||||
Context</titleref>
|
||||
,
|
||||
ed. Nancy Ide and Jean ronis <!-- fix this name -->, ISBN 0-7923-3704-2. </bibl>
|
||||
ed. Nancy Ide and Jean ronis <!-- fix this name -->
|
||||
, ISBN 0-7923-3704-2. </bibl>
|
||||
</blist>
|
||||
</div1>
|
||||
</back>
|
||||
</spec>
|
||||
<?Pub *0000052575?>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/child::EXAMPLE
|
||||
/child::EXAMPLE/child::*
|
||||
/child::*
|
||||
/child::EXAMPLE/child::head
|
||||
/child::EXAMPLE/child::*
|
||||
/child::EXAMPLE/child::head/child::title
|
||||
|
@ -1,5 +1,5 @@
|
||||
/EXAMPLE
|
||||
/EXAMPLE/chapter
|
||||
/EXAMPLE/head
|
||||
/EXAMPLE/chapter[1]
|
||||
//p
|
||||
//chapter/image
|
||||
|
@ -1,5 +1,5 @@
|
||||
/child::*
|
||||
/child::EXAMPLE
|
||||
/child::EXAMPLE/child::chapter
|
||||
/child::EXAMPLE/child::head
|
||||
/child::EXAMPLE/child::*
|
||||
/child::EXAMPLE/child::head/child::title
|
||||
|
@ -35,7 +35,6 @@ static int copy = 0;
|
||||
|
||||
/*
|
||||
* Note: this is perfectly clean HTML, i.e. not a useful test.
|
||||
*/
|
||||
static CHAR buffer[] =
|
||||
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"\n\
|
||||
\"http://www.w3.org/TR/REC-html40/loose.dtd\">\n\
|
||||
@ -52,6 +51,7 @@ We are doing our best to get it back on-line,\n\
|
||||
</body>\n\
|
||||
</html>\n\
|
||||
";
|
||||
*/
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
|
57
testSAX.c
57
testSAX.c
@ -105,7 +105,7 @@ static CHAR buffer[] =
|
||||
* Returns 1 if true
|
||||
*/
|
||||
int
|
||||
isStandaloneDebug(xmlParserCtxtPtr ctxt)
|
||||
isStandaloneDebug(void *ctx)
|
||||
{
|
||||
fprintf(stdout, "SAX.isStandalone()\n");
|
||||
return(0);
|
||||
@ -120,7 +120,7 @@ isStandaloneDebug(xmlParserCtxtPtr ctxt)
|
||||
* Returns 1 if true
|
||||
*/
|
||||
int
|
||||
hasInternalSubsetDebug(xmlParserCtxtPtr ctxt)
|
||||
hasInternalSubsetDebug(void *ctx)
|
||||
{
|
||||
fprintf(stdout, "SAX.hasInternalSubset()\n");
|
||||
return(0);
|
||||
@ -135,7 +135,7 @@ hasInternalSubsetDebug(xmlParserCtxtPtr ctxt)
|
||||
* Returns 1 if true
|
||||
*/
|
||||
int
|
||||
hasExternalSubsetDebug(xmlParserCtxtPtr ctxt)
|
||||
hasExternalSubsetDebug(void *ctx)
|
||||
{
|
||||
fprintf(stdout, "SAX.hasExternalSubset()\n");
|
||||
return(0);
|
||||
@ -148,7 +148,7 @@ hasExternalSubsetDebug(xmlParserCtxtPtr ctxt)
|
||||
* Does this document has an internal subset
|
||||
*/
|
||||
void
|
||||
internalSubsetDebug(xmlParserCtxtPtr ctxt, const CHAR *name,
|
||||
internalSubsetDebug(void *ctx, const CHAR *name,
|
||||
const CHAR *ExternalID, const CHAR *SystemID)
|
||||
{
|
||||
xmlDtdPtr externalSubset;
|
||||
@ -179,8 +179,10 @@ internalSubsetDebug(xmlParserCtxtPtr ctxt, const CHAR *name,
|
||||
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
|
||||
*/
|
||||
xmlParserInputPtr
|
||||
resolveEntityDebug(xmlParserCtxtPtr ctxt, const CHAR *publicId, const CHAR *systemId)
|
||||
resolveEntityDebug(void *ctx, const CHAR *publicId, const CHAR *systemId)
|
||||
{
|
||||
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
|
||||
|
||||
|
||||
fprintf(stdout, "SAX.resolveEntity(");
|
||||
if (publicId != NULL)
|
||||
@ -192,7 +194,7 @@ resolveEntityDebug(xmlParserCtxtPtr ctxt, const CHAR *publicId, const CHAR *syst
|
||||
else
|
||||
fprintf(stdout, ", )\n");
|
||||
if (systemId != NULL) {
|
||||
return(xmlNewInputFromFile(ctxt, systemId));
|
||||
return(xmlNewInputFromFile(ctxt, (char *) systemId));
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
@ -207,7 +209,7 @@ resolveEntityDebug(xmlParserCtxtPtr ctxt, const CHAR *publicId, const CHAR *syst
|
||||
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
|
||||
*/
|
||||
xmlEntityPtr
|
||||
getEntityDebug(xmlParserCtxtPtr ctxt, const CHAR *name)
|
||||
getEntityDebug(void *ctx, const CHAR *name)
|
||||
{
|
||||
fprintf(stdout, "SAX.getEntity(%s)\n", name);
|
||||
return(NULL);
|
||||
@ -223,7 +225,7 @@ getEntityDebug(xmlParserCtxtPtr ctxt, const CHAR *name)
|
||||
* Returns the xmlParserInputPtr
|
||||
*/
|
||||
xmlEntityPtr
|
||||
getParameterEntityDebug(xmlParserCtxtPtr ctxt, const CHAR *name)
|
||||
getParameterEntityDebug(void *ctx, const CHAR *name)
|
||||
{
|
||||
fprintf(stdout, "SAX.getParameterEntity(%s)\n", name);
|
||||
return(NULL);
|
||||
@ -242,7 +244,7 @@ getParameterEntityDebug(xmlParserCtxtPtr ctxt, const CHAR *name)
|
||||
* An entity definition has been parsed
|
||||
*/
|
||||
void
|
||||
entityDeclDebug(xmlParserCtxtPtr ctxt, const CHAR *name, int type,
|
||||
entityDeclDebug(void *ctx, const CHAR *name, int type,
|
||||
const CHAR *publicId, const CHAR *systemId, CHAR *content)
|
||||
{
|
||||
fprintf(stdout, "SAX.entityDecl(%s, %d, %s, %s, %s)\n",
|
||||
@ -258,7 +260,7 @@ entityDeclDebug(xmlParserCtxtPtr ctxt, const CHAR *name, int type,
|
||||
* An attribute definition has been parsed
|
||||
*/
|
||||
void
|
||||
attributeDeclDebug(xmlParserCtxtPtr ctxt, const CHAR *elem, const CHAR *name,
|
||||
attributeDeclDebug(void *ctx, const CHAR *elem, const CHAR *name,
|
||||
int type, int def, const CHAR *defaultValue,
|
||||
xmlEnumerationPtr tree)
|
||||
{
|
||||
@ -276,7 +278,7 @@ attributeDeclDebug(xmlParserCtxtPtr ctxt, const CHAR *elem, const CHAR *name,
|
||||
* An element definition has been parsed
|
||||
*/
|
||||
void
|
||||
elementDeclDebug(xmlParserCtxtPtr ctxt, const CHAR *name, int type,
|
||||
elementDeclDebug(void *ctx, const CHAR *name, int type,
|
||||
xmlElementContentPtr content)
|
||||
{
|
||||
fprintf(stdout, "SAX.elementDecl(%s, %d, ...)\n",
|
||||
@ -291,10 +293,9 @@ elementDeclDebug(xmlParserCtxtPtr ctxt, const CHAR *name, int type,
|
||||
* @systemId: The system ID of the entity
|
||||
*
|
||||
* What to do when a notation declaration has been parsed.
|
||||
* TODO Not handled currently.
|
||||
*/
|
||||
void
|
||||
notationDeclDebug(xmlParserCtxtPtr ctxt, const CHAR *name,
|
||||
notationDeclDebug(void *ctx, const CHAR *name,
|
||||
const CHAR *publicId, const CHAR *systemId)
|
||||
{
|
||||
fprintf(stdout, "SAX.notationDecl(%s, %s, %s)\n",
|
||||
@ -310,10 +311,9 @@ notationDeclDebug(xmlParserCtxtPtr ctxt, const CHAR *name,
|
||||
* @notationName: the name of the notation
|
||||
*
|
||||
* What to do when an unparsed entity declaration is parsed
|
||||
* TODO Create an Entity node.
|
||||
*/
|
||||
void
|
||||
unparsedEntityDeclDebug(xmlParserCtxtPtr ctxt, const CHAR *name,
|
||||
unparsedEntityDeclDebug(void *ctx, const CHAR *name,
|
||||
const CHAR *publicId, const CHAR *systemId,
|
||||
const CHAR *notationName)
|
||||
{
|
||||
@ -331,7 +331,7 @@ unparsedEntityDeclDebug(xmlParserCtxtPtr ctxt, const CHAR *name,
|
||||
* Everything is available on the context, so this is useless in our case.
|
||||
*/
|
||||
void
|
||||
setDocumentLocatorDebug(xmlParserCtxtPtr ctxt, xmlSAXLocatorPtr loc)
|
||||
setDocumentLocatorDebug(void *ctx, xmlSAXLocatorPtr loc)
|
||||
{
|
||||
fprintf(stdout, "SAX.setDocumentLocator()\n");
|
||||
}
|
||||
@ -343,7 +343,7 @@ setDocumentLocatorDebug(xmlParserCtxtPtr ctxt, xmlSAXLocatorPtr loc)
|
||||
* called when the document start being processed.
|
||||
*/
|
||||
void
|
||||
startDocumentDebug(xmlParserCtxtPtr ctxt)
|
||||
startDocumentDebug(void *ctx)
|
||||
{
|
||||
fprintf(stdout, "SAX.startDocument()\n");
|
||||
}
|
||||
@ -355,7 +355,7 @@ startDocumentDebug(xmlParserCtxtPtr ctxt)
|
||||
* called when the document end has been detected.
|
||||
*/
|
||||
void
|
||||
endDocumentDebug(xmlParserCtxtPtr ctxt)
|
||||
endDocumentDebug(void *ctx)
|
||||
{
|
||||
fprintf(stdout, "SAX.endDocument()\n");
|
||||
}
|
||||
@ -366,10 +366,9 @@ endDocumentDebug(xmlParserCtxtPtr ctxt)
|
||||
* @name: The element name
|
||||
*
|
||||
* called when an opening tag has been processed.
|
||||
* TODO We currently have a small pblm with the arguments ...
|
||||
*/
|
||||
void
|
||||
startElementDebug(xmlParserCtxtPtr ctxt, const CHAR *name, const CHAR **atts)
|
||||
startElementDebug(void *ctx, const CHAR *name, const CHAR **atts)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -391,7 +390,7 @@ startElementDebug(xmlParserCtxtPtr ctxt, const CHAR *name, const CHAR **atts)
|
||||
* called when the end of an element has been detected.
|
||||
*/
|
||||
void
|
||||
endElementDebug(xmlParserCtxtPtr ctxt, const CHAR *name)
|
||||
endElementDebug(void *ctx, const CHAR *name)
|
||||
{
|
||||
fprintf(stdout, "SAX.endElement(%s)\n", (char *) name);
|
||||
}
|
||||
@ -406,7 +405,7 @@ endElementDebug(xmlParserCtxtPtr ctxt, const CHAR *name)
|
||||
* Question: how much at a time ???
|
||||
*/
|
||||
void
|
||||
charactersDebug(xmlParserCtxtPtr ctxt, const CHAR *ch, int len)
|
||||
charactersDebug(void *ctx, const CHAR *ch, int len)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -424,7 +423,7 @@ charactersDebug(xmlParserCtxtPtr ctxt, const CHAR *ch, int len)
|
||||
* called when an entity reference is detected.
|
||||
*/
|
||||
void
|
||||
referenceDebug(xmlParserCtxtPtr ctxt, const CHAR *name)
|
||||
referenceDebug(void *ctx, const CHAR *name)
|
||||
{
|
||||
fprintf(stdout, "SAX.reference(%s)\n", name);
|
||||
}
|
||||
@ -440,7 +439,7 @@ referenceDebug(xmlParserCtxtPtr ctxt, const CHAR *name)
|
||||
* Question: how much at a time ???
|
||||
*/
|
||||
void
|
||||
ignorableWhitespaceDebug(xmlParserCtxtPtr ctxt, const CHAR *ch, int len)
|
||||
ignorableWhitespaceDebug(void *ctx, const CHAR *ch, int len)
|
||||
{
|
||||
fprintf(stdout, "SAX.ignorableWhitespace(%.30s, %d)\n",
|
||||
(char *) ch, len);
|
||||
@ -456,7 +455,7 @@ ignorableWhitespaceDebug(xmlParserCtxtPtr ctxt, const CHAR *ch, int len)
|
||||
* A processing instruction has been parsed.
|
||||
*/
|
||||
void
|
||||
processingInstructionDebug(xmlParserCtxtPtr ctxt, const CHAR *target,
|
||||
processingInstructionDebug(void *ctx, const CHAR *target,
|
||||
const CHAR *data)
|
||||
{
|
||||
fprintf(stdout, "SAX.processingInstruction(%s, %s)\n",
|
||||
@ -471,7 +470,7 @@ processingInstructionDebug(xmlParserCtxtPtr ctxt, const CHAR *target,
|
||||
* A comment has been parsed.
|
||||
*/
|
||||
void
|
||||
commentDebug(xmlParserCtxtPtr ctxt, const CHAR *value)
|
||||
commentDebug(void *ctx, const CHAR *value)
|
||||
{
|
||||
fprintf(stdout, "SAX.comment(%s)\n", value);
|
||||
}
|
||||
@ -486,7 +485,7 @@ commentDebug(xmlParserCtxtPtr ctxt, const CHAR *value)
|
||||
* extra parameters.
|
||||
*/
|
||||
void
|
||||
warningDebug(xmlParserCtxtPtr ctxt, const char *msg, ...)
|
||||
warningDebug(void *ctx, const char *msg, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
@ -506,7 +505,7 @@ warningDebug(xmlParserCtxtPtr ctxt, const char *msg, ...)
|
||||
* extra parameters.
|
||||
*/
|
||||
void
|
||||
errorDebug(xmlParserCtxtPtr ctxt, const char *msg, ...)
|
||||
errorDebug(void *ctx, const char *msg, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
@ -526,7 +525,7 @@ errorDebug(xmlParserCtxtPtr ctxt, const char *msg, ...)
|
||||
* extra parameters.
|
||||
*/
|
||||
void
|
||||
fatalErrorDebug(xmlParserCtxtPtr ctxt, const char *msg, ...)
|
||||
fatalErrorDebug(void *ctx, const char *msg, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
|
@ -85,6 +85,8 @@ void xmlXPAthDebugDumpNodeSet(FILE *output, xmlNodeSetPtr cur) {
|
||||
fprintf(output, " NULL\n");
|
||||
else if (cur->nodeTab[i]->type == XML_DOCUMENT_NODE)
|
||||
fprintf(output, " /\n");
|
||||
else if (cur->nodeTab[i]->type == XML_ATTRIBUTE_NODE)
|
||||
xmlDebugDumpAttr(output, (xmlAttrPtr)cur->nodeTab[i], 2);
|
||||
else
|
||||
xmlDebugDumpOneNode(output, cur->nodeTab[i], 2);
|
||||
}
|
||||
@ -123,11 +125,11 @@ void testXPath(const char *str) {
|
||||
xmlXPathObjectPtr res;
|
||||
xmlXPathContextPtr ctxt;
|
||||
|
||||
ctxt = xmlXPathNewContext(document, NULL, NULL, NULL);
|
||||
ctxt = xmlXPathNewContext(document, NULL, NULL);
|
||||
if (expr)
|
||||
res = xmlXPathEvalExpression(str, ctxt);
|
||||
res = xmlXPathEvalExpression(BAD_CAST str, ctxt);
|
||||
else
|
||||
res = xmlXPathEval(str, ctxt);
|
||||
res = xmlXPathEval(BAD_CAST str, ctxt);
|
||||
xmlXPAthDebugDumpObject(stdout, res);
|
||||
xmlXPathFreeObject(res);
|
||||
xmlXPathFreeContext(ctxt);
|
||||
|
26
tester.c
26
tester.c
@ -76,18 +76,20 @@ int treeTest(void) {
|
||||
/*
|
||||
* build a fake XML document
|
||||
*/
|
||||
doc = xmlNewDoc("1.0");
|
||||
doc->root = xmlNewDocNode(doc, NULL, "EXAMPLE", NULL);
|
||||
xmlSetProp(doc->root, "prop1", "gnome is great");
|
||||
xmlSetProp(doc->root, "prop2", "&linux; too");
|
||||
xmlSetProp(doc->root, "emptyprop", "");
|
||||
tree = xmlNewChild(doc->root, NULL, "head", NULL);
|
||||
subtree = xmlNewChild(tree, NULL, "title", "Welcome to Gnome");
|
||||
tree = xmlNewChild(doc->root, NULL, "chapter", NULL);
|
||||
subtree = xmlNewChild(tree, NULL, "title", "The Linux adventure");
|
||||
subtree = xmlNewChild(tree, NULL, "p", "bla bla bla ...");
|
||||
subtree = xmlNewChild(tree, NULL, "image", NULL);
|
||||
xmlSetProp(subtree, "href", "linus.gif");
|
||||
doc = xmlNewDoc(BAD_CAST "1.0");
|
||||
doc->root = xmlNewDocNode(doc, NULL, BAD_CAST "EXAMPLE", NULL);
|
||||
xmlSetProp(doc->root, BAD_CAST "prop1", BAD_CAST "gnome is great");
|
||||
xmlSetProp(doc->root, BAD_CAST "prop2", BAD_CAST "&linux; too");
|
||||
xmlSetProp(doc->root, BAD_CAST "emptyprop", BAD_CAST "");
|
||||
tree = xmlNewChild(doc->root, NULL, BAD_CAST "head", NULL);
|
||||
subtree = xmlNewChild(tree, NULL, BAD_CAST "title",
|
||||
BAD_CAST "Welcome to Gnome");
|
||||
tree = xmlNewChild(doc->root, NULL, BAD_CAST "chapter", NULL);
|
||||
subtree = xmlNewChild(tree, NULL, BAD_CAST "title",
|
||||
BAD_CAST "The Linux adventure");
|
||||
subtree = xmlNewChild(tree, NULL, BAD_CAST "p", BAD_CAST "bla bla bla ...");
|
||||
subtree = xmlNewChild(tree, NULL, BAD_CAST "image", NULL);
|
||||
xmlSetProp(subtree, BAD_CAST "href", BAD_CAST "linus.gif");
|
||||
|
||||
/*
|
||||
* test intermediate copy if needed.
|
||||
|
324
tree.c
324
tree.c
@ -3,8 +3,6 @@
|
||||
*
|
||||
* See Copyright for the status of this software.
|
||||
*
|
||||
* TODO Cleanup the Dump mechanism.
|
||||
*
|
||||
* Daniel.Veillard@w3.org
|
||||
*/
|
||||
|
||||
@ -395,6 +393,7 @@ xmlNewDoc(const CHAR *version) {
|
||||
cur->encoding = NULL;
|
||||
cur->standalone = -1;
|
||||
cur->compression = xmlCompressMode;
|
||||
cur->ids = NULL;
|
||||
#ifndef XML_WITHOUT_CORBA
|
||||
cur->_private = NULL;
|
||||
cur->vepv = NULL;
|
||||
@ -424,6 +423,7 @@ xmlFreeDoc(xmlDocPtr cur) {
|
||||
if (cur->intSubset != NULL) xmlFreeDtd(cur->intSubset);
|
||||
if (cur->extSubset != NULL) xmlFreeDtd(cur->extSubset);
|
||||
if (cur->oldNs != NULL) xmlFreeNsList(cur->oldNs);
|
||||
if (cur->ids != NULL) xmlFreeIDTable((xmlIDTablePtr) cur->ids);
|
||||
memset(cur, -1, sizeof(xmlDoc));
|
||||
free(cur);
|
||||
}
|
||||
@ -738,6 +738,66 @@ xmlNewProp(xmlNodePtr node, const CHAR *name, const CHAR *value) {
|
||||
|
||||
cur->type = XML_ATTRIBUTE_NODE;
|
||||
cur->node = node;
|
||||
cur->ns = NULL;
|
||||
cur->name = xmlStrdup(name);
|
||||
if (value != NULL)
|
||||
cur->val = xmlStringGetNodeList(node->doc, value);
|
||||
else
|
||||
cur->val = NULL;
|
||||
#ifndef XML_WITHOUT_CORBA
|
||||
cur->_private = NULL;
|
||||
cur->vepv = NULL;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Add it at the end to preserve parsing order ...
|
||||
*/
|
||||
cur->next = NULL;
|
||||
if (node != NULL) {
|
||||
if (node->properties == NULL) {
|
||||
node->properties = cur;
|
||||
} else {
|
||||
xmlAttrPtr prev = node->properties;
|
||||
|
||||
while (prev->next != NULL) prev = prev->next;
|
||||
prev->next = cur;
|
||||
}
|
||||
}
|
||||
return(cur);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlNewNsProp:
|
||||
* @node: the holding node
|
||||
* @ns: the namespace
|
||||
* @name: the name of the attribute
|
||||
* @value: the value of the attribute
|
||||
*
|
||||
* Create a new property tagged with a namespace and carried by a node.
|
||||
* Returns a pointer to the attribute
|
||||
*/
|
||||
xmlAttrPtr
|
||||
xmlNewNsProp(xmlNodePtr node, xmlNsPtr ns, const CHAR *name,
|
||||
const CHAR *value) {
|
||||
xmlAttrPtr cur;
|
||||
|
||||
if (name == NULL) {
|
||||
fprintf(stderr, "xmlNewProp : name == NULL\n");
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate a new property and fill the fields.
|
||||
*/
|
||||
cur = (xmlAttrPtr) malloc(sizeof(xmlAttr));
|
||||
if (cur == NULL) {
|
||||
fprintf(stderr, "xmlNewProp : malloc failed\n");
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
cur->type = XML_ATTRIBUTE_NODE;
|
||||
cur->node = node;
|
||||
cur->ns = ns;
|
||||
cur->name = xmlStrdup(name);
|
||||
if (value != NULL)
|
||||
cur->val = xmlStringGetNodeList(node->doc, value);
|
||||
@ -846,6 +906,54 @@ xmlFreeProp(xmlAttrPtr cur) {
|
||||
free(cur);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlNewPI:
|
||||
* @name: the processing instruction name
|
||||
* @content: the PI content
|
||||
*
|
||||
* Creation of a processing instruction element.
|
||||
* Returns a pointer to the new node object.
|
||||
*/
|
||||
xmlNodePtr
|
||||
xmlNewPI(const CHAR *name, const CHAR *content) {
|
||||
xmlNodePtr cur;
|
||||
|
||||
if (name == NULL) {
|
||||
fprintf(stderr, "xmlNewPI : name == NULL\n");
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate a new node and fill the fields.
|
||||
*/
|
||||
cur = (xmlNodePtr) malloc(sizeof(xmlNode));
|
||||
if (cur == NULL) {
|
||||
fprintf(stderr, "xmlNewPI : malloc failed\n");
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
cur->type = XML_PI_NODE;
|
||||
cur->doc = NULL;
|
||||
cur->parent = NULL;
|
||||
cur->next = NULL;
|
||||
cur->prev = NULL;
|
||||
cur->childs = NULL;
|
||||
cur->last = NULL;
|
||||
cur->properties = NULL;
|
||||
cur->name = xmlStrdup(name);
|
||||
cur->ns = NULL;
|
||||
cur->nsDef = NULL;
|
||||
if (content != NULL)
|
||||
cur->content = xmlStrdup(content);
|
||||
else
|
||||
cur->content = NULL;
|
||||
#ifndef XML_WITHOUT_CORBA
|
||||
cur->_private = NULL;
|
||||
cur->vepv = NULL;
|
||||
#endif
|
||||
return(cur);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlNewNode:
|
||||
* @ns: namespace if any
|
||||
@ -1239,6 +1347,50 @@ xmlNewChild(xmlNodePtr parent, xmlNsPtr ns,
|
||||
return(cur);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlAddSibling:
|
||||
* @cur: the child node
|
||||
* @elem: the new node
|
||||
*
|
||||
* Add a new element to the list of siblings of @cur
|
||||
* Returns the element or NULL in case of error.
|
||||
*/
|
||||
xmlNodePtr
|
||||
xmlAddSibling(xmlNodePtr cur, xmlNodePtr elem) {
|
||||
xmlNodePtr parent;
|
||||
|
||||
if (cur == NULL) {
|
||||
fprintf(stderr, "xmlAddSibling : cur == NULL\n");
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
if (elem == NULL) {
|
||||
fprintf(stderr, "xmlAddSibling : elem == NULL\n");
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
if ((cur->doc != NULL) && (elem->doc != NULL) &&
|
||||
(cur->doc != elem->doc)) {
|
||||
fprintf(stderr,
|
||||
"xmlAddSibling: Elements moved to a different document\n");
|
||||
}
|
||||
|
||||
while (cur->next != NULL) cur = cur->next;
|
||||
|
||||
if (elem->doc == NULL)
|
||||
elem->doc = cur->doc; /* the parent may not be linked to a doc ! */
|
||||
|
||||
parent = cur->parent;
|
||||
elem->prev = cur;
|
||||
elem->next = NULL;
|
||||
elem->parent = parent;
|
||||
cur->next = elem;
|
||||
if (parent != NULL)
|
||||
parent->last = elem;
|
||||
|
||||
return(elem);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlAddChild:
|
||||
* @parent: the parent node
|
||||
@ -1451,6 +1603,7 @@ xmlCopyNamespaceList(xmlNsPtr cur) {
|
||||
|
||||
/**
|
||||
* xmlCopyProp:
|
||||
* @target: the element where the attribute will be grafted
|
||||
* @cur: the attribute
|
||||
*
|
||||
* Do a copy of the attribute.
|
||||
@ -1458,7 +1611,7 @@ xmlCopyNamespaceList(xmlNsPtr cur) {
|
||||
* Returns: a new xmlAttrPtr, or NULL in case of error.
|
||||
*/
|
||||
xmlAttrPtr
|
||||
xmlCopyProp(xmlAttrPtr cur) {
|
||||
xmlCopyProp(xmlNodePtr target, xmlAttrPtr cur) {
|
||||
xmlAttrPtr ret;
|
||||
|
||||
if (cur == NULL) return(NULL);
|
||||
@ -1467,6 +1620,15 @@ xmlCopyProp(xmlAttrPtr cur) {
|
||||
else
|
||||
ret = xmlNewDocProp(NULL, cur->name, NULL);
|
||||
if (ret == NULL) return(NULL);
|
||||
|
||||
if ((cur->ns != NULL) && (target != NULL)) {
|
||||
xmlNsPtr ns;
|
||||
|
||||
ns = xmlSearchNs(target->doc, target, cur->ns->prefix);
|
||||
ret->ns = ns;
|
||||
} else
|
||||
ret->ns = NULL;
|
||||
|
||||
if (cur->val != NULL)
|
||||
ret->val = xmlCopyNodeList(cur->val);
|
||||
return(ret);
|
||||
@ -1474,6 +1636,7 @@ xmlCopyProp(xmlAttrPtr cur) {
|
||||
|
||||
/**
|
||||
* xmlCopyPropList:
|
||||
* @target: the element where the attributes will be grafted
|
||||
* @cur: the first attribute
|
||||
*
|
||||
* Do a copy of an attribute list.
|
||||
@ -1481,12 +1644,12 @@ xmlCopyProp(xmlAttrPtr cur) {
|
||||
* Returns: a new xmlAttrPtr, or NULL in case of error.
|
||||
*/
|
||||
xmlAttrPtr
|
||||
xmlCopyPropList(xmlAttrPtr cur) {
|
||||
xmlCopyPropList(xmlNodePtr target, xmlAttrPtr cur) {
|
||||
xmlAttrPtr ret = NULL;
|
||||
xmlAttrPtr p = NULL,q;
|
||||
|
||||
while (cur != NULL) {
|
||||
q = xmlCopyProp(cur);
|
||||
q = xmlCopyProp(target, cur);
|
||||
if (p == NULL) {
|
||||
ret = p = q;
|
||||
} else {
|
||||
@ -1557,8 +1720,6 @@ xmlStaticCopyNode(xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent,
|
||||
xmlAddChild(parent, ret);
|
||||
|
||||
if (!recursive) return(ret);
|
||||
if (node->properties != NULL)
|
||||
ret->properties = xmlCopyPropList(node->properties);
|
||||
if (node->nsDef != NULL)
|
||||
ret->nsDef = xmlCopyNamespaceList(node->nsDef);
|
||||
|
||||
@ -1586,6 +1747,8 @@ xmlStaticCopyNode(xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent,
|
||||
ret->ns = ns;
|
||||
}
|
||||
}
|
||||
if (node->properties != NULL)
|
||||
ret->properties = xmlCopyPropList(ret, node->properties);
|
||||
if (node->childs != NULL)
|
||||
ret->childs = xmlStaticCopyNodeList(node->childs, doc, ret);
|
||||
UPDATE_LAST_CHILD(ret)
|
||||
@ -1699,9 +1862,6 @@ xmlCopyDtd(xmlDtdPtr dtd) {
|
||||
if (dtd->attributes != NULL)
|
||||
ret->attributes = (void *) xmlCopyAttributeTable(
|
||||
(xmlAttributeTablePtr) dtd->attributes);
|
||||
/*
|
||||
* TODO: support for Element definitions.
|
||||
*/
|
||||
return(ret);
|
||||
}
|
||||
|
||||
@ -1745,6 +1905,44 @@ xmlCopyDoc(xmlDocPtr doc, int recursive) {
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
* xmlNodeSetLang:
|
||||
* @cur: the node being changed
|
||||
* @lang: the langage description
|
||||
*
|
||||
* Searches the language of a node, i.e. the values of the xml:lang
|
||||
* attribute or the one carried by the nearest ancestor.
|
||||
*
|
||||
* Returns a pointer to the lang value, or NULL if not found
|
||||
*/
|
||||
void
|
||||
xmlNodeSetLang(xmlNodePtr cur, const CHAR *lang) {
|
||||
/* TODO xmlNodeSetLang check against the production [33] LanguageID */
|
||||
xmlSetProp(cur, BAD_CAST "xml:lang", lang);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlNodeGetLang:
|
||||
* @cur: the node being checked
|
||||
*
|
||||
* Searches the language of a node, i.e. the values of the xml:lang
|
||||
* attribute or the one carried by the nearest ancestor.
|
||||
*
|
||||
* Returns a pointer to the lang value, or NULL if not found
|
||||
*/
|
||||
const CHAR *
|
||||
xmlNodeGetLang(xmlNodePtr cur) {
|
||||
const CHAR *lang;
|
||||
|
||||
while (cur != NULL) {
|
||||
lang = xmlGetProp(cur, BAD_CAST "xml:lang");
|
||||
if (lang != NULL)
|
||||
return(lang);
|
||||
cur = cur->parent;
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlNodeGetContent:
|
||||
* @cur: the node being read
|
||||
@ -1764,10 +1962,20 @@ xmlNodeGetContent(xmlNodePtr cur) {
|
||||
case XML_ELEMENT_NODE:
|
||||
return(xmlNodeListGetString(cur->doc, cur->childs, 1));
|
||||
break;
|
||||
case XML_ATTRIBUTE_NODE:
|
||||
case XML_ATTRIBUTE_NODE: {
|
||||
xmlAttrPtr attr = (xmlAttrPtr) cur;
|
||||
if (attr->node != NULL)
|
||||
return(xmlNodeListGetString(attr->node->doc, attr->val, 1));
|
||||
else
|
||||
return(xmlNodeListGetString(NULL, attr->val, 1));
|
||||
break;
|
||||
}
|
||||
case XML_PI_NODE:
|
||||
if (cur->content != NULL)
|
||||
return(xmlStrdup(cur->content));
|
||||
return(NULL);
|
||||
case XML_ENTITY_REF_NODE:
|
||||
case XML_ENTITY_NODE:
|
||||
case XML_PI_NODE:
|
||||
case XML_COMMENT_NODE:
|
||||
case XML_DOCUMENT_NODE:
|
||||
case XML_DOCUMENT_TYPE_NODE:
|
||||
@ -1821,6 +2029,7 @@ xmlNodeSetContent(xmlNodePtr cur, const CHAR *content) {
|
||||
cur->content = xmlStrdup(content);
|
||||
else
|
||||
cur->content = NULL;
|
||||
break;
|
||||
case XML_DOCUMENT_NODE:
|
||||
case XML_DOCUMENT_TYPE_NODE:
|
||||
break;
|
||||
@ -1869,6 +2078,7 @@ xmlNodeSetContentLen(xmlNodePtr cur, const CHAR *content, int len) {
|
||||
cur->content = xmlStrndup(content, len);
|
||||
else
|
||||
cur->content = NULL;
|
||||
break;
|
||||
case XML_DOCUMENT_NODE:
|
||||
case XML_DOCUMENT_TYPE_NODE:
|
||||
break;
|
||||
@ -1984,6 +2194,60 @@ xmlTextMerge(xmlNodePtr first, xmlNodePtr second) {
|
||||
return(first);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlGetNsList:
|
||||
* @doc: the document
|
||||
* @node: the current node
|
||||
*
|
||||
* Search all the namespace applying to a given element.
|
||||
* Returns an NULL terminated array of all the xmlNsPtr found
|
||||
* that need to be freed by the caller or NULL if no
|
||||
* namespace if defined
|
||||
*/
|
||||
xmlNsPtr *
|
||||
xmlGetNsList(xmlDocPtr doc, xmlNodePtr node) {
|
||||
xmlNsPtr cur;
|
||||
xmlNsPtr *ret = NULL;
|
||||
int nbns = 0;
|
||||
int maxns = 10;
|
||||
int i;
|
||||
|
||||
while (node != NULL) {
|
||||
cur = node->nsDef;
|
||||
while (cur != NULL) {
|
||||
if (ret == NULL) {
|
||||
ret = (xmlNsPtr *) malloc((maxns + 1) * sizeof(xmlNsPtr));
|
||||
if (ret == NULL) {
|
||||
fprintf(stderr, "xmlGetNsList : out of memory!\n");
|
||||
return(NULL);
|
||||
}
|
||||
ret[nbns] = NULL;
|
||||
}
|
||||
for (i = 0;i < nbns;i++) {
|
||||
if ((cur->prefix == ret[i]->prefix) ||
|
||||
(!xmlStrcmp(cur->prefix, ret[i]->prefix))) break;
|
||||
}
|
||||
if (i >= nbns) {
|
||||
if (nbns >= maxns) {
|
||||
maxns *= 2;
|
||||
ret = (xmlNsPtr *) realloc(ret,
|
||||
(maxns + 1) * sizeof(xmlNsPtr));
|
||||
if (ret == NULL) {
|
||||
fprintf(stderr, "xmlGetNsList : realloc failed!\n");
|
||||
return(NULL);
|
||||
}
|
||||
}
|
||||
ret[nbns++] = cur;
|
||||
ret[nbns] = NULL;
|
||||
}
|
||||
|
||||
cur = cur->next;
|
||||
}
|
||||
node = node->parent;
|
||||
}
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlSearchNs:
|
||||
* @doc: the document
|
||||
@ -2077,7 +2341,7 @@ CHAR *xmlGetProp(xmlNodePtr node, const CHAR *name) {
|
||||
CHAR *ret;
|
||||
|
||||
ret = xmlNodeListGetString(node->doc, prop->val, 1);
|
||||
if (ret == NULL) return(xmlStrdup(""));
|
||||
if (ret == NULL) return(xmlStrdup((CHAR *)""));
|
||||
return(ret);
|
||||
}
|
||||
prop = prop->next;
|
||||
@ -2401,11 +2665,8 @@ xmlBufferWriteChar(xmlBufferPtr buf, const char *string) {
|
||||
*/
|
||||
void
|
||||
xmlBufferWriteQuotedString(xmlBufferPtr buf, const CHAR *string) {
|
||||
/*
|
||||
* TODO: fix strchr by xmlStrchr to work coreectly on UTF-8 !!!
|
||||
*/
|
||||
if (strchr(string, '"')) {
|
||||
if (strchr(string, '\'')) {
|
||||
if (xmlStrchr(string, '"')) {
|
||||
if (xmlStrchr(string, '\'')) {
|
||||
fprintf(stderr,
|
||||
"xmlBufferWriteQuotedString: string contains quote and double-quotes !\n");
|
||||
}
|
||||
@ -2546,7 +2807,6 @@ xmlDtdDump(xmlBufferPtr buf, xmlDocPtr doc) {
|
||||
xmlDumpAttributeTable(buf, (xmlAttributeTablePtr) cur->attributes);
|
||||
xmlBufferWriteChar(buf, "]");
|
||||
|
||||
/* TODO !!! a lot more things to dump ... */
|
||||
xmlBufferWriteChar(buf, ">\n");
|
||||
}
|
||||
|
||||
@ -2567,6 +2827,10 @@ xmlAttrDump(xmlBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur) {
|
||||
return;
|
||||
}
|
||||
xmlBufferWriteChar(buf, " ");
|
||||
if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
|
||||
xmlBufferWriteCHAR(buf, cur->ns->prefix);
|
||||
xmlBufferWriteChar(buf, ":");
|
||||
}
|
||||
xmlBufferWriteCHAR(buf, cur->name);
|
||||
value = xmlNodeListGetString(doc, cur->val, 0);
|
||||
if (value) {
|
||||
@ -2663,11 +2927,23 @@ xmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level) {
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (cur->type == XML_PI_NODE) {
|
||||
if (cur->content != NULL) {
|
||||
xmlBufferWriteChar(buf, "<?");
|
||||
xmlBufferWriteCHAR(buf, cur->name);
|
||||
if (cur->content != NULL) {
|
||||
xmlBufferWriteChar(buf, " ");
|
||||
xmlBufferWriteCHAR(buf, cur->content);
|
||||
}
|
||||
xmlBufferWriteChar(buf, "?>\n");
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (cur->type == XML_COMMENT_NODE) {
|
||||
if (cur->content != NULL) {
|
||||
xmlBufferWriteChar(buf, "<!--");
|
||||
xmlBufferWriteCHAR(buf, cur->content);
|
||||
xmlBufferWriteChar(buf, "-->");
|
||||
xmlBufferWriteChar(buf, "-->\n");
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -2757,12 +3033,18 @@ xmlDocContentDump(xmlBufferPtr buf, xmlDocPtr cur) {
|
||||
if (cur->intSubset != NULL)
|
||||
xmlDtdDump(buf, cur);
|
||||
if (cur->root != NULL) {
|
||||
xmlNodePtr child = cur->root;
|
||||
|
||||
/* global namespace definitions, the old way */
|
||||
if (oldXMLWDcompatibility)
|
||||
xmlGlobalNsListDump(buf, cur->oldNs);
|
||||
else
|
||||
xmlUpgradeOldNs(cur);
|
||||
xmlNodeDump(buf, cur, cur->root, 0);
|
||||
|
||||
while (child != NULL) {
|
||||
xmlNodeDump(buf, cur, child, 0);
|
||||
child = child->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
238
tree.h
238
tree.h
@ -53,6 +53,8 @@ typedef unsigned short CHAR;
|
||||
typedef unsigned char CHAR;
|
||||
#endif
|
||||
|
||||
#define BAD_CAST (CHAR *)
|
||||
|
||||
/*
|
||||
* a DTD Notation definition
|
||||
*/
|
||||
@ -193,6 +195,7 @@ typedef struct xmlAttr {
|
||||
struct xmlAttr *next; /* attribute list link */
|
||||
const CHAR *name; /* the name of the property */
|
||||
struct xmlNode *val; /* the value of the property */
|
||||
xmlNs *ns; /* pointer to the associated namespace */
|
||||
} xmlAttr;
|
||||
typedef xmlAttr *xmlAttrPtr;
|
||||
|
||||
@ -277,124 +280,195 @@ extern int xmlIndentTreeOutput; /* try to indent the tree dumps */
|
||||
* Handling Buffers.
|
||||
*/
|
||||
|
||||
xmlBufferPtr xmlBufferCreate(void);
|
||||
void xmlBufferFree(xmlBufferPtr buf);
|
||||
int xmlBufferDump(FILE *file, xmlBufferPtr buf);
|
||||
void xmlBufferAdd(xmlBufferPtr buf, const CHAR *str, int len);
|
||||
void xmlBufferCat(xmlBufferPtr buf, const CHAR *str);
|
||||
void xmlBufferCCat(xmlBufferPtr buf, const char *str);
|
||||
int xmlBufferShrink(xmlBufferPtr buf, int len);
|
||||
void xmlBufferEmpty(xmlBufferPtr buf);
|
||||
xmlBufferPtr xmlBufferCreate (void);
|
||||
void xmlBufferFree (xmlBufferPtr buf);
|
||||
int xmlBufferDump (FILE *file,
|
||||
xmlBufferPtr buf);
|
||||
void xmlBufferAdd (xmlBufferPtr buf,
|
||||
const CHAR *str,
|
||||
int len);
|
||||
void xmlBufferCat (xmlBufferPtr buf,
|
||||
const CHAR *str);
|
||||
void xmlBufferCCat (xmlBufferPtr buf,
|
||||
const char *str);
|
||||
int xmlBufferShrink (xmlBufferPtr buf,
|
||||
int len);
|
||||
void xmlBufferEmpty (xmlBufferPtr buf);
|
||||
|
||||
/*
|
||||
* Creating/freeing new structures
|
||||
*/
|
||||
xmlDtdPtr xmlCreateIntSubset(xmlDocPtr doc, const CHAR *name,
|
||||
const CHAR *ExternalID, const CHAR *SystemID);
|
||||
xmlDtdPtr xmlNewDtd(xmlDocPtr doc, const CHAR *name,
|
||||
const CHAR *ExternalID, const CHAR *SystemID);
|
||||
void xmlFreeDtd(xmlDtdPtr cur);
|
||||
xmlNsPtr xmlNewGlobalNs(xmlDocPtr doc, const CHAR *href, const CHAR *prefix);
|
||||
xmlNsPtr xmlNewNs(xmlNodePtr node, const CHAR *href, const CHAR *prefix);
|
||||
void xmlFreeNs(xmlNsPtr cur);
|
||||
xmlDocPtr xmlNewDoc(const CHAR *version);
|
||||
void xmlFreeDoc(xmlDocPtr cur);
|
||||
xmlAttrPtr xmlNewDocProp(xmlDocPtr doc, const CHAR *name,
|
||||
const CHAR *value);
|
||||
xmlAttrPtr xmlNewProp(xmlNodePtr node, const CHAR *name,
|
||||
const CHAR *value);
|
||||
void xmlFreePropList(xmlAttrPtr cur);
|
||||
void xmlFreeProp(xmlAttrPtr cur);
|
||||
xmlAttrPtr xmlCopyProp(xmlAttrPtr cur);
|
||||
xmlAttrPtr xmlCopyPropList(xmlAttrPtr cur);
|
||||
xmlDtdPtr xmlCopyDtd(xmlDtdPtr dtd);
|
||||
xmlDocPtr xmlCopyDoc(xmlDocPtr doc, int recursive);
|
||||
xmlDtdPtr xmlCreateIntSubset (xmlDocPtr doc,
|
||||
const CHAR *name,
|
||||
const CHAR *ExternalID,
|
||||
const CHAR *SystemID);
|
||||
xmlDtdPtr xmlNewDtd (xmlDocPtr doc,
|
||||
const CHAR *name,
|
||||
const CHAR *ExternalID,
|
||||
const CHAR *SystemID);
|
||||
void xmlFreeDtd (xmlDtdPtr cur);
|
||||
xmlNsPtr xmlNewGlobalNs (xmlDocPtr doc,
|
||||
const CHAR *href,
|
||||
const CHAR *prefix);
|
||||
xmlNsPtr xmlNewNs (xmlNodePtr node,
|
||||
const CHAR *href,
|
||||
const CHAR *prefix);
|
||||
void xmlFreeNs (xmlNsPtr cur);
|
||||
xmlDocPtr xmlNewDoc (const CHAR *version);
|
||||
void xmlFreeDoc (xmlDocPtr cur);
|
||||
xmlAttrPtr xmlNewDocProp (xmlDocPtr doc,
|
||||
const CHAR *name,
|
||||
const CHAR *value);
|
||||
xmlAttrPtr xmlNewProp (xmlNodePtr node,
|
||||
const CHAR *name,
|
||||
const CHAR *value);
|
||||
xmlAttrPtr xmlNewNsProp (xmlNodePtr node,
|
||||
xmlNsPtr ns,
|
||||
const CHAR *name,
|
||||
const CHAR *value);
|
||||
void xmlFreePropList (xmlAttrPtr cur);
|
||||
void xmlFreeProp (xmlAttrPtr cur);
|
||||
xmlAttrPtr xmlCopyProp (xmlNodePtr target,
|
||||
xmlAttrPtr cur);
|
||||
xmlAttrPtr xmlCopyPropList (xmlNodePtr target,
|
||||
xmlAttrPtr cur);
|
||||
xmlDtdPtr xmlCopyDtd (xmlDtdPtr dtd);
|
||||
xmlDocPtr xmlCopyDoc (xmlDocPtr doc,
|
||||
int recursive);
|
||||
|
||||
/*
|
||||
* Creating new nodes
|
||||
*/
|
||||
xmlNodePtr xmlNewDocNode(xmlDocPtr doc, xmlNsPtr ns,
|
||||
const CHAR *name, const CHAR *content);
|
||||
xmlNodePtr xmlNewNode(xmlNsPtr ns, const CHAR *name);
|
||||
xmlNodePtr xmlNewChild(xmlNodePtr parent, xmlNsPtr ns,
|
||||
const CHAR *name, const CHAR *content);
|
||||
xmlNodePtr xmlNewDocText(xmlDocPtr doc, const CHAR *content);
|
||||
xmlNodePtr xmlNewText(const CHAR *content);
|
||||
xmlNodePtr xmlNewDocTextLen(xmlDocPtr doc, const CHAR *content, int len);
|
||||
xmlNodePtr xmlNewTextLen(const CHAR *content, int len);
|
||||
xmlNodePtr xmlNewDocComment(xmlDocPtr doc, const CHAR *content);
|
||||
xmlNodePtr xmlNewComment(const CHAR *content);
|
||||
xmlNodePtr xmlNewCDataBlock(xmlDocPtr doc, const CHAR *content, int len);
|
||||
xmlNodePtr xmlNewReference(xmlDocPtr doc, const CHAR *name);
|
||||
xmlNodePtr xmlCopyNode(xmlNodePtr node, int recursive);
|
||||
xmlNodePtr xmlCopyNodeList(xmlNodePtr node);
|
||||
xmlNodePtr xmlNewDocNode (xmlDocPtr doc,
|
||||
xmlNsPtr ns,
|
||||
const CHAR *name,
|
||||
const CHAR *content);
|
||||
xmlNodePtr xmlNewNode (xmlNsPtr ns,
|
||||
const CHAR *name);
|
||||
xmlNodePtr xmlNewChild (xmlNodePtr parent,
|
||||
xmlNsPtr ns,
|
||||
const CHAR *name,
|
||||
const CHAR *content);
|
||||
xmlNodePtr xmlNewDocText (xmlDocPtr doc,
|
||||
const CHAR *content);
|
||||
xmlNodePtr xmlNewText (const CHAR *content);
|
||||
xmlNodePtr xmlNewPI (const CHAR *name,
|
||||
const CHAR *content);
|
||||
xmlNodePtr xmlNewDocTextLen (xmlDocPtr doc,
|
||||
const CHAR *content,
|
||||
int len);
|
||||
xmlNodePtr xmlNewTextLen (const CHAR *content,
|
||||
int len);
|
||||
xmlNodePtr xmlNewDocComment (xmlDocPtr doc,
|
||||
const CHAR *content);
|
||||
xmlNodePtr xmlNewComment (const CHAR *content);
|
||||
xmlNodePtr xmlNewCDataBlock (xmlDocPtr doc,
|
||||
const CHAR *content,
|
||||
int len);
|
||||
xmlNodePtr xmlNewReference (xmlDocPtr doc,
|
||||
const CHAR *name);
|
||||
xmlNodePtr xmlCopyNode (xmlNodePtr node,
|
||||
int recursive);
|
||||
xmlNodePtr xmlCopyNodeList (xmlNodePtr node);
|
||||
|
||||
/*
|
||||
* Navigating
|
||||
*/
|
||||
xmlNodePtr xmlGetLastChild(xmlNodePtr parent);
|
||||
int xmlNodeIsText(xmlNodePtr node);
|
||||
xmlNodePtr xmlGetLastChild (xmlNodePtr parent);
|
||||
int xmlNodeIsText (xmlNodePtr node);
|
||||
|
||||
/*
|
||||
* Changing the structure
|
||||
*/
|
||||
xmlNodePtr xmlAddChild(xmlNodePtr parent, xmlNodePtr cur);
|
||||
void xmlUnlinkNode(xmlNodePtr cur);
|
||||
|
||||
xmlNodePtr xmlTextMerge(xmlNodePtr first, xmlNodePtr second);
|
||||
void xmlTextConcat(xmlNodePtr node, const CHAR *content, int len);
|
||||
|
||||
void xmlFreeNodeList(xmlNodePtr cur);
|
||||
void xmlFreeNode(xmlNodePtr cur);
|
||||
xmlNodePtr xmlAddChild (xmlNodePtr parent,
|
||||
xmlNodePtr cur);
|
||||
xmlNodePtr xmlAddSibling (xmlNodePtr cur,
|
||||
xmlNodePtr elem);
|
||||
void xmlUnlinkNode (xmlNodePtr cur);
|
||||
xmlNodePtr xmlTextMerge (xmlNodePtr first,
|
||||
xmlNodePtr second);
|
||||
void xmlTextConcat (xmlNodePtr node,
|
||||
const CHAR *content,
|
||||
int len);
|
||||
void xmlFreeNodeList (xmlNodePtr cur);
|
||||
void xmlFreeNode (xmlNodePtr cur);
|
||||
|
||||
/*
|
||||
* Namespaces
|
||||
*/
|
||||
xmlNsPtr xmlSearchNs(xmlDocPtr doc, xmlNodePtr node,
|
||||
const CHAR *nameSpace);
|
||||
xmlNsPtr xmlSearchNsByHref(xmlDocPtr doc, xmlNodePtr node,
|
||||
const CHAR *href);
|
||||
void xmlSetNs(xmlNodePtr node, xmlNsPtr ns);
|
||||
xmlNsPtr xmlCopyNamespace(xmlNsPtr cur);
|
||||
xmlNsPtr xmlCopyNamespaceList(xmlNsPtr cur);
|
||||
xmlNsPtr xmlSearchNs (xmlDocPtr doc,
|
||||
xmlNodePtr node,
|
||||
const CHAR *nameSpace);
|
||||
xmlNsPtr xmlSearchNsByHref (xmlDocPtr doc,
|
||||
xmlNodePtr node,
|
||||
const CHAR *href);
|
||||
xmlNsPtr * xmlGetNsList (xmlDocPtr doc,
|
||||
xmlNodePtr node);
|
||||
void xmlSetNs (xmlNodePtr node,
|
||||
xmlNsPtr ns);
|
||||
xmlNsPtr xmlCopyNamespace (xmlNsPtr cur);
|
||||
xmlNsPtr xmlCopyNamespaceList (xmlNsPtr cur);
|
||||
|
||||
/*
|
||||
* Changing the content.
|
||||
*/
|
||||
xmlAttrPtr xmlSetProp(xmlNodePtr node, const CHAR *name,
|
||||
const CHAR *value);
|
||||
CHAR *xmlGetProp(xmlNodePtr node, const CHAR *name);
|
||||
xmlNodePtr xmlStringGetNodeList(xmlDocPtr doc, const CHAR *value);
|
||||
xmlNodePtr xmlStringLenGetNodeList(xmlDocPtr doc, const CHAR *value,
|
||||
int len);
|
||||
CHAR *xmlNodeListGetString(xmlDocPtr doc, xmlNodePtr list, int inLine);
|
||||
void xmlNodeSetContent(xmlNodePtr cur, const CHAR *content);
|
||||
void xmlNodeSetContentLen(xmlNodePtr cur, const CHAR *content, int len);
|
||||
void xmlNodeAddContent(xmlNodePtr cur, const CHAR *content);
|
||||
void xmlNodeAddContentLen(xmlNodePtr cur, const CHAR *content, int len);
|
||||
CHAR *xmlNodeGetContent(xmlNodePtr cur);
|
||||
xmlAttrPtr xmlSetProp (xmlNodePtr node,
|
||||
const CHAR *name,
|
||||
const CHAR *value);
|
||||
CHAR * xmlGetProp (xmlNodePtr node,
|
||||
const CHAR *name);
|
||||
xmlNodePtr xmlStringGetNodeList (xmlDocPtr doc,
|
||||
const CHAR *value);
|
||||
xmlNodePtr xmlStringLenGetNodeList (xmlDocPtr doc,
|
||||
const CHAR *value,
|
||||
int len);
|
||||
CHAR * xmlNodeListGetString (xmlDocPtr doc,
|
||||
xmlNodePtr list,
|
||||
int inLine);
|
||||
void xmlNodeSetContent (xmlNodePtr cur,
|
||||
const CHAR *content);
|
||||
void xmlNodeSetContentLen (xmlNodePtr cur,
|
||||
const CHAR *content,
|
||||
int len);
|
||||
void xmlNodeAddContent (xmlNodePtr cur,
|
||||
const CHAR *content);
|
||||
void xmlNodeAddContentLen (xmlNodePtr cur,
|
||||
const CHAR *content,
|
||||
int len);
|
||||
CHAR * xmlNodeGetContent (xmlNodePtr cur);
|
||||
const CHAR * xmlNodeGetLang (xmlNodePtr cur);
|
||||
void xmlNodeSetLang (xmlNodePtr cur,
|
||||
const CHAR *lang);
|
||||
|
||||
/*
|
||||
* Internal, don't use
|
||||
*/
|
||||
void xmlBufferWriteCHAR(xmlBufferPtr buf, const CHAR *string);
|
||||
void xmlBufferWriteChar(xmlBufferPtr buf, const char *string);
|
||||
void xmlBufferWriteQuotedString(xmlBufferPtr buf, const CHAR *string);
|
||||
void xmlBufferWriteCHAR (xmlBufferPtr buf,
|
||||
const CHAR *string);
|
||||
void xmlBufferWriteChar (xmlBufferPtr buf,
|
||||
const char *string);
|
||||
void xmlBufferWriteQuotedString(xmlBufferPtr buf,
|
||||
const CHAR *string);
|
||||
|
||||
/*
|
||||
* Saving
|
||||
*/
|
||||
void xmlDocDumpMemory(xmlDocPtr cur, CHAR**mem, int *size);
|
||||
void xmlDocDump(FILE *f, xmlDocPtr cur);
|
||||
int xmlSaveFile(const char *filename, xmlDocPtr cur);
|
||||
void xmlDocDumpMemory (xmlDocPtr cur,
|
||||
CHAR**mem,
|
||||
int *size);
|
||||
void xmlDocDump (FILE *f,
|
||||
xmlDocPtr cur);
|
||||
int xmlSaveFile (const char *filename,
|
||||
xmlDocPtr cur);
|
||||
|
||||
/*
|
||||
* Compression
|
||||
*/
|
||||
int xmlGetDocCompressMode (xmlDocPtr doc);
|
||||
void xmlSetDocCompressMode (xmlDocPtr doc, int mode);
|
||||
int xmlGetCompressMode(void);
|
||||
void xmlSetCompressMode(int mode);
|
||||
int xmlGetDocCompressMode (xmlDocPtr doc);
|
||||
void xmlSetDocCompressMode (xmlDocPtr doc,
|
||||
int mode);
|
||||
int xmlGetCompressMode (void);
|
||||
void xmlSetCompressMode (int mode);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
110
valid.c
110
valid.c
@ -201,7 +201,7 @@ xmlSprintfElementContent(char *buf, xmlElementContentPtr content, int glob) {
|
||||
strcat(buf, "#PCDATA");
|
||||
break;
|
||||
case XML_ELEMENT_CONTENT_ELEMENT:
|
||||
strcat(buf, content->name);
|
||||
strcat(buf, (char *) content->name);
|
||||
break;
|
||||
case XML_ELEMENT_CONTENT_SEQ:
|
||||
if ((content->c1->type == XML_ELEMENT_CONTENT_OR) ||
|
||||
@ -760,7 +760,9 @@ xmlAddAttributeDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const CHAR *elem,
|
||||
fprintf(stderr, "xmlAddAttributeDecl: elem == NULL\n");
|
||||
return(NULL);
|
||||
}
|
||||
/* TODO: Lacks verifications !!! */
|
||||
/*
|
||||
* Check the type and possibly the default value.
|
||||
*/
|
||||
switch (type) {
|
||||
case XML_ATTRIBUTE_CDATA:
|
||||
break;
|
||||
@ -786,6 +788,12 @@ xmlAddAttributeDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const CHAR *elem,
|
||||
fprintf(stderr, "xmlAddAttributeDecl: unknown type %d\n", type);
|
||||
return(NULL);
|
||||
}
|
||||
if ((defaultValue != NULL) &&
|
||||
(!xmlValidateAttributeValue(type, defaultValue))) {
|
||||
VERROR(ctxt->userData, "Attribute %s on %s: invalid default value\n",
|
||||
elem, name, defaultValue);
|
||||
defaultValue = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Create the Attribute table if needed.
|
||||
@ -808,8 +816,8 @@ xmlAddAttributeDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const CHAR *elem,
|
||||
/*
|
||||
* The attribute is already defined in this Dtd.
|
||||
*/
|
||||
fprintf(stderr,
|
||||
"xmlAddAttributeDecl: %s already defined\n", name);
|
||||
VERROR(ctxt->userData, "Attribute %s on %s: already defined\n",
|
||||
elem, name);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1492,12 +1500,53 @@ xmlIsID(xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr) {
|
||||
attrDecl = xmlGetDtdAttrDesc(doc->extSubset, elem->name,
|
||||
attr->name);
|
||||
|
||||
if ((attrDecl == NULL) || (attrDecl->type == XML_ATTRIBUTE_ID))
|
||||
if ((attrDecl != NULL) && (attrDecl->type == XML_ATTRIBUTE_ID))
|
||||
return(1);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlGetID:
|
||||
* @doc: pointer to the document
|
||||
* @ID: the ID value
|
||||
*
|
||||
* Search the attribute declaring the given ID
|
||||
*
|
||||
* Returns NULL if not found, otherwise the xmlAttrPtr defining the ID
|
||||
*/
|
||||
xmlAttrPtr
|
||||
xmlGetID(xmlDocPtr doc, const CHAR *ID) {
|
||||
xmlIDPtr cur;
|
||||
xmlIDTablePtr table;
|
||||
int i;
|
||||
|
||||
if (doc == NULL) {
|
||||
fprintf(stderr, "xmlGetID: doc == NULL\n");
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
if (ID == NULL) {
|
||||
fprintf(stderr, "xmlGetID: ID == NULL\n");
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
table = doc->ids;
|
||||
if (table == NULL)
|
||||
return(NULL);
|
||||
|
||||
/*
|
||||
* Search the ID list.
|
||||
*/
|
||||
for (i = 0;i < table->nb_ids;i++) {
|
||||
cur = table->table[i];
|
||||
if (!xmlStrcmp(cur->value, ID)) {
|
||||
return(cur->attr);
|
||||
}
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Routines for validity checking *
|
||||
@ -1591,6 +1640,36 @@ xmlGetDtdNotationDesc(xmlDtdPtr dtd, const CHAR *name) {
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlValidateNotationUse:
|
||||
* @ctxt: the validation context
|
||||
* @doc: the document
|
||||
* @notationName: the notation name to check
|
||||
*
|
||||
* Validate that the given mame match a notation declaration.
|
||||
* - [ VC: Notation Declared ]
|
||||
*
|
||||
* returns 1 if valid or 0 otherwise
|
||||
*/
|
||||
|
||||
int
|
||||
xmlValidateNotationUse(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
const CHAR *notationName) {
|
||||
xmlNotationPtr notaDecl;
|
||||
if ((doc == NULL) || (doc->intSubset == NULL)) return(-1);
|
||||
|
||||
notaDecl = xmlGetDtdNotationDesc(doc->intSubset, notationName);
|
||||
if ((notaDecl == NULL) && (doc->extSubset != NULL))
|
||||
notaDecl = xmlGetDtdNotationDesc(doc->extSubset, notationName);
|
||||
|
||||
if (notaDecl == NULL) {
|
||||
VERROR(ctxt->userData, "NOTATION %s is not declared\n",
|
||||
notationName);
|
||||
return(0);
|
||||
}
|
||||
return(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlIsMixedElement
|
||||
* @doc: the document
|
||||
@ -1804,6 +1883,7 @@ xmlValidateNmtokensValue(const CHAR *value) {
|
||||
|
||||
/**
|
||||
* xmlValidateNotationDecl:
|
||||
* @ctxt: the validation context
|
||||
* @doc: a document instance
|
||||
* @nota: a notation definition
|
||||
*
|
||||
@ -1852,12 +1932,12 @@ xmlValidateNotationDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
int
|
||||
xmlValidateAttributeValue(xmlAttributeType type, const CHAR *value) {
|
||||
switch (type) {
|
||||
case XML_ATTRIBUTE_IDREFS:
|
||||
case XML_ATTRIBUTE_ENTITIES:
|
||||
case XML_ATTRIBUTE_IDREFS:
|
||||
return(xmlValidateNamesValue(value));
|
||||
case XML_ATTRIBUTE_ENTITY:
|
||||
case XML_ATTRIBUTE_IDREF:
|
||||
case XML_ATTRIBUTE_ID:
|
||||
case XML_ATTRIBUTE_ENTITY:
|
||||
case XML_ATTRIBUTE_NOTATION:
|
||||
return(xmlValidateNameValue(value));
|
||||
case XML_ATTRIBUTE_NMTOKENS:
|
||||
@ -1873,6 +1953,7 @@ xmlValidateAttributeValue(xmlAttributeType type, const CHAR *value) {
|
||||
|
||||
/**
|
||||
* xmlValidateAttributeDecl:
|
||||
* @ctxt: the validation context
|
||||
* @doc: a document instance
|
||||
* @attr: an attribute definition
|
||||
*
|
||||
@ -1918,7 +1999,7 @@ xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
/* max ID per element */
|
||||
/* One ID per Element Type */
|
||||
if ((attr->type == XML_ATTRIBUTE_ID) && (doc->extSubset != NULL)) {
|
||||
int nbId = 0;
|
||||
|
||||
@ -2048,7 +2129,7 @@ xmlValidateElementDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
int
|
||||
xmlValidateOneAttribute(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
xmlNodePtr elem, xmlAttrPtr attr, const CHAR *value) {
|
||||
xmlElementPtr elemDecl;
|
||||
/* xmlElementPtr elemDecl; */
|
||||
xmlAttributePtr attrDecl;
|
||||
int val;
|
||||
int ret = 1;
|
||||
@ -2077,6 +2158,11 @@ xmlValidateOneAttribute(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
/* Validity Constraint: ID uniqueness */
|
||||
if (attrDecl->type == XML_ATTRIBUTE_ID) {
|
||||
xmlAddID(ctxt, doc, value, attr);
|
||||
}
|
||||
|
||||
/* Validity Constraint: Notation Attributes */
|
||||
if (attrDecl->type == XML_ATTRIBUTE_NOTATION) {
|
||||
xmlEnumerationPtr tree = attrDecl->tree;
|
||||
@ -2131,13 +2217,14 @@ xmlValidateOneAttribute(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
/********
|
||||
elemDecl = xmlGetDtdElementDesc(doc->intSubset, elem->name);
|
||||
if ((elemDecl == NULL) && (doc->extSubset != NULL))
|
||||
elemDecl = xmlGetDtdElementDesc(doc->extSubset, elem->name);
|
||||
if (elemDecl == NULL) {
|
||||
/* the error has or will be reported soon in xmlValidateOneElement */
|
||||
return(0);
|
||||
}
|
||||
********/
|
||||
return(ret);
|
||||
}
|
||||
|
||||
@ -2329,7 +2416,7 @@ xmlSprintfElementChilds(char *buf, xmlNodePtr node, int glob) {
|
||||
while (cur != NULL) {
|
||||
switch (cur->type) {
|
||||
case XML_ELEMENT_NODE:
|
||||
strcat(buf, cur->name);
|
||||
strcat(buf, (char *) cur->name);
|
||||
if (cur->next != NULL)
|
||||
strcat(buf, " ");
|
||||
break;
|
||||
@ -2467,6 +2554,7 @@ xmlValidateOneElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
break;
|
||||
}
|
||||
|
||||
/* TODO - [ VC: Required Attribute ] */
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
127
valid.h
127
valid.h
@ -84,62 +84,107 @@ typedef struct xmlIDTable {
|
||||
typedef xmlIDTable *xmlIDTablePtr;
|
||||
|
||||
/* Notation */
|
||||
xmlNotationPtr xmlAddNotationDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd,
|
||||
const CHAR *name, const CHAR *PublicID, const CHAR *SystemID);
|
||||
xmlNotationPtr xmlAddNotationDecl (xmlValidCtxtPtr ctxt,
|
||||
xmlDtdPtr dtd,
|
||||
const CHAR *name,
|
||||
const CHAR *PublicID,
|
||||
const CHAR *SystemID);
|
||||
xmlNotationTablePtr xmlCopyNotationTable(xmlNotationTablePtr table);
|
||||
void xmlFreeNotationTable(xmlNotationTablePtr table);
|
||||
void xmlDumpNotationTable(xmlBufferPtr buf, xmlNotationTablePtr table);
|
||||
void xmlFreeNotationTable(xmlNotationTablePtr table);
|
||||
void xmlDumpNotationTable(xmlBufferPtr buf,
|
||||
xmlNotationTablePtr table);
|
||||
|
||||
/* Element Content */
|
||||
xmlElementContentPtr xmlNewElementContent(CHAR *name, int type);
|
||||
xmlElementContentPtr xmlNewElementContent (CHAR *name, int type);
|
||||
xmlElementContentPtr xmlCopyElementContent(xmlElementContentPtr content);
|
||||
void xmlFreeElementContent(xmlElementContentPtr cur);
|
||||
void xmlFreeElementContent(xmlElementContentPtr cur);
|
||||
|
||||
/* Element */
|
||||
xmlElementPtr xmlAddElementDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd,
|
||||
const CHAR *name, int type, xmlElementContentPtr content);
|
||||
xmlElementTablePtr xmlCopyElementTable(xmlElementTablePtr table);
|
||||
void xmlFreeElementTable(xmlElementTablePtr table);
|
||||
void xmlDumpElementTable(xmlBufferPtr buf, xmlElementTablePtr table);
|
||||
xmlElementPtr xmlAddElementDecl (xmlValidCtxtPtr ctxt,
|
||||
xmlDtdPtr dtd,
|
||||
const CHAR *name,
|
||||
int type,
|
||||
xmlElementContentPtr content);
|
||||
xmlElementTablePtr xmlCopyElementTable (xmlElementTablePtr table);
|
||||
void xmlFreeElementTable (xmlElementTablePtr table);
|
||||
void xmlDumpElementTable (xmlBufferPtr buf,
|
||||
xmlElementTablePtr table);
|
||||
|
||||
/* Enumeration */
|
||||
xmlEnumerationPtr xmlCreateEnumeration(CHAR *name);
|
||||
void xmlFreeEnumeration(xmlEnumerationPtr cur);
|
||||
xmlEnumerationPtr xmlCopyEnumeration(xmlEnumerationPtr cur);
|
||||
xmlEnumerationPtr xmlCreateEnumeration (CHAR *name);
|
||||
void xmlFreeEnumeration (xmlEnumerationPtr cur);
|
||||
xmlEnumerationPtr xmlCopyEnumeration (xmlEnumerationPtr cur);
|
||||
|
||||
/* Attribute */
|
||||
xmlAttributePtr xmlAddAttributeDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd,
|
||||
const CHAR *elem, const CHAR *name, int type, int def,
|
||||
const CHAR *defaultValue, xmlEnumerationPtr tree);
|
||||
xmlAttributeTablePtr xmlCopyAttributeTable(xmlAttributeTablePtr table);
|
||||
void xmlFreeAttributeTable(xmlAttributeTablePtr table);
|
||||
void xmlDumpAttributeTable(xmlBufferPtr buf, xmlAttributeTablePtr table);
|
||||
xmlAttributePtr xmlAddAttributeDecl (xmlValidCtxtPtr ctxt,
|
||||
xmlDtdPtr dtd,
|
||||
const CHAR *elem,
|
||||
const CHAR *name,
|
||||
int type,
|
||||
int def,
|
||||
const CHAR *defaultValue,
|
||||
xmlEnumerationPtr tree);
|
||||
xmlAttributeTablePtr xmlCopyAttributeTable (xmlAttributeTablePtr table);
|
||||
void xmlFreeAttributeTable (xmlAttributeTablePtr table);
|
||||
void xmlDumpAttributeTable (xmlBufferPtr buf,
|
||||
xmlAttributeTablePtr table);
|
||||
|
||||
/* IDs */
|
||||
xmlIDPtr xmlAddID(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
const CHAR *value, xmlAttrPtr attr);
|
||||
xmlIDTablePtr xmlCopyIDTable(xmlIDTablePtr table);
|
||||
void xmlFreeIDTable(xmlIDTablePtr table);
|
||||
xmlIDPtr xmlAddID (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
const CHAR *value,
|
||||
xmlAttrPtr attr);
|
||||
xmlIDTablePtr xmlCopyIDTable (xmlIDTablePtr table);
|
||||
void xmlFreeIDTable (xmlIDTablePtr table);
|
||||
xmlAttrPtr xmlGetID (xmlDocPtr doc,
|
||||
const CHAR *ID);
|
||||
int xmlIsID (xmlDocPtr doc,
|
||||
xmlNodePtr elem,
|
||||
xmlAttrPtr attr);
|
||||
|
||||
/**
|
||||
* The public function calls related to validity checking
|
||||
*/
|
||||
|
||||
int xmlValidateRoot(xmlValidCtxtPtr ctxt, xmlDocPtr doc);
|
||||
int xmlValidateElementDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
xmlElementPtr elem);
|
||||
int xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
xmlAttributePtr attr);
|
||||
int xmlValidateNotationDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
xmlNotationPtr nota);
|
||||
int xmlValidateDtd(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlDtdPtr dtd);
|
||||
|
||||
int xmlValidateDocument(xmlValidCtxtPtr ctxt, xmlDocPtr doc);
|
||||
int xmlValidateElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem);
|
||||
int xmlValidateOneElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
xmlNodePtr elem);
|
||||
int xmlValidateOneAttribute(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
xmlNodePtr elem, xmlAttrPtr attr, const CHAR *value);
|
||||
|
||||
int xmlIsMixedElement(xmlDocPtr doc, const CHAR *name);
|
||||
int xmlValidateRoot (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc);
|
||||
int xmlValidateElementDecl (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlElementPtr elem);
|
||||
int xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlAttributePtr attr);
|
||||
int xmlValidateAttributeValue(xmlAttributeType type,
|
||||
const CHAR *value);
|
||||
int xmlValidateNotationDecl (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlNotationPtr nota);
|
||||
int xmlValidateDtd (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlDtdPtr dtd);
|
||||
int xmlValidateDocument (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc);
|
||||
int xmlValidateElement (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlNodePtr elem);
|
||||
int xmlValidateOneElement (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlNodePtr elem);
|
||||
int xmlValidateOneAttribute (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlNodePtr elem,
|
||||
xmlAttrPtr attr,
|
||||
const CHAR *value);
|
||||
int xmlValidateNotationUse (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
const CHAR *notationName);
|
||||
int xmlIsMixedElement (xmlDocPtr doc,
|
||||
const CHAR *name);
|
||||
xmlAttributePtr xmlGetDtdAttrDesc (xmlDtdPtr dtd,
|
||||
const CHAR *elem,
|
||||
const CHAR *name);
|
||||
xmlNotationPtr xmlGetDtdNotationDesc (xmlDtdPtr dtd,
|
||||
const CHAR *name);
|
||||
xmlElementPtr xmlGetDtdElementDesc (xmlDtdPtr dtd,
|
||||
const CHAR *name);
|
||||
#endif /* __XML_VALID_H__ */
|
||||
|
@ -57,7 +57,7 @@ while test $# -gt 0; do
|
||||
;;
|
||||
|
||||
--libs)
|
||||
echo -L@libdir@ @XML_LIBS@
|
||||
echo -L@libdir@ @XML_LIBS@ @LIBS@
|
||||
;;
|
||||
|
||||
*)
|
||||
|
16
xml-error.h
16
xml-error.h
@ -3,6 +3,18 @@
|
||||
|
||||
#include "parser.h"
|
||||
|
||||
void xmlParserError(void *ctx, const char *msg, ...);
|
||||
void xmlParserWarning(void *ctx, const char *msg, ...);
|
||||
void xmlParserError (void *ctx,
|
||||
const char *msg,
|
||||
...);
|
||||
void xmlParserWarning (void *ctx,
|
||||
const char *msg,
|
||||
...);
|
||||
void xmlParserValidityError (void *ctx,
|
||||
const char *msg,
|
||||
...);
|
||||
void xmlParserValidityWarning(void *ctx,
|
||||
const char *msg,
|
||||
...);
|
||||
void xmlParserPrintFileInfo (xmlParserInputPtr input);
|
||||
void xmlParserPrintFileContext(xmlParserInputPtr input);
|
||||
#endif
|
||||
|
84
xmlIO.c
84
xmlIO.c
@ -6,10 +6,6 @@
|
||||
* Daniel.Veillard@w3.org
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: plug-in a generic transfer library, like libwww if available
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -24,10 +20,12 @@
|
||||
#endif
|
||||
#include <string.h>
|
||||
|
||||
#include "parser.h"
|
||||
#include "xmlIO.h"
|
||||
|
||||
/* #define DEBUG_INPUT */
|
||||
/* #define VERBOSE_FAILURE */
|
||||
/* #define DEBUG_EXTERNAL_ENTITIES */
|
||||
|
||||
#ifdef DEBUG_INPUT
|
||||
#define MINLEN 40
|
||||
@ -155,7 +153,7 @@ xmlParserInputBufferCreateFilename(const char *filename, xmlCharEncoding enc) {
|
||||
#endif
|
||||
}
|
||||
/*
|
||||
* TODO : get the 4 first bytes and
|
||||
* TODO : get the 4 first bytes and decode the charset
|
||||
* if enc == XML_CHAR_ENCODING_NONE
|
||||
* plug some encoding conversion routines here. !!!
|
||||
* enc = xmlDetectCharEncoding(buffer);
|
||||
@ -227,7 +225,7 @@ xmlParserInputBufferCreateFd(int fd, xmlCharEncoding enc) {
|
||||
*
|
||||
* Grow up the content of the input buffer, the old data are preserved
|
||||
* This routine handle the I18N transcoding to internal UTF-8
|
||||
* TODO: one should be able to remove one copy
|
||||
* TODO: one should be able to remove one extra copy
|
||||
*
|
||||
* Returns the number of chars read and stored in the buffer, or -1
|
||||
* in case of error.
|
||||
@ -289,7 +287,7 @@ xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len) {
|
||||
return(-1);
|
||||
}
|
||||
nbchars = in->encoder->input(buf, (res + 1) * 2 * sizeof(CHAR),
|
||||
buffer, res);
|
||||
BAD_CAST buffer, res);
|
||||
buf[nbchars] = 0;
|
||||
xmlBufferAdd(in->buffer, (CHAR *) buf, nbchars);
|
||||
free(buf);
|
||||
@ -364,3 +362,75 @@ xmlParserGetDirectory(const char *filename) {
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
* *
|
||||
* External entities loading *
|
||||
* *
|
||||
****************************************************************/
|
||||
|
||||
/*
|
||||
* xmlDefaultExternalEntityLoader:
|
||||
* @URL: the URL for the entity to load
|
||||
* @ID: the System ID for the entity to load
|
||||
* @context: the context in which the entity is called or NULL
|
||||
*
|
||||
* By default we don't load external entitites, yet.
|
||||
* TODO: get a sample http implementation and scan for existing one
|
||||
* at compile time.
|
||||
*
|
||||
* Returns a new allocated xmlParserInputPtr, or NULL.
|
||||
*/
|
||||
static
|
||||
xmlParserInputPtr
|
||||
xmlDefaultExternalEntityLoader(const char *URL, const char *ID,
|
||||
xmlParserInputPtr context) {
|
||||
#ifdef DEBUG_EXTERNAL_ENTITIES
|
||||
fprintf(stderr, "xmlDefaultExternalEntityLoader(%s, xxx)\n", URL);
|
||||
#endif
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
static xmlExternalEntityLoader xmlCurrentExternalEntityLoader =
|
||||
xmlDefaultExternalEntityLoader;
|
||||
|
||||
/*
|
||||
* xmlSetExternalEntityLoader:
|
||||
* @f: the new entity resolver function
|
||||
*
|
||||
* Changes the defaultexternal entity resolver function for the application
|
||||
*/
|
||||
void
|
||||
xmlSetExternalEntityLoader(xmlExternalEntityLoader f) {
|
||||
xmlCurrentExternalEntityLoader = f;
|
||||
}
|
||||
|
||||
/*
|
||||
* xmlGetExternalEntityLoader:
|
||||
*
|
||||
* Get the default external entity resolver function for the application
|
||||
*
|
||||
* Returns the xmlExternalEntityLoader function pointer
|
||||
*/
|
||||
xmlExternalEntityLoader
|
||||
xmlGetExternalEntityLoader(void) {
|
||||
return(xmlCurrentExternalEntityLoader);
|
||||
}
|
||||
|
||||
/*
|
||||
* xmlLoadExternalEntity:
|
||||
* @URL: the URL for the entity to load
|
||||
* @ID: the System ID for the entity to load
|
||||
* @context: the context in which the entity is called or NULL
|
||||
*
|
||||
* Load an external entity, note that the use of this function for
|
||||
* unparsed entities may generate problems
|
||||
* TODO: a more generic External entitiy API must be designed
|
||||
*
|
||||
* Returns the xmlParserInputPtr or NULL
|
||||
*/
|
||||
xmlParserInputPtr
|
||||
xmlLoadExternalEntity(const char *URL, const char *ID,
|
||||
xmlParserInputPtr context) {
|
||||
return(xmlCurrentExternalEntityLoader(URL, ID, context));
|
||||
}
|
||||
|
||||
|
27
xmlIO.h
27
xmlIO.h
@ -11,6 +11,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include "tree.h"
|
||||
#include "parser.h"
|
||||
#include "encoding.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -35,17 +36,21 @@ typedef xmlParserInputBuffer *xmlParserInputBufferPtr;
|
||||
* Interfaces
|
||||
*/
|
||||
|
||||
xmlParserInputBufferPtr xmlParserInputBufferCreateFilename(const char *filename,
|
||||
xmlCharEncoding enc);
|
||||
xmlParserInputBufferPtr xmlParserInputBufferCreateFile(FILE *file,
|
||||
xmlCharEncoding enc);
|
||||
xmlParserInputBufferPtr xmlParserInputBufferCreateFd(int fd, xmlCharEncoding enc);
|
||||
|
||||
int xmlParserInputBufferRead(xmlParserInputBufferPtr in, int len);
|
||||
int xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len);
|
||||
|
||||
void xmlFreeParserInputBuffer(xmlParserInputBufferPtr in);
|
||||
char *xmlParserGetDirectory(const char *filename);
|
||||
xmlParserInputBufferPtr
|
||||
xmlParserInputBufferCreateFilename (const char *filename,
|
||||
xmlCharEncoding enc);
|
||||
xmlParserInputBufferPtr
|
||||
xmlParserInputBufferCreateFile (FILE *file,
|
||||
xmlCharEncoding enc);
|
||||
xmlParserInputBufferPtr
|
||||
xmlParserInputBufferCreateFd (int fd,
|
||||
xmlCharEncoding enc);
|
||||
int xmlParserInputBufferRead (xmlParserInputBufferPtr in,
|
||||
int len);
|
||||
int xmlParserInputBufferGrow (xmlParserInputBufferPtr in,
|
||||
int len);
|
||||
void xmlFreeParserInputBuffer (xmlParserInputBufferPtr in);
|
||||
char * xmlParserGetDirectory (const char *filename);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
19
xpath.h
19
xpath.h
@ -62,7 +62,8 @@ typedef struct xmlXPathContext {
|
||||
xmlNodeSetPtr nodelist; /* The current node list */
|
||||
void *variables; /* TODO !!!! */
|
||||
void *functions; /* TODO !!!! */
|
||||
void *namespaces; /* TODO !!!! */
|
||||
xmlNsPtr *namespaces; /* The namespaces lookup */
|
||||
int nsNr; /* the current Namespace index */
|
||||
} xmlXPathContext, *xmlXPathContextPtr;
|
||||
|
||||
/*
|
||||
@ -96,12 +97,14 @@ typedef void (*xmlXPathFunction) (xmlXPathParserContextPtr ctxt, int nargs);
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
xmlXPathContextPtr xmlXPathNewContext(xmlDocPtr doc, void *variables,
|
||||
void *functions, void *namespaces);
|
||||
void xmlXPathFreeContext(xmlXPathContextPtr ctxt);
|
||||
xmlXPathObjectPtr xmlXPathEval(const CHAR *str, xmlXPathContextPtr ctxt);
|
||||
void xmlXPathFreeObject(xmlXPathObjectPtr obj);
|
||||
xmlXPathObjectPtr xmlXPathEvalExpression(const CHAR *str,
|
||||
xmlXPathContextPtr ctxt);
|
||||
xmlXPathContextPtr xmlXPathNewContext (xmlDocPtr doc,
|
||||
void *variables,
|
||||
void *functions);
|
||||
void xmlXPathFreeContext (xmlXPathContextPtr ctxt);
|
||||
xmlXPathObjectPtr xmlXPathEval (const CHAR *str,
|
||||
xmlXPathContextPtr ctxt);
|
||||
void xmlXPathFreeObject (xmlXPathObjectPtr obj);
|
||||
xmlXPathObjectPtr xmlXPathEvalExpression (const CHAR *str,
|
||||
xmlXPathContextPtr ctxt);
|
||||
|
||||
#endif /* ! __XML_XPATH_H__ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user