Class NSContext

java.lang.Object
org.basex.query.util.NSContext

public final class NSContext extends Object
This class references all statically known namespaces.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final Atts
    Static namespaces, containing prefixes and URIs.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(byte[] prefix, byte[] uri)
    Adds a namespace to the namespace stack.
    void
    add(byte[] prefix, byte[] uri, InputInfo ii)
    Validates and adds the specified namespace at parsing time.
    void
    delete(byte[] prefix)
    Deletes the specified namespace at parsing time.
    void
    inScope(Atts atts)
    Adds the namespaces that are currently in scope.
    int
    Returns the number of dynamic namespaces.
    void
    size(int size)
    Sets the number of dynamic namespaces.
    Returns the namespace stack.
    byte[]
    staticURI(byte[] prefix)
    Finds the namespace URI for the specified prefix if it is found in statically declared namespaces.
    byte[]
    uri(byte[] prefix)
    Returns the namespace URI for the specified prefix if it is either found in the dynamic, static or predefined namespaces.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • list

      public final Atts list
      Static namespaces, containing prefixes and URIs.
  • Constructor Details

    • NSContext

      public NSContext()
  • Method Details

    • add

      public void add(byte[] prefix, byte[] uri, InputInfo ii) throws QueryException
      Validates and adds the specified namespace at parsing time.
      Parameters:
      prefix - namespace prefix
      uri - namespace URI
      ii - input info
      Throws:
      QueryException - query exception
    • delete

      public void delete(byte[] prefix)
      Deletes the specified namespace at parsing time.
      Parameters:
      prefix - namespace prefix
    • staticURI

      public byte[] staticURI(byte[] prefix)
      Finds the namespace URI for the specified prefix if it is found in statically declared namespaces.
      Parameters:
      prefix - prefix of the namespace
      Returns:
      uri or null
    • uri

      public byte[] uri(byte[] prefix)
      Returns the namespace URI for the specified prefix if it is either found in the dynamic, static or predefined namespaces.
      Parameters:
      prefix - prefix of the namespace
      Returns:
      namespace URI or null
    • size

      public int size()
      Returns the number of dynamic namespaces.
      Returns:
      namespaces
    • size

      public void size(int size)
      Sets the number of dynamic namespaces.
      Parameters:
      size - number of namespaces
    • add

      public void add(byte[] prefix, byte[] uri)
      Adds a namespace to the namespace stack.
      Parameters:
      prefix - namespace prefix
      uri - namespace URI
    • stack

      public Atts stack()
      Returns the namespace stack.
      Returns:
      stack
    • inScope

      public void inScope(Atts atts)
      Adds the namespaces that are currently in scope.
      Parameters:
      atts - namespaces