Package org.basex.query.util
Class NSContext
java.lang.Object
org.basex.query.util.NSContext
This class references all statically known namespaces.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(byte[] prefix, byte[] uri) Adds a namespace to the namespace stack.voidValidates and adds the specified namespace at parsing time.voiddelete(byte[] prefix) Deletes the specified namespace at parsing time.voidAdds the namespaces that are currently in scope.intsize()Returns the number of dynamic namespaces.voidsize(int size) Sets the number of dynamic namespaces.stack()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.
-
Field Details
-
list
Static namespaces, containing prefixes and URIs.
-
-
Constructor Details
-
NSContext
public NSContext()
-
-
Method Details
-
add
Validates and adds the specified namespace at parsing time.- Parameters:
prefix- namespace prefixuri- namespace URIii- 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 prefixuri- namespace URI
-
stack
Returns the namespace stack.- Returns:
- stack
-
inScope
Adds the namespaces that are currently in scope.- Parameters:
atts- namespaces
-