• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/libxslt-13/libxslt/libxslt/

Lines Matching refs:ns

203      * Store the ns-node in the alias-object.
323 * Find a matching (prefix and ns-name) ns-declaration
325 * If none is found then a new ns-declaration will be
327 * already in use, then a ns-declaration with a modified ns-prefix
329 * preserve ns-prefixes; it will only change a prefix if there's
341 xmlNsPtr ns;
349 * NOTE: Namespace exclusion and ns-aliasing is performed at
360 * the ns-decls currently in-scope via a specialized context.
371 * the ns-decls currently in-scope via a specialized context.
377 ns = target->nsDef;
379 if (ns->prefix == NULL) {
380 if ((ns->href != NULL) && (ns->href[0] != 0)) {
388 "'%s'.\n", ns->href, target->name);
399 ns = ns->next;
400 } while (ns != NULL);
409 if (target->parent->ns == NULL)
412 ns = xmlSearchNs(target->doc, target->parent,
415 * Fine if there's no default ns is scope, or if the
416 * default ns was undeclared.
418 if ((ns == NULL) || (ns->href == NULL) || (ns->href[0] == 0))
444 ns = target->nsDef;
446 if ((ns->prefix == NULL) == (nsPrefix == NULL)) {
447 if (ns->prefix == nsPrefix) {
448 if (xmlStrEqual(ns->href, nsName))
449 return(ns);
452 } else if (xmlStrEqual(ns->prefix, nsPrefix)) {
453 if (xmlStrEqual(ns->href, nsName))
454 return(ns);
459 ns = ns->next;
460 } while (ns != NULL);
464 * If the ns-prefix is occupied by an other ns-decl on the
469 * Try a desperate search for an in-scope ns-decl
470 * with a matching ns-name before we use the last option,
471 * which is to recreate the ns-decl with a modified prefix.
473 ns = xmlSearchNsByHref(target->doc, target, nsName);
474 if (ns != NULL)
475 return(ns);
484 * Try to find a matching ns-decl in the ancestor-axis.
487 * result element is in the same namespace (with an equal ns-prefix).
489 if ((target->parent->ns != NULL) &&
490 ((target->parent->ns->prefix != NULL) == (nsPrefix != NULL)))
492 ns = target->parent->ns;
495 if (xmlStrEqual(ns->href, nsName))
496 return(ns);
497 } else if (xmlStrEqual(ns->prefix, nsPrefix) &&
498 xmlStrEqual(ns->href, nsName))
500 return(ns);
506 ns = xmlSearchNs(target->doc, target->parent, nsPrefix);
507 if (ns != NULL) {
508 if (xmlStrEqual(ns->href, nsName))
509 return(ns);
512 * ns-decl won't shadow a prefix in-use by an existing attribute.
523 if ((attr->ns) &&
524 xmlStrEqual(attr->ns->prefix, nsPrefix))
529 * a search for a matching ns-decl based on the
532 ns = xmlSearchNsByHref(target->doc, target, nsName);
533 if (ns != NULL)
534 return(ns);
542 * Either no matching ns-prefix was found or the namespace is
544 * Create a new ns-decl on the current result element.
547 * namespace with a matching ns-name but a different
548 * ns-prefix.
550 * 1) If keeping the prefix: create a new ns-decl.
551 * 2) If reusal: first lookup ns-names; then fallback
552 * to creation of a new ns-decl.
558 ns = xmlSearchNsByHref(target->doc, target, nsName);
559 if (ns != NULL)
560 return(ns);
564 * Create the ns-decl on the current result element.
566 ns = xmlNewNs(target, nsName, nsPrefix);
568 return(ns);
573 ns = xmlNewNs(target, nsName, nsPrefix);
575 return(ns);
588 nsPrefix = BAD_CAST "ns";
593 ns = xmlSearchNs(target->doc, target, BAD_CAST pref);
597 "Failed to compute a unique ns-prefix for the "
601 } while (ns != NULL);
602 ns = xmlNewNs(target, nsName, BAD_CAST pref);
604 return(ns);
613 * @ns: the namespace
616 * Find a matching (prefix and ns-name) ns-declaration
617 * for the requested @ns->prefix and @ns->href in the result tree.
618 * If none is found then a new ns-declaration will be
620 * already in use, then a ns-declaration with a modified ns-prefix
634 xsltGetNamespace(xsltTransformContextPtr ctxt, xmlNodePtr cur, xmlNsPtr ns,
638 if (ns == NULL)
643 * Namespace exclusion and ns-aliasing is performed at
648 return(xsltGetSpecialNamespace(ctxt, cur, ns->href, ns->prefix, out));
661 xmlHashLookup(style->nsAliases, ns->href);
685 URI = ns->href;
687 return(xsltGetSpecialNamespace(ctxt, cur, URI, ns->prefix, out));
696 * @ns: the namespace
708 xmlNsPtr ns, xmlNodePtr out)
710 return(xsltGetNamespace(ctxt, cur, ns, out));
723 * transformation-time for copying ns-declarations of Literal
760 if ((node->ns != NULL) &&
761 (xmlStrEqual(node->ns->prefix, cur->prefix)) &&
762 (xmlStrEqual(node->ns->href, cur->href))) {
774 * Namespace exclusion and ns-aliasing is performed at
817 * @ns: the namespace node
826 xmlNodePtr elem, xmlNsPtr ns)
828 if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL))
834 return(xmlNewNs(NULL, ns->href, ns->prefix));
836 return(xmlNewNs(elem, ns->href, ns->prefix));