org.basex.query.util
Class NSContext

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

public final class NSContext
extends java.lang.Object

This class references all statically known namespaces.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen

Constructor Summary
NSContext()
           
 
Method Summary
 void add(byte[] pref, byte[] uri)
          Adds a namespace to the namespace stack.
 void add(byte[] pref, byte[] uri, InputInfo ii)
          Validates and adds the specified namespace at parsing time.
 void delete(byte[] pref)
          Deletes the specified namespace at parsing time.
 int size()
          Returns the number of dynamic namespaces.
 void size(int s)
          Sets the number of dynamic namespaces.
 Atts stack()
          Returns the namespace stack.
 byte[] staticURI(byte[] pref)
          Finds the namespace URI for the specified prefix, if it is found in statically declared namespaces.
 byte[] uri(byte[] pref)
          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
 

Constructor Detail

NSContext

public NSContext()
Method Detail

add

public void add(byte[] pref,
                byte[] uri,
                InputInfo ii)
         throws QueryException
Validates and adds the specified namespace at parsing time.

Parameters:
pref - namespace prefix
uri - namespace URI
ii - input info
Throws:
QueryException - query exception

delete

public void delete(byte[] pref)
Deletes the specified namespace at parsing time.

Parameters:
pref - namespace prefix

staticURI

public byte[] staticURI(byte[] pref)
Finds the namespace URI for the specified prefix, if it is found in statically declared namespaces.

Parameters:
pref - prefix of the namespace
Returns:
uri or null

uri

public byte[] uri(byte[] pref)
Returns the namespace URI for the specified prefix, if it is either found in the dynamic, static or predefined namespaces.

Parameters:
pref - 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 s)
Sets the number of dynamic namespaces.

Parameters:
s - namespaces

add

public void add(byte[] pref,
                byte[] uri)
Adds a namespace to the namespace stack.

Parameters:
pref - namespace prefix
uri - namespace URI

stack

public Atts stack()
Returns the namespace stack.

Returns:
stack