ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

xsltGetNamespace: : a transformation context : the input node : the namespace : the output node (or its parent)

Find a matching (prefix and ns-name) ns-declaration for the requested ->prefix and ->href in the result tree. If none is found then a new ns-declaration will be added to . If, in this case, the given prefix is already in use, then a ns-declaration with a modified ns-prefix be we created.

Called by:

Returns a namespace declaration or NULL in case of namespace fixup failures or API or internal errors.

Definition at line 634 of file namespaces.c.

Referenced by xsltApplySequenceConstructor(), xsltAttrListTemplateProcess(), xsltAttrTemplateProcess(), xsltGetPlainNamespace(), and xsltShallowCopyElem().

{    
    
    if (ns == NULL)
    return(NULL);

#ifdef XSLT_REFACTORED
    /*
    * Namespace exclusion and ns-aliasing is performed at
    * compilation-time in the refactored code.
    * Additionally, aliasing is not intended for non Literal
    * Result Elements.
    */
    return(xsltGetSpecialNamespace(ctxt, cur, ns->href, ns->prefix, out));
#else
    {
    xsltStylesheetPtr style;
    const xmlChar *URI = NULL; /* the replacement URI */

    if ((ctxt == NULL) || (cur == NULL) || (out == NULL))
        return(NULL);

    style = ctxt->style;
    while (style != NULL) {
        if (style->nsAliases != NULL)
        URI = (const xmlChar *) 
        xmlHashLookup(style->nsAliases, ns->href);
        if (URI != NULL)
        break;
        
        style = xsltNextImport(style);
    }
    
    
    if (URI == UNDEFINED_DEFAULT_NS) {
        return(xsltGetSpecialNamespace(ctxt, cur, NULL, NULL, out));
#if 0
        /*
        * TODO: Removed, since wrong. If there was no default
        * namespace in the stylesheet then this must resolve to
        * the NULL namespace.
        */
        xmlNsPtr dflt;      
        dflt = xmlSearchNs(cur->doc, cur, NULL);
        if (dflt != NULL)
        URI = dflt->href;
        else
        return NULL;
#endif
    } else if (URI == NULL)
        URI = ns->href;

    return(xsltGetSpecialNamespace(ctxt, cur, URI, ns->prefix, out));
    }
#endif
}

Generated on Sat May 26 2012 04:48:44 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.