org.apache.xml.utils

## Interface PrefixResolver

- All Known Implementing Classes:
    DecimalFormatProperties, ElemApplyImport, ElemApplyTemplates, ElemAttribute, ElemAttributeSet, ElemCallTemplate, ElemChoose, ElemComment, ElemCopy, ElemCopyOf, ElemElement, ElemEmpty, ElemExsltFuncResult, ElemExsltFunction, ElemExtensionCall, ElemExtensionDecl, ElemExtensionScript, ElemFallback, ElemForEach, ElemIf, ElemLiteralResult, ElemMessage, ElemNumber, ElemOtherwise, ElemParam, ElemPI, ElemSort, ElemTemplate, ElemTemplateElement, ElemText, ElemTextLiteral, ElemUnknown, ElemUse, ElemValueOf, ElemVariable, ElemVariablePsuedo, ElemWhen, ElemWithParam, JAXPPrefixResolver, KeyDeclaration, NamespaceAlias, OutputProperties, PrefixResolverDefault, ProcessorCharacters, ProcessorExsltFuncResult, ProcessorExsltFunction, ProcessorImport, ProcessorInclude, ProcessorLRE, ProcessorStylesheetDoc, ProcessorStylesheetElement, ProcessorTemplateElem, ProcessorText, ProcessorUnknown, Stylesheet, StylesheetComposed, StylesheetHandler, StylesheetRoot, WhiteSpaceInfo, WhitespaceInfoPaths, XSLTElementProcessor

      public interface PrefixResolver

  The class that implements this interface can resolve prefixes to namespaces. Examples would include resolving the meaning of a prefix at a particular point in a document, or mapping the prefixes used in an XPath expression.
  Usage:
    **For advanced use only**

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getBaseIdentifier()` Return the base identifier.
    `java.lang.String` | `getNamespaceForPrefix(java.lang.String prefix)` Given a namespace, get the corrisponding prefix.
    `java.lang.String` | `getNamespaceForPrefix(java.lang.String prefix, org.w3c.dom.Node context)` Given a namespace, get the corresponding prefix, based on the context node.
    `boolean` | `handlesNullPrefixes()`

- - ### Method Detail

    - #### getNamespaceForPrefix

          java.lang.String getNamespaceForPrefix(java.lang.String prefix)

      Given a namespace, get the corrisponding prefix. This assumes that the PrefixResolver holds its own namespace context, or is a namespace context itself.
      Parameters:
        `prefix` - The prefix to look up, which may be an empty string ("") for the default Namespace.
      Returns:
        The associated Namespace URI, or null if the prefix is undeclared in this context.

    - #### getNamespaceForPrefix

          java.lang.String getNamespaceForPrefix(java.lang.String prefix,
                                                 org.w3c.dom.Node context)

      Given a namespace, get the corresponding prefix, based on the context node.
      Parameters:
        `prefix` - The prefix to look up, which may be an empty string ("") for the default Namespace.
        `context` - The node context from which to look up the URI.
      Returns:
        The associated Namespace URI as a string, or null if the prefix is undeclared in this context.

    - #### getBaseIdentifier

          java.lang.String getBaseIdentifier()

      Return the base identifier.
      Returns:
        The base identifier from where relative URIs should be absolutized, or null if the base ID is unknown.

        CAVEAT: Note that the base URI in an XML document may vary with where you are in the document, if part of the doc's contents were brought in via an external entity reference or if mechanisms such as xml:base have been used. Unless this PrefixResolver is bound to a specific portion of the document, or has been kept up to date via some other mechanism, it may not accurately reflect that context information.

    - #### handlesNullPrefixes

          boolean handlesNullPrefixes()

Copyright © 2023 Apache XML Project. All Rights Reserved.