org.apache.xalan.templates
Class AVT
java.lang.Object
org.apache.xalan.templates.AVT
- java.io.Serializable, XSLTVisitable
public class AVT
extends java.lang.Object
Class to hold an Attribute Value Template.
AVT(StylesheetHandler handler, String uri, String name, String rawName, String stringedValue, ElemTemplateElement owner) - Construct an AVT by parsing the string, and either
constructing a vector of AVTParts, or simply hold
on to the string if the AVT is simple.
|
void | callVisitors(XSLTVisitor visitor)
|
boolean | canTraverseOutsideSubtree() - Tell if this expression or it's subexpressions can traverse outside
the current subtree.
|
String | evaluate(XPathContext xctxt, int context, PrefixResolver nsNode) - Evaluate the AVT and return a String.
|
void | fixupVariables(Vector vars, int globalsSize) - This function is used to fixup variables from QNames to stack frame
indexes at stylesheet build time.
|
String | getName() - Get the local name of the attribute.
|
String | getRawName() - Get the raw name of the attribute, with the prefix unprocessed.
|
String | getSimpleString() - Get the AVT as the original string.
|
String | getURI() - Get the namespace URI of the attribute.
|
boolean | isContextInsensitive() - Test whether the AVT is insensitive to the context in which
it is being evaluated.
|
boolean | isSimple() - Returns true if this AVT is simple
|
void | setName(String name) - Set the local name of the attribute.
|
void | setRawName(String rawName) - Get the raw name of the attribute, with the prefix unprocessed.
|
void | setURI(String uri) - Get the namespace URI of the attribute.
|
AVT
public AVT(StylesheetHandler handler,
String uri,
String name,
String rawName,
String stringedValue,
ElemTemplateElement owner)
throws TransformerException
Construct an AVT by parsing the string, and either
constructing a vector of AVTParts, or simply hold
on to the string if the AVT is simple.
handler
- non-null reference to StylesheetHandler that is constructing.uri
- non-null reference to URI, "" if null namespace.name
- non-null reference to name string.rawName
- prefixed name.stringedValue
- non-null raw string value.
canTraverseOutsideSubtree
public boolean canTraverseOutsideSubtree()
Tell if this expression or it's subexpressions can traverse outside
the current subtree.
- true if traversal outside the context node's subtree can occur.
evaluate
public String evaluate(XPathContext xctxt,
int context,
PrefixResolver nsNode)
throws TransformerException
Evaluate the AVT and return a String.
xctxt
- Te XPathContext to use to evaluate this.context
- The current source tree context.nsNode
- The current namespace context (stylesheet tree context).
- The AVT evaluated as a string
fixupVariables
public void fixupVariables(Vector vars,
int globalsSize)
This function is used to fixup variables from QNames to stack frame
indexes at stylesheet build time.
vars
- List of QNames that correspond to variables. This list
should be searched backwards for the first qualified name that
corresponds to the variable reference qname. The position of the
QName in the vector from the start of the vector will be its position
in the stack frame (but variables above the globalsTop value will need
to be offset to the current stack frame).
getName
public String getName()
Get the local name of the attribute.
- non-null reference to name string.
getRawName
public String getRawName()
Get the raw name of the attribute, with the prefix unprocessed.
- non-null reference to prefixed name.
getSimpleString
public String getSimpleString()
Get the AVT as the original string.
- The AVT as the original string
getURI
public String getURI()
Get the namespace URI of the attribute.
- non-null reference to URI, "" if null namespace.
isContextInsensitive
public boolean isContextInsensitive()
Test whether the AVT is insensitive to the context in which
it is being evaluated. This is intended to facilitate
compilation of templates, by allowing simple AVTs to be
converted back into strings.
Currently the only case we recognize is simple strings.
ADDED 9/5/2000 to support compilation experiment
- True if the m_simpleString member of this AVT is not null
isSimple
public boolean isSimple()
Returns true if this AVT is simple
setName
public void setName(String name)
Set the local name of the attribute.
name
- non-null reference to name string.
setRawName
public void setRawName(String rawName)
Get the raw name of the attribute, with the prefix unprocessed.
rawName
- non-null reference to prefixed name.
setURI
public void setURI(String uri)
Get the namespace URI of the attribute.
uri
- non-null reference to URI, "" if null namespace.
Copyright B) 2005 Apache XML Project. All Rights Reserved.