org.exolab.adaptx.xslt
public class XSLObject extends Object
Version: $Revision: 3934 $ $Date: 2003-10-02 05:58:30 -0400 (Thu, 02 Oct 2003) $
| Field Summary | |
|---|---|
| static short | APPLY_IMPORTS |
| static short | APPLY_TEMPLATES |
| static short | ARG |
| static short | ATTRIBUTE |
| static short | ATTRIBUTE_SET |
| static short | CALL_TEMPLATE |
| static short | CDATA |
| static short | CHOOSE |
| static short | COMMENT |
| static short | CONTENTS |
| static short | COPY |
| static short | COPY_OF |
| static short | ELEMENT |
| static short | ENTITY_REF |
| static short | FOR_EACH |
| static short | FUNCTIONS |
| static short | ID |
| static short | IF |
| static short | IMPORT |
| static short | INCLUDE |
| static short | KEY |
| static short | LITERAL |
| static short | LOCALE |
| static short | MESSAGE |
| static short | NUMBER |
| static short | OTHERWISE |
| static short | OUTPUT |
| static short | PARAM |
| static short | PI |
| static short | PRESERVE_SPACE |
| static short | SCRIPT |
| static short | SORT |
| static short | STRIP_SPACE |
| static short | STYLESHEET |
| static short | TEMPLATE |
| static short | TEXT |
| static short | VALUE_OF |
| static short | VARIABLE |
| static short | WHEN |
| static short | WITH_PARAM |
| Constructor Summary | |
|---|---|
| XSLObject(short type)
Creates an XSLObject using the specified type | |
| Method Summary | |
|---|---|
| void | addNamespaceDecl(String prefix, String namespace)
Adds the Given namespace declaration to this XSLObject's set of namespace
declarations |
| boolean | appendAction(XSLObject xslObject)
Appends the given XSLObject to this XSLObject's list of
actions. |
| void | appendText(String text)
Appends the text to this XSLObject. |
| void | appendText(char[] chars, int start, int length)
Appends the text to this XSLObject. |
| ActionTemplate | getActions()
Returns the list of actions for this XSLObject |
| String | getAttribute(String name)
Returns the value of the attribute whose name is equal to the given name. |
| AttributeList | getAttributes()
Returns the value of the specified attribute as an AttributeValueTemplate |
| String | getNamespace()
Returns this XSLObject's namespace URI.
|
| XSLObject | getNearestAncestor(short type)
Returns the nearest ancestor of this XSLObject that is of the given
type. |
| static String | getNodeValue(Node node)
Returns the String value of a DOM Node. |
| XSLTStylesheet | getStylesheet()
Returns the XSLStylesheet which contains this XSLObject |
| static String | getText(Element element)
Retrieves the text of an Element |
| short | getType()
Returns the type of XSLObject this Object represents |
| static short | getTypeFromName(String name)
Returns the type of XSL Object that has the given name |
| String | getTypeName()
Returns the name of this XSLObject |
| String | resolveNamespace(String prefix) |
| void | setAllowActions(boolean allow) |
| void | setAttribute(String name, String value)
Sets the attribute with the given name to the given value. |
| void | setNamespace(String uri)
Sets this XSLObject's namespace URI
|
| void | setTypeName(String name) |
Parameters: parentStylesheet the owner XSLStylesheet of the new Element type the type of XSLObject that the new instance represents
Parameters: xslObject the XSLObject to add to this XSLObject's list of actions
Returns: true if the given XSLObject has been added to this XSLObject otherwise false
Parameters: text the text to append
Parameters: text the text to append
Returns: the list of actions for this XSLObject
Returns: the value of the attribute whose name is equal to the given name or null if no attribute exist's with such a name.
Returns: the value of the specified attribute as an AttributeValueTemplate an Enumeration of the names of the attributes of this XSLObject
Throws: XSLException when the Attribute is not a valid AttrubueValueTemplate public AttributeValueTemplate getAttributeAsAVT(String name) throws XSLException { if (name == null) return null; String attValue = getAttribute(name); AttributeValueTemplate avt = null; if ((attValue != null) && (attValue.length() > 0)) { // look in cache first avt = (AttributeValueTemplate) avtCache.get(attValue); if (avt == null) { try { avt = new AttributeValueTemplate(attValue); // add to cache for performace // Do we need to clean cache? Yes if we are reusing // XSLObjects. No if not. I am currently not // reusing XSLObjects so I am not doing any house // cleaning. This could lead to memory problems if // XSLObjects are reused heavily. avtCache.put(attValue, avt); } catch(InvalidExprException iee) { throw new XSLException (XSLException.INVALID_ATTRIBUTE_VALUE_TEMPLATE, iee.getMessage()); } } } return avt; } //-- getAttributeAsAVT /** Returns the AttributeList for this XSLObject
Returns: the namespace URI or null if none exists.
Parameters: type the type of ancestor to search for
Returns: the nearest ancestor of this XSLObject that is of the given type.
Returns: the String value of a DOM Node.
See Also: org.w3c.dom.Node
Returns: the XSLStylesheet which contains this XSLObject
Returns: the text of the given Element
See Also: org.w3c.dom.Element
Returns: the type of XSLObject that this Object represents
Parameters: name the name the XSLObject
Returns: the type of XSL Object that has the given name
Returns: the name of this XSLObject
Parameters: name the name of the attribute to set value the value to set the attribute to
Throws: XSLException if this XSLObject does not allow attributes with the given name, or if the attribute is read only
Parameters: uri the namespace URI