Uses of Interface javax.xml.namespace.NamespaceContext (Java Platform SE 8 )
Date: 2026-04-22

## Uses of Interface
javax.xml.namespace.NamespaceContext

- Packages that use NamespaceContext
  Package | Description
  --- | ---
  javax.xml.bind | Provides a runtime binding framework for client applications including unmarshalling, marshalling, and validation capabilities.
  javax.xml.stream |
  javax.xml.stream.events |
  javax.xml.stream.util |
  javax.xml.xpath | This package provides an object-model neutral API for the evaluation of XPath expressions and access to the evaluation environment.

- - ### Uses of NamespaceContext in javax.xml.bind

    Methods in javax.xml.bind with parameters of type NamespaceContext
    Modifier and Type | Method and Description
    --- | ---
    `static QName` | DatatypeConverter.`parseQName(String lexicalXSDQName, NamespaceContext nsc)` Converts the string argument into a byte value.
    `QName` | DatatypeConverterInterface.`parseQName(String lexicalXSDQName, NamespaceContext nsc)` Converts the string argument into a QName value.
    `static String` | DatatypeConverter.`printQName(QName val, NamespaceContext nsc)` Converts a QName instance into a string.
    `String` | DatatypeConverterInterface.`printQName(QName val, NamespaceContext nsc)` Converts a QName instance into a string.

  - ### Uses of NamespaceContext in javax.xml.stream

    Methods in javax.xml.stream that return NamespaceContext
    Modifier and Type | Method and Description
    --- | ---
    `NamespaceContext` | XMLStreamReader.`getNamespaceContext()` Returns a read only namespace context for the current position.
    `NamespaceContext` | XMLStreamWriter.`getNamespaceContext()` Returns the current namespace context.
    `NamespaceContext` | XMLEventWriter.`getNamespaceContext()` Returns the current namespace context.

    Methods in javax.xml.stream with parameters of type NamespaceContext
    Modifier and Type | Method and Description
    --- | ---
    `abstract StartElement` | XMLEventFactory.`createStartElement(String prefix, String namespaceUri, String localName, Iterator attributes, Iterator namespaces, NamespaceContext context)` Create a new StartElement.
    `void` | XMLStreamWriter.`setNamespaceContext(NamespaceContext context)` Sets the current namespace context for prefix and uri bindings.
    `void` | XMLEventWriter.`setNamespaceContext(NamespaceContext context)` Sets the current namespace context for prefix and uri bindings.

  - ### Uses of NamespaceContext in javax.xml.stream.events

    Methods in javax.xml.stream.events that return NamespaceContext
    Modifier and Type | Method and Description
    --- | ---
    `NamespaceContext` | StartElement.`getNamespaceContext()` Gets a read-only namespace context.

  - ### Uses of NamespaceContext in javax.xml.stream.util

    Methods in javax.xml.stream.util that return NamespaceContext
    Modifier and Type | Method and Description
    --- | ---
    `NamespaceContext` | StreamReaderDelegate.`getNamespaceContext()`

  - ### Uses of NamespaceContext in javax.xml.xpath

    Methods in javax.xml.xpath that return NamespaceContext
    Modifier and Type | Method and Description
    --- | ---
    `NamespaceContext` | XPath.`getNamespaceContext()` Return the current namespace context.

    Methods in javax.xml.xpath with parameters of type NamespaceContext
    Modifier and Type | Method and Description
    --- | ---
    `void` | XPath.`setNamespaceContext(NamespaceContext nsContext)` Establish a namespace context.

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.