|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.tree.NodeImpl net.sf.saxon.tree.ElementImpl net.sf.saxon.style.StyleElement
public abstract class StyleElement
Abstract superclass for all element nodes in the stylesheet.
Note: this class implements Locator. The element
retains information about its own location in the stylesheet, which is useful when
an XSL error is found.
Field Summary | |
---|---|
protected Object |
children
|
protected String |
defaultCollationName
|
protected String |
defaultXPathNamespace
|
protected short[] |
extensionNamespaces
|
static int |
REPORT_ALWAYS
|
static int |
REPORT_IF_INSTANTIATED
|
static int |
REPORT_UNLESS_FALLBACK_AVAILABLE
|
static int |
REPORT_UNLESS_FORWARDS_COMPATIBLE
|
protected int |
reportingCircumstances
|
protected int |
sequence
|
protected StaticContext |
staticContext
|
protected XPathException |
validationError
|
protected BigDecimal |
version
|
Fields inherited from class net.sf.saxon.tree.ElementImpl |
---|
attributeList, nameCode, namespaceList, typeCode |
Fields inherited from class net.sf.saxon.tree.NodeImpl |
---|
index, NODE_LETTER, parent |
Fields inherited from interface net.sf.saxon.om.NodeInfo |
---|
ALL_NAMESPACES, EMPTY_NAMESPACE_LIST, IS_DTD_TYPE, IS_NILLED, LOCAL_NAMESPACES, NO_NAMESPACES |
Constructor Summary | |
---|---|
StyleElement()
Constructor |
Method Summary | |
---|---|
void |
addChild(NodeImpl node,
int index)
Add a child node to this node. |
protected int |
allocateLocationId(String systemId,
int lineNumber)
Allocate a location identifier |
void |
allocatePatternSlots(int slots)
Allocate space for range variables within predicates in the match pattern. |
void |
allocateSlots(Expression exp)
Allocate slots in the local stack frame to range variables used in an XPath expression |
boolean |
backwardsCompatibleModeIsEnabled()
Determine whether backwards-compatible mode is enabled for this element |
XSLVariableDeclaration |
bindVariable(StructuredQName qName)
Bind a variable used in this element to the compiled form of the XSLVariable element in which it is declared |
void |
checkEmpty()
Convenience method to check that the stylesheet element is empty |
protected void |
checkSortComesFirst(boolean sortRequired)
Check that among the children of this element, any xsl:sort elements precede any other elements |
void |
checkTopLevel(String errorCode)
Convenience method to check that the stylesheet element is at the top level |
protected void |
checkUnknownAttribute(int nc)
Check whether an unknown attribute is permitted. |
void |
checkWithinTemplate()
Check that the stylesheet element is within a sequence constructor |
void |
compact(int size)
Compact the space used by this node |
abstract Expression |
compile(Executable exec)
Compile the instruction on the stylesheet tree into an executable instruction for use at run-time. |
protected void |
compileError(String message)
Report a static error in the stylesheet |
protected void |
compileError(String message,
String errorCode)
Compile time error, specifying an error code |
protected void |
compileError(String message,
StructuredQName errorCode)
Compile time error, specifying an error code |
protected void |
compileError(XPathException error)
Report an error with diagnostic information |
Expression |
compileSequenceConstructor(Executable exec,
SequenceIterator iter,
boolean includeParams)
Compile the children of this instruction on the stylesheet tree, adding the subordinate instructions to the parent instruction on the execution tree. |
protected void |
compileWarning(String message,
String errorCode)
|
protected void |
compileWarning(String message,
StructuredQName errorCode)
|
protected boolean |
definesExcludedNamespace(short uriCode)
Check whether this node excludes a particular namespace from the result. |
protected boolean |
definesExtensionElement(short uriCode)
Check whether a particular extension element namespace is defined on this node. |
protected AxisIterator |
enumerateChildren(NodeTest test)
Get an enumeration of the children of this node |
protected Expression |
fallbackProcessing(Executable exec,
StyleElement instruction)
Perform fallback processing. |
void |
fixupReferences()
Fix up references from XPath expressions. |
boolean |
forwardsCompatibleModeIsEnabled()
Determine whether forwards-compatible mode is enabled for this element |
List |
getAllStylesheetFunctions()
Get a list of all stylesheet functions, excluding any that are masked by one of higher precedence |
protected AttributeSet[] |
getAttributeSets(String use,
List list)
Get the list of attribute-sets associated with this element. |
String |
getAttributeValue(String clarkName)
Get an attribute value given the Clark name of the attribute (that is, the name in {uri}local format). |
int |
getColumnNumber(long locationId)
Get the column number within the document, entity, or module containing a particular location |
protected ItemType |
getCommonChildItemType()
Get the most general type of item returned by the children of this instruction |
int |
getConstructType()
Get the type of construct. |
int |
getContainerGranularity()
Get the granularity of the container. |
SlotManager |
getContainingSlotManager()
Get the SlotManager for the containing Procedure definition |
XSLStylesheet |
getContainingStylesheet()
Get the containing XSLStylesheet element |
protected String |
getDefaultCollationName()
Get the default collation for this stylesheet element. |
protected String |
getDefaultXPathNamespace()
Get the default XPath namespace for elements and types |
Executable |
getExecutable()
Get the Executable (representing a complete stylesheet or query) of which this Container forms part |
NodeInfo |
getFirstChild()
Get the first child node of the element |
int |
getHostLanguage()
Get the host language (XSLT, XQuery, XPath) used to implement the code in this container |
NodeInfo |
getLastChild()
Get the last child node of the element |
protected StyleElement |
getLastChildInstruction()
Find the last child instruction of this instruction. |
int |
getLineNumber(long locationId)
Get the line number within the document, entity or module containing a particular location |
LocationProvider |
getLocationProvider()
Get the LocationProvider allowing location identifiers to be resolved. |
NamespaceResolver |
getNamespaceResolver()
Get the namespace context of the instruction. |
protected NodeImpl |
getNthChild(int n)
Get the nth child node of the element (numbering from 0) |
int |
getNumberOfChildren()
Determine how many children the node has |
StructuredQName |
getObjectName()
Get a name identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc. |
int |
getPrecedence()
Get the import precedence of this stylesheet element. |
PreparedStylesheet |
getPreparedStylesheet()
Get the PreparedStylesheet object. |
XSLStylesheet |
getPrincipalStylesheet()
Get the principal XSLStylesheet node. |
Iterator |
getProperties()
Get an iterator over all the properties available. |
Object |
getProperty(String name)
Get the value of a particular property of the instruction. |
protected ItemType |
getReturnedItemType()
Determine the type of item returned by this instruction (only relevant if it is an instruction). |
SchemaType |
getSchemaType(String typeAtt)
Get the Schema type definition for a type named in the stylesheet (in a "type" attribute). |
protected long |
getSequenceNumber()
Get the node sequence number (in document order). |
StaticContext |
getStaticContext()
Get the static context for expressions on this element |
String |
getStringValue()
Return the string-value of the node, that is, the concatenation of the character content of all descendent elements and text nodes. |
CharSequence |
getStringValueCS()
Get the value of the item as a CharSequence. |
XSLFunction |
getStylesheetFunction(StructuredQName qName,
int arity)
Get a FunctionCall declared using an xsl:function element in the stylesheet |
String |
getSystemId(long locationId)
Get the URI of the document, entity, or module containing a particular location |
int |
getTypeAnnotation(SchemaType schemaType)
Get the type annotation to use for a given schema type |
BigDecimal |
getVersion()
Get the numeric value of the version number on this element, or inherited from its ancestors |
protected WithParam[] |
getWithParamInstructions(Executable exec,
boolean tunnel,
Instruction caller)
Get the list of xsl:with-param elements for a calling element (apply-templates, call-template, apply-imports, next-match). |
boolean |
hasChildNodes()
Determine if the node has any children. |
protected void |
index(XSLStylesheet top)
Method supplied by declaration elements to add themselves to a stylesheet-level index |
void |
insertChildren(NodeInfo[] source,
boolean atStart,
boolean inherit)
Insert copies of a sequence of nodes as children of this node. |
protected void |
insertChildrenAt(NodeInfo[] source,
int index,
boolean inherit)
Insert children before or after a given existing child |
boolean |
isExcludedNamespace(short uriCode)
Check whether a namespace uri defines an namespace excluded from the result. |
protected boolean |
isExplaining()
Determine whether saxon:explain has been set to "yes" |
boolean |
isExtensionNamespace(short uriCode)
Check whether a namespace uri defines an extension element. |
boolean |
isInstruction()
Determine whether this node is an instruction. |
protected boolean |
isPermittedChild(StyleElement child)
Check whether a given child is permitted for this element. |
protected void |
issueWarning(String message,
SourceLocator locator)
Report a warning to the error listener |
protected void |
issueWarning(TransformerException error)
Report a warning to the error listener |
boolean |
isTopLevel()
Test whether this is a top-level element |
protected Expression |
makeAttributeValueTemplate(String expression)
Make an attribute value template in the context of this stylesheet element |
Expression |
makeExpression(String expression)
Compile an XPath expression in the context of this stylesheet element |
ExpressionVisitor |
makeExpressionVisitor()
Make an expression visitor |
SavedNamespaceContext |
makeNamespaceContext()
Make a NamespaceContext object representing the list of in-scope namespaces. |
Pattern |
makePattern(String pattern)
Make a pattern in the context of this stylesheet element |
StructuredQName |
makeQName(String lexicalQName)
Make a structured QName, using this Element as the context for namespace resolution, and registering the code in the namepool. |
SequenceType |
makeSequenceType(String sequenceType)
Process an attribute whose value is a SequenceType |
protected SortKeyDefinition[] |
makeSortKeys()
Construct sort keys for a SortedIterator |
protected static TraceWrapper |
makeTraceInstruction(StyleElement source,
Expression child)
Create a trace instruction to wrap a real instruction |
protected boolean |
markTailCalls()
Mark tail-recursive calls on templates and functions. |
protected boolean |
mayContainFallback()
Determine whether this type of element is allowed to contain an xsl:fallback instruction. |
protected boolean |
mayContainParam(String attName)
Determine whether this type of element is allowed to contain an xsl:param element |
protected boolean |
mayContainSequenceConstructor()
Determine whether this type of element is allowed to contain a sequence constructor |
void |
postValidate()
Hook to allow additional validation of a parent element immediately after its children have been validated. |
protected abstract void |
prepareAttributes()
Set the attribute list for the element. |
protected void |
processAllAttributes()
Process the attributes of this element and all its children |
protected void |
processAttributes()
Process the attribute list for the element. |
protected void |
processDefaultCollationAttribute(String ns)
Process the [xsl:]default-xpath-namespace attribute if there is one |
protected void |
processDefaultXPathNamespaceAttribute(String ns)
Process the [xsl:]xpath-default-namespace attribute if there is one |
protected void |
processExcludedNamespaces(String ns)
Process the [xsl:]exclude-result-prefixes attribute if there is one |
protected void |
processExtensionElementAttribute(String ns)
Process the [xsl:]extension-element-prefixes attribute if there is one |
void |
processStandardAttributes(String namespace)
Process the standard attributes such as [xsl:]default-collation |
protected void |
processVersionAttribute(String ns)
Process the [xsl:]version attribute if there is one |
protected void |
removeChild(NodeImpl child)
Remove a given child |
protected void |
replaceChildrenAt(NodeInfo[] source,
int index,
boolean inherit)
Replace child at a given index by new children |
boolean |
replaceSubExpression(Expression original,
Expression replacement)
Replace one subexpression by a replacement subexpression |
void |
reportAbsence(String attribute)
Convenience method to report the absence of a mandatory attribute |
protected boolean |
seesAvuncularVariables()
Ask whether variables declared in an "uncle" element are visible. |
void |
setObjectName(StructuredQName qName)
Set the object name, for example the name of a function, variable, or template declared on this element |
void |
setValidationError(TransformerException reason,
int circumstances)
Set a validation error. |
void |
substituteFor(StyleElement temp)
Make this node a substitute for a temporary one previously added to the tree. |
Expression |
typeCheck(String name,
Expression exp)
Type-check an expression. |
Pattern |
typeCheck(String name,
Pattern pattern)
Type-check a pattern. |
protected void |
undeclaredNamespaceError(String prefix,
String errorCode)
|
protected void |
useChildrenArray(NodeImpl[] array)
Supply an array to be used for the array of children. |
void |
validate()
Check that the stylesheet element is valid. |
protected void |
validateChildren()
Validate the children of this node, recursively. |
void |
validateSubtree()
Recursive walk through the stylesheet to validate all nodes |
Methods inherited from class net.sf.saxon.tree.NodeImpl |
---|
atomize, compareOrder, equals, getConfiguration, getDisplayName, getDocumentNumber, getFingerprint, getLocalPart, getNamePool, getNextInDocument, getNextSibling, getParent, getPhysicalRoot, getPrefix, getPreviousInDocument, getPreviousSibling, getPublicId, getSiblingPosition, getTypedValue, getURI, insertSiblings, isDeleted, isIdref, isSameNodeInfo, iterateAxis, iterateAxis, newBuilder, replace |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.saxon.trace.InstructionInfo |
---|
getLineNumber, getSystemId |
Methods inherited from interface org.xml.sax.Locator |
---|
getColumnNumber, getPublicId |
Methods inherited from interface javax.xml.transform.SourceLocator |
---|
getColumnNumber, getPublicId |
Methods inherited from interface net.sf.saxon.om.NodeInfo |
---|
hashCode |
Field Detail |
---|
protected short[] extensionNamespaces
protected BigDecimal version
protected StaticContext staticContext
protected XPathException validationError
protected int reportingCircumstances
protected String defaultXPathNamespace
protected String defaultCollationName
public static final int REPORT_ALWAYS
public static final int REPORT_UNLESS_FORWARDS_COMPATIBLE
public static final int REPORT_IF_INSTANTIATED
public static final int REPORT_UNLESS_FALLBACK_AVAILABLE
protected Object children
protected int sequence
Constructor Detail |
---|
public StyleElement()
Method Detail |
---|
public Executable getExecutable()
Container
getExecutable
in interface Container
public LocationProvider getLocationProvider()
getLocationProvider
in interface Container
public StaticContext getStaticContext()
public int getContainerGranularity()
getContainerGranularity
in interface Container
public ExpressionVisitor makeExpressionVisitor()
protected boolean isExplaining()
public void substituteFor(StyleElement temp)
temp
- the element which this one is substituting forpublic void setValidationError(TransformerException reason, int circumstances)
reason
- the details of the errorcircumstances
- a code identifying the circumstances under which the error is to be reportedpublic boolean isInstruction()
protected ItemType getReturnedItemType()
protected ItemType getCommonChildItemType()
protected boolean markTailCalls()
protected boolean mayContainSequenceConstructor()
protected boolean mayContainFallback()
protected boolean mayContainParam(String attName)
attName
- if null, the method tests whether an xsl:param child is allowed.
If non-null, it tests whether an xsl:param child with the given attribute name is allowed
public XSLStylesheet getContainingStylesheet()
public int getPrecedence()
public final StructuredQName makeQName(String lexicalQName) throws XPathException, NamespaceException
lexicalQName
- The lexical QName as written, in the form "[prefix:]localname". The name must have
already been validated as a syntactically-correct QName. Leading and trailing whitespace
will be trimmed
XPathException
- if the qname is not a lexically-valid QName, or if the name
is in a reserved namespace.
NamespaceException
- if the prefix of the qname has not been declaredpublic SavedNamespaceContext makeNamespaceContext()
public NamespaceResolver getNamespaceResolver()
protected void processAllAttributes() throws XPathException
XPathException
- in the event of a static error being detectedpublic void processStandardAttributes(String namespace) throws XPathException
namespace
- either "" to find the attributes in the null namespace,
or NamespaceConstant.XSLT to find them in the XSLT namespace
XPathException
public String getAttributeValue(String clarkName)
clarkName
- the name of the attribute in {uri}local format
protected final void processAttributes() throws XPathException
XPathException
protected void checkUnknownAttribute(int nc) throws XPathException
nc
- The name code of the attribute name
XPathException
- (and reports the error) if this is an attribute
that is not permitted on the containing elementprotected abstract void prepareAttributes() throws XPathException
XPathException
protected StyleElement getLastChildInstruction()
public Expression makeExpression(String expression) throws XPathException
expression
- the source text of the XPath expression
XPathException
public Pattern makePattern(String pattern) throws XPathException
pattern
- the source text of the pattern
XPathException
protected Expression makeAttributeValueTemplate(String expression) throws XPathException
expression
- the source text of the attribute value template
XPathException
public SequenceType makeSequenceType(String sequenceType) throws XPathException
sequenceType
- the source text of the attribute
XPathException
- if the syntax is invalid or for example if it refers to a type
that is not in the static contextprotected void processExtensionElementAttribute(String ns) throws XPathException
ns
- the namespace URI of the attribute - either the XSLT namespace or "" for the null namespace
XPathException
protected void processExcludedNamespaces(String ns) throws XPathException
ns
- the namespace URI of the attribute required, either the XSLT namespace or ""
XPathException
protected void processVersionAttribute(String ns) throws XPathException
ns
- the namespace URI of the attribute required, either the XSLT namespace or ""
XPathException
public BigDecimal getVersion()
public boolean forwardsCompatibleModeIsEnabled()
public boolean backwardsCompatibleModeIsEnabled()
protected void processDefaultCollationAttribute(String ns) throws XPathException
ns
- the namespace of the attribute required, either the XSLT namespace or ""
XPathException
protected String getDefaultCollationName()
protected boolean definesExtensionElement(short uriCode)
uriCode
- the namespace URI code being tested
public boolean isExtensionNamespace(short uriCode)
uriCode
- the namespace URI code being tested
protected boolean definesExcludedNamespace(short uriCode)
uriCode
- the code of the namespace URI being tested
public boolean isExcludedNamespace(short uriCode)
uriCode
- the code of the namespace URI being tested
protected void processDefaultXPathNamespaceAttribute(String ns)
ns
- the namespace URI of the attribute required (the default namespace or the XSLT namespace.)protected String getDefaultXPathNamespace()
NamespaceConstant.NULL
for the non-namespacepublic SchemaType getSchemaType(String typeAtt) throws XPathException
typeAtt
- the value of the type attribute
XPathException
- if the type is not declared in an
imported schema, or is not a built-in typepublic int getTypeAnnotation(SchemaType schemaType)
schemaType
- the schema type
public void validate() throws XPathException
XPathException
public void postValidate() throws XPathException
XPathException
protected void index(XSLStylesheet top) throws XPathException
top
- the outermost XSLStylesheet element
XPathException
public Expression typeCheck(String name, Expression exp) throws XPathException
name
- the name of the attribute containing the expression to be checked (used for diagnostics)exp
- the expression to be checked
XPathException
public void allocateSlots(Expression exp)
exp
- the XPath expression for which slots are to be allocatedpublic void allocatePatternSlots(int slots)
slots
- the number of slots requiredpublic Pattern typeCheck(String name, Pattern pattern) throws XPathException
name
- the name of the attribute holding the pattern, for example "match": used in
diagnosticspattern
- the compiled pattern
XPathException
public void fixupReferences() throws XPathException
XPathException
public SlotManager getContainingSlotManager()
public void validateSubtree() throws XPathException
XPathException
protected void validateChildren() throws XPathException
XPathException
protected boolean isPermittedChild(StyleElement child)
child
- the child that may or may not be permitted
public XSLStylesheet getPrincipalStylesheet()
public PreparedStylesheet getPreparedStylesheet()
public void checkWithinTemplate() throws XPathException
XPathException
- if not within a sequence constructorprotected void checkSortComesFirst(boolean sortRequired) throws XPathException
sortRequired
- true if there must be at least one xsl:sort element
XPathException
- if invalidpublic void checkTopLevel(String errorCode) throws XPathException
errorCode
- the error to throw if it is not at the top level; defaults to XTSE0010
if the value is null
XPathException
- if not at top levelpublic void checkEmpty() throws XPathException
XPathException
- if it is not emptypublic void reportAbsence(String attribute) throws XPathException
attribute
- the name of the attribute whose absence is to be reported
XPathException
- if the attribute is missingpublic abstract Expression compile(Executable exec) throws XPathException
exec
- the Executable
XPathException
public Expression compileSequenceConstructor(Executable exec, SequenceIterator iter, boolean includeParams) throws XPathException
exec
- the Executableiter
- Iterator over the children. This is used in the case where there are children
that are not part of the sequence constructor, for example the xsl:sort children of xsl:for-each;
the iterator can be positioned past such elements.includeParams
- true if xsl:param elements are to be treated as child instructions (true
for templates but not for functions)
XPathException
protected static TraceWrapper makeTraceInstruction(StyleElement source, Expression child)
source
- the parent elementchild
- the compiled expression tree for the instruction to be traced
protected Expression fallbackProcessing(Executable exec, StyleElement instruction) throws XPathException
exec
- the Executableinstruction
- The unknown extension instruction
XPathException
protected int allocateLocationId(String systemId, int lineNumber)
systemId
- identifies the module containing the instructionlineNumber
- the line number of the instruction
LocationProvider
protected SortKeyDefinition[] makeSortKeys() throws XPathException
XPathException
protected AttributeSet[] getAttributeSets(String use, List list) throws XPathException
use
- the original value of the [xsl:]use-attribute-sets attributelist
- an empty list to hold the list of XSLAttributeSet elements in the stylesheet tree.
Or null, if these are not required.
XPathException
protected WithParam[] getWithParamInstructions(Executable exec, boolean tunnel, Instruction caller) throws XPathException
exec
- the Executabletunnel
- true if the tunnel="yes" parameters are wanted, false to getcaller
- the calling instruction (for example xsl:apply-templates
XPathException
protected void compileError(XPathException error) throws XPathException
error
- contains information about the error
XPathException
- always, after reporting the error to the ErrorListenerprotected void compileError(String message) throws XPathException
message
- the error message
XPathException
- always, after reporting the error to the ErrorListenerprotected void compileError(String message, StructuredQName errorCode) throws XPathException
message
- the error messageerrorCode
- the error code. May be null if not known or not defined
XPathException
protected void compileError(String message, String errorCode) throws XPathException
message
- the error messageerrorCode
- the error code. May be null if not known or not defined
XPathException
protected void undeclaredNamespaceError(String prefix, String errorCode) throws XPathException
XPathException
protected void compileWarning(String message, StructuredQName errorCode) throws XPathException
XPathException
protected void compileWarning(String message, String errorCode) throws XPathException
XPathException
protected void issueWarning(TransformerException error)
error
- an exception containing the warning textprotected void issueWarning(String message, SourceLocator locator)
message
- the warning message textlocator
- the location of the problem in the source stylesheetpublic boolean isTopLevel()
public XSLVariableDeclaration bindVariable(StructuredQName qName)
qName
- The name of the variable
protected boolean seesAvuncularVariables()
public XSLFunction getStylesheetFunction(StructuredQName qName, int arity)
qName
- the name of the functionarity
- the number of arguments in the function call. The value -1
indicates that any arity will do (this is used to support the function-available() function).
public List getAllStylesheetFunctions()
public int getConstructType()
Location
. This method is part of the InstructionInfo
interface
getConstructType
in interface InstructionInfo
public StructuredQName getObjectName()
getObjectName
in interface InstructionInfo
public void setObjectName(StructuredQName qName)
qName
- the object name as a QNamepublic Object getProperty(String name)
InstructionInfo
interface for run-time tracing and debugging. The properties
available include all the attributes of the source instruction (named by the attribute name):
these are all provided as string values.
getProperty
in interface InstructionInfo
name
- The name of the required property
public Iterator getProperties()
getProperties
in interface InstructionInfo
public String getSystemId(long locationId)
LocationProvider
getSystemId
in interface LocationProvider
locationId
- identifier of the location in question (as passed down the Receiver pipeline)
public int getLineNumber(long locationId)
LocationProvider
getLineNumber
in interface LocationProvider
locationId
- identifier of the location in question (as passed down the Receiver pipeline)
public int getColumnNumber(long locationId)
LocationProvider
getColumnNumber
in interface LocationProvider
locationId
- identifier of the location in question (as passed down the Receiver pipeline)
public int getHostLanguage()
getHostLanguage
in interface Container
Configuration.XSLT
or Configuration.XQUERY
public boolean replaceSubExpression(Expression original, Expression replacement)
original
- the original subexpressionreplacement
- the replacement subexpression
protected final long getSequenceNumber()
getSequenceNumber
in class NodeImpl
public final boolean hasChildNodes()
hasChildNodes
in interface NodeInfo
hasChildNodes
in class NodeImpl
true
if the node has any children,
false
if the node has no children.public int getNumberOfChildren()
protected final AxisIterator enumerateChildren(NodeTest test)
test
- A NodeTest to be satisfied by the child nodes, or null
if all child node are to be returned
public final NodeInfo getFirstChild()
getFirstChild
in class NodeImpl
public final NodeInfo getLastChild()
getLastChild
in class NodeImpl
protected final NodeImpl getNthChild(int n)
n
- identifies the required child
protected void removeChild(NodeImpl child)
child
- the child to be removedpublic String getStringValue()
Item.getStringValueCS()
public CharSequence getStringValueCS()
NodeImpl
getStringValueCS
in interface Item
getStringValueCS
in interface ValueRepresentation
getStringValueCS
in class NodeImpl
Item.getStringValue()
protected void useChildrenArray(NodeImpl[] array)
array
- the array to be usedpublic void addChild(NodeImpl node, int index)
node
- the node to be added as a child of this nodeindex
- the position where the child is to be addedpublic void insertChildren(NodeInfo[] source, boolean atStart, boolean inherit)
This method takes no action unless the target node is a document node or element node. It also takes no action in respect of any supplied nodes that are not elements, text nodes, comments, or processing instructions.
The supplied nodes will be copied to form the new children. Adjacent text nodes will be merged, and zero-length text nodes removed.
insertChildren
in interface MutableNodeInfo
insertChildren
in class NodeImpl
source
- the nodes to be insertedatStart
- true if the new nodes are to be inserted before existing children; false if they areinherit
- true if the inserted nodes are to inherit the namespaces that are in-scope for their
new parent; false if such namespaces should be undeclared on the childrenprotected void insertChildrenAt(NodeInfo[] source, int index, boolean inherit)
source
- the children to be insertedindex
- the position before which they are to be inserted: 0 indicates insertion before the
first child, 1 insertion before the second child, and so on.inherit
- true if the inserted nodes are to inherit the namespaces that are in-scope for their
new parent; false if such namespaces should be undeclared on the childrenprotected void replaceChildrenAt(NodeInfo[] source, int index, boolean inherit)
source
- the children to be insertedindex
- the position at which they are to be inserted: 0 indicates replacement of the
first child, replacement of the second child, and so on. The effect is undefined if index
is out of rangeinherit
- set to true if the new child elements are to inherit the in-scope namespaces
of their new parent
IllegalArgumentException
- if any of the replacement nodes is not an element, text,
comment, or processing instruction nodepublic void compact(int size)
size
- the number of actual children
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |