net.sf.saxon.instruct

Class ProcessingInstruction

public class ProcessingInstruction extends SimpleNodeConstructor

An xsl:processing-instruction element in the stylesheet.
Constructor Summary
ProcessingInstruction(Expression name)
Create an xsl:processing-instruction instruction
Method Summary
protected StringcheckContent(String data, XPathContext context)
Check the content of the node, and adjust it if necessary
voiddisplay(int level, NamePool pool, PrintStream out)
protected intevaluateNameCode(XPathContext context)
intgetCardinality()
intgetDependencies()
intgetInstructionNameCode()
Get the name of this instruction for diagnostic and tracing purposes
ItemTypegetItemType(TypeHierarchy th)
IteratoriterateSubExpressions()
voidlocalTypeCheck(StaticContext env, ItemType contextItemType)
TailCallprocessLeavingTail(XPathContext context)
Process this instruction, that is, produce a processing-instruction node in the result sequence.
protected voidpromoteInst(PromotionOffer offer)
Offer promotion for subexpressions.
Expressionsimplify(StaticContext env)

Constructor Detail

ProcessingInstruction

public ProcessingInstruction(Expression name)
Create an xsl:processing-instruction instruction

Parameters: name the expression used to compute the name of the generated processing-instruction

Method Detail

checkContent

protected String checkContent(String data, XPathContext context)
Check the content of the node, and adjust it if necessary

Parameters: data the supplied content

Returns: the original content, unless adjustments are needed

Throws: net.sf.saxon.trans.DynamicError if the content is invalid

display

public void display(int level, NamePool pool, PrintStream out)

evaluateNameCode

protected int evaluateNameCode(XPathContext context)

getCardinality

public int getCardinality()

getDependencies

public int getDependencies()

getInstructionNameCode

public int getInstructionNameCode()
Get the name of this instruction for diagnostic and tracing purposes

Returns: the string "xsl:processing-instruction"

getItemType

public ItemType getItemType(TypeHierarchy th)

iterateSubExpressions

public Iterator iterateSubExpressions()

localTypeCheck

public void localTypeCheck(StaticContext env, ItemType contextItemType)

processLeavingTail

public TailCall processLeavingTail(XPathContext context)
Process this instruction, that is, produce a processing-instruction node in the result sequence.

Parameters: context the dynamic context of this transformation

Returns: always returns null in this implementation

Throws: XPathException if any non-recoverable dynamic error occurs

promoteInst

protected void promoteInst(PromotionOffer offer)
Offer promotion for subexpressions. The offer will be accepted if the subexpression is not dependent on the factors (e.g. the context item) identified in the PromotionOffer. By default the offer is not accepted - this is appropriate in the case of simple expressions such as constant values and variable references where promotion would give no performance advantage. This method is always called at compile time.

Parameters: offer details of the offer, for example the offer to move expressions that don't depend on the context to an outer level in the containing expression

Throws: XPathException if any error is detected

simplify

public Expression simplify(StaticContext env)