xmlNodePtr child;
xsltAttrElemPtr attrItems;
- if ((cur == NULL) || (style == NULL))
+ if ((cur == NULL) || (style == NULL) || (cur->type != XML_ELEMENT_NODE))
return;
value = xmlGetNsProp(cur, (const xmlChar *)"name", NULL);
xmlNsPtr ns = NULL;
xmlAttrPtr attr;
- if ((ctxt == NULL) || (contextNode == NULL) || (inst == NULL))
+ if ((ctxt == NULL) || (contextNode == NULL) || (inst == NULL) ||
+ (inst->type != XML_ELEMENT_NODE) )
return;
/*
#else
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
comp = (xsltStyleItemCopyPtr) xsltNewStylePreComp(style, XSLT_FUNC_COPY);
#endif
const xmlChar *prop;
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
* <!-- Content: template -->
* </xsl:element>
*/
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
* <!-- Content: template -->
* </xsl:attribute>
*/
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
#endif
const xmlChar *prop;
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
#endif
const xmlChar *prop;
- if ((style == NULL) || (cur == NULL))
+ if ((style == NULL) || (cur == NULL) || (cur->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltStylePreCompPtr comp;
#endif
- if ((style == NULL) || (inst == NULL))
+ if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
* the parsing mechanism for all elements in the XSLT namespace.
*/
if (style == NULL) {
- if (node != NULL)
+ if ((node != NULL) && (node->type == XML_ELEMENT_NODE))
node->psvi = NULL;
return;
}
* namespace- and local-name of the node, but can evaluate this
* using cctxt->style->inode->category;
*/
- if (inst->psvi != NULL)
+ if ((inst == NULL) || (inst->type != XML_ELEMENT_NODE) ||
+ (inst->psvi != NULL))
return;
if (IS_XSLT_ELEM(inst)) {
xmlNodePtr oldInsert, insert = NULL;
xmlChar *ret;
- if ((ctxt == NULL) || (contextNode == NULL) || (inst == NULL))
+ if ((ctxt == NULL) || (contextNode == NULL) || (inst == NULL) ||
+ (inst->type != XML_ELEMENT_NODE))
return(NULL);
if (inst->children == NULL)
xmlChar *ret;
xmlChar *expr;
- if ((ctxt == NULL) || (inst == NULL) || (name == NULL))
+ if ((ctxt == NULL) || (inst == NULL) || (name == NULL) ||
+ (inst->type != XML_ELEMENT_NODE))
return(NULL);
expr = xsltGetNsProp(inst, name, ns);
const xmlChar *ret;
xmlChar *expr;
- if ((style == NULL) || (inst == NULL) || (name == NULL))
+ if ((style == NULL) || (inst == NULL) || (name == NULL) ||
+ (inst->type != XML_ELEMENT_NODE))
return(NULL);
expr = xsltGetNsProp(inst, name, ns);
const xmlChar *value;
xmlAttrPtr ret;
- if ((ctxt == NULL) || (attr == NULL) || (target == NULL))
+ if ((ctxt == NULL) || (attr == NULL) || (target == NULL) ||
+ (target->type != XML_ELEMENT_NODE))
return(NULL);
if (attr->type != XML_ATTRIBUTE_NODE)
const xmlChar *value;
xmlChar *valueAVT;
- if ((ctxt == NULL) || (target == NULL) || (attrs == NULL))
+ if ((ctxt == NULL) || (target == NULL) || (attrs == NULL) ||
+ (target->type != XML_ELEMENT_NODE))
return(NULL);
oldInsert = ctxt->insert;
#endif
/*
- * Play save and reset the merging mechanism for every new
+ * Play safe and reset the merging mechanism for every new
* target node.
*/
if ((target == NULL) || (target->children == NULL)) {
the instruction itself. */
xsltStackElemPtr param = NULL;
- if ((ctxt == NULL) || (inst == NULL))
+ if ((ctxt == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return(NULL);
#ifdef XSLT_REFACTORED
xsltStylePreCompPtr comp;
#endif
- if ((cur == NULL) || (style == NULL))
+ if ((cur == NULL) || (style == NULL) || (cur->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltStylePreCompPtr comp;
#endif
- if ((cur == NULL) || (style == NULL))
+ if ((cur == NULL) || (style == NULL) || (cur->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
xsltStylePreCompPtr comp;
#endif
- if ((inst == NULL) || (ctxt == NULL))
+ if ((inst == NULL) || (ctxt == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
comp = inst->psvi;
xsltStylePreCompPtr comp;
#endif
- if ((cur == NULL) || (ctxt == NULL))
+ if ((cur == NULL) || (ctxt == NULL) || (cur->type != XML_ELEMENT_NODE))
return;
comp = cur->psvi;
xmlChar *element,
*end;
- if ((cur == NULL) || (style == NULL))
+ if ((cur == NULL) || (style == NULL) || (cur->type != XML_ELEMENT_NODE))
return;
-
+
prop = xmlGetNsProp(cur, (const xmlChar *) "version", NULL);
if (prop != NULL) {
if (style->version != NULL)
xmlChar *prop;
xsltDecimalFormatPtr format;
xsltDecimalFormatPtr iter;
-
- if ((cur == NULL) || (style == NULL))
+
+ if ((cur == NULL) || (style == NULL) || (cur->type != XML_ELEMENT_NODE))
return;
format = style->decimalFormat;
-
+
prop = xmlGetNsProp(cur, BAD_CAST("name"), NULL);
if (prop != NULL) {
format = xsltDecimalFormatGetByName(style, prop);
xmlChar *elements;
xmlChar *element, *end;
- if ((cur == NULL) || (style == NULL))
+ if ((cur == NULL) || (style == NULL) || (cur->type != XML_ELEMENT_NODE))
return;
elements = xmlGetNsProp(cur, (const xmlChar *)"elements", NULL);
xmlChar *prefixes;
xmlChar *prefix, *end;
- if ((cur == NULL) || (style == NULL))
+ if ((cur == NULL) || (style == NULL) || (cur->type != XML_ELEMENT_NODE))
return;
if (isXsltElem) {
xmlChar *elements;
xmlChar *element, *end;
- if ((cur == NULL) || (style == NULL))
+ if ((cur == NULL) || (style == NULL) || (cur->type != XML_ELEMENT_NODE))
return;
elements = xmlGetNsProp(cur, (const xmlChar *)"elements", NULL);
xmlChar *prefixes;
xmlChar *prefix, *end;
- if ((cur == NULL) || (style == NULL))
+ if ((cur == NULL) || (style == NULL) || (cur->type != XML_ELEMENT_NODE))
return(0);
if (isXsltElem)
xsltParseUnknownXSLTElem(xsltCompilerCtxtPtr cctxt,
xmlNodePtr node)
{
- if ((cctxt == NULL) || (node == NULL))
+ if ((cctxt == NULL) || (node == NULL) || (node->type != XML_ELEMENT_NODE))
return(-1);
/*
if (cctxt->inode->category == XSLT_ELEMENT_CATEGORY_EXTENSION) {
cctxt->inode->extContentHandled = 1;
}
- if (cur == NULL)
+ if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
return;
/*
* This is the content reffered to as a "template".
*/
void
xsltParseTemplateContent(xsltStylesheetPtr style, xmlNodePtr templ) {
- if ((style == NULL) || (templ == NULL))
+ if ((style == NULL) || (templ == NULL) ||
+ (templ->type == XML_NAMESPACE_DECL))
return;
/*
void
xsltParseTemplateContent(xsltStylesheetPtr style, xmlNodePtr templ) {
xmlNodePtr cur, delete;
+
+ if ((style == NULL) || (templ == NULL) ||
+ (templ->type == XML_NAMESPACE_DECL)) return;
+
/*
* This content comes from the stylesheet
* For stylesheets, the set of whitespace-preserving
xmlChar *name = NULL;
xmlChar *nameURI = NULL;
- if ((style == NULL) || (key == NULL))
+ if ((style == NULL) || (key == NULL) || (key->type != XML_ELEMENT_NODE))
return;
/*
xmlChar *prop;
double priority;
- if ((cctxt == NULL) || (templNode == NULL))
+ if ((cctxt == NULL) || (templNode == NULL) ||
+ (templNode->type != XML_ELEMENT_NODE))
return;
/*
xmlChar *modeURI = NULL;
double priority;
- if (template == NULL)
+ if ((style == NULL) || (template == NULL) ||
+ (template->type != XML_ELEMENT_NODE))
return;
/*
xsltCompileXSLTIncludeElem(xsltCompilerCtxtPtr cctxt, xmlNodePtr node) {
xsltStyleItemIncludePtr item;
- if ((cctxt == NULL) || (node == NULL))
+ if ((cctxt == NULL) || (node == NULL) || (node->type != XML_ELEMENT_NODE))
return(NULL);
node->psvi = NULL;
{
xmlNodePtr cur, start;
- if ((cctxt == NULL) || (node == NULL))
+ if ((cctxt == NULL) || (node == NULL) || (node->type != XML_ELEMENT_NODE))
return(-1);
if (node->children == NULL)
int templates = 0;
#endif
- if (top == NULL)
+ if ((top == NULL) || (top->type != XML_ELEMENT_NODE))
return;
prop = xmlGetNsProp(top, (const xmlChar *)"version", NULL);
if ((node == NULL) || (style == NULL) || (style->dict == NULL))
return(NULL);
- prop = node->properties;
- if (nameSpace == NULL) {
+ if (nameSpace == NULL)
return xmlGetProp(node, name);
- }
+
+ if (node->type == XML_NAMESPACE_DECL)
+ return(NULL);
+ if (node->type == XML_ELEMENT_NODE)
+ prop = node->properties;
+ else
+ prop = NULL;
while (prop != NULL) {
/*
* One need to have
attrDecl = xmlGetDtdAttrDesc(doc->intSubset, node->name, name);
if ((attrDecl == NULL) && (doc->extSubset != NULL))
attrDecl = xmlGetDtdAttrDesc(doc->extSubset, node->name, name);
-
+
if ((attrDecl != NULL) && (attrDecl->prefix != NULL)) {
/*
* The DTD declaration only allows a prefix search
if (node == NULL)
return(NULL);
- prop = node->properties;
+ if (nameSpace == NULL)
+ return xmlGetProp(node, name);
+
+ if (node->type == XML_NAMESPACE_DECL)
+ return(NULL);
+ if (node->type == XML_ELEMENT_NODE)
+ prop = node->properties;
+ else
+ prop = NULL;
/*
* TODO: Substitute xmlGetProp() for xmlGetNsProp(), since the former
* is not namespace-aware and will return an attribute with equal
* So this would return "myName" even if an attribute @name
* in the XSLT was requested.
*/
- if (nameSpace == NULL)
- return(xmlGetProp(node, name));
while (prop != NULL) {
/*
* One need to have
attrDecl = xmlGetDtdAttrDesc(doc->intSubset, node->name, name);
if ((attrDecl == NULL) && (doc->extSubset != NULL))
attrDecl = xmlGetDtdAttrDesc(doc->extSubset, node->name, name);
-
+
if ((attrDecl != NULL) && (attrDecl->prefix != NULL)) {
/*
* The DTD declaration only allows a prefix search