This class represents an XSLObject in the style tree. It is the most
basic of all XSLObjects and contains common functionality
across different XSLObjects. I originally had this implemented
as an extended W3C DOM XML Element, but due to problems with
extending different implementations, and to make it more
cross-DOM accessible I've chosen an this approach. Since this once
was a DOM Element, you will notice many of the methods are
very DOM-like.
APPLY_IMPORTS
public static final short APPLY_IMPORTS
- 0
APPLY_TEMPLATES
public static final short APPLY_TEMPLATES
- 1
ARG
public static final short ARG
- 2
ATTRIBUTE
public static final short ATTRIBUTE
- 3
ATTRIBUTE_SET
public static final short ATTRIBUTE_SET
- 4
CALL_TEMPLATE
public static final short CALL_TEMPLATE
- 5
CDATA
public static final short CDATA
- 6
CHOOSE
public static final short CHOOSE
- 7
COMMENT
public static final short COMMENT
- 8
CONTENTS
public static final short CONTENTS
- 9
COPY
public static final short COPY
- 10
COPY_OF
public static final short COPY_OF
- 11
ELEMENT
public static final short ELEMENT
- 12
ENTITY_REF
public static final short ENTITY_REF
- 38
FOR_EACH
public static final short FOR_EACH
- 13
FUNCTIONS
public static final short FUNCTIONS
- 14
ID
public static final short ID
- 15
IF
public static final short IF
- 16
IMPORT
public static final short IMPORT
- 17
INCLUDE
public static final short INCLUDE
- 18
KEY
public static final short KEY
- 19
LITERAL
public static final short LITERAL
- 20
LOCALE
public static final short LOCALE
- 21
MESSAGE
public static final short MESSAGE
- 22
NUMBER
public static final short NUMBER
- 23
OTHERWISE
public static final short OTHERWISE
- 24
OUTPUT
public static final short OUTPUT
- 25
PARAM
public static final short PARAM
- 26
PI
public static final short PI
- 27
PRESERVE_SPACE
public static final short PRESERVE_SPACE
- 28
SCRIPT
public static final short SCRIPT
- 39
SORT
public static final short SORT
- 29
STRIP_SPACE
public static final short STRIP_SPACE
- 30
STYLESHEET
public static final short STYLESHEET
- 31
TEMPLATE
public static final short TEMPLATE
- 32
TEXT
public static final short TEXT
- 33
VALUE_OF
public static final short VALUE_OF
- 34
VARIABLE
public static final short VARIABLE
- 35
WHEN
public static final short WHEN
- 36
WITH_PARAM
public static final short WITH_PARAM
- 37
appendAction
public boolean appendAction(XSLObject xslObject)
Appends the given XSLObject to this XSLObject's list of
actions.
xslObject
- the XSLObject to add to this XSLObject's
list of actions
- true if the given XSLObject has been added to this
XSLObject otherwise false
appendText
public void appendText(String text)
Appends the text to this XSLObject. This is slightly more efficient
than using appendAction(new XSLText(text)) if the last child
is already an XSLText object. Otherwise there is no difference.
text
- the text to append
appendText
public void appendText(char[] chars,
int start,
int length)
Appends the text to this XSLObject. This is slightly more efficient
than using appendAction(new XSLText(text)) if the last child
is already an XSLText object. Otherwise there is no difference.
getActions
public ActionTemplate getActions()
Returns the list of actions for this XSLObject
- the list of actions for this XSLObject
getAttribute
public String getAttribute(String name)
Returns the value of the attribute whose name is equal to the given name.
- the value of the attribute whose name is equal to the given name
or null if no attribute exist's with such a name.
getAttributes
public AttributeList getAttributes()
Returns the value of the specified attribute as an AttributeValueTemplate
- the value of the specified attribute as an AttributeValueTemplate
getNearestAncestor
public XSLObject getNearestAncestor(short type)
Returns the nearest ancestor of this XSLObject that is of the given
type.
type
- the type of ancestor to search for
- the nearest ancestor of this XSLObject that is of the given
type.
getNodeValue
public static String getNodeValue(Node node)
Returns the String value of a DOM Node.
- the String value of a DOM Node.
org.w3c.dom.Node
getStylesheet
public XSLTStylesheet getStylesheet()
Returns the XSLStylesheet which contains this XSLObject
- the XSLStylesheet which contains this XSLObject
getText
public static String getText(Element element)
Retrieves the text of an Element
- the text of the given Element
org.w3c.dom.Element
getType
public final short getType()
Returns the type of XSLObject this Object represents
- the type of XSLObject that this Object represents
getTypeFromName
public static short getTypeFromName(String name)
Returns the type of XSL Object that has the given name
name
- the name the XSLObject
- the type of XSL Object that has the given name
getTypeName
public String getTypeName()
Returns the name of this XSLObject
- the name of this XSLObject
resolveNamespace
public String resolveNamespace(String prefix)
setAllowActions
public void setAllowActions(boolean allow)
setAttribute
public void setAttribute(String name,
String value)
throws XSLException
Sets the attribute with the given name to the given value.
name
- the name of the attribute to setvalue
- the value to set the attribute to
XSLException
- if this XSLObject does not allow attributes
with the given name, or if the attribute is read only
setTypeName
public void setTypeName(String name)