| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
package net.sf.saxon.style; |
| 9 |
|
| 10 |
import net.sf.saxon.expr.Expression; |
| 11 |
import net.sf.saxon.expr.instruct.ValueOf; |
| 12 |
import net.sf.saxon.trans.XPathException; |
| 13 |
import net.sf.saxon.tree.linked.TextImpl; |
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
public class TextValueTemplateNode extends TextImpl { |
| 19 |
|
| 20 |
private Expression contentExp; |
| 21 |
private TextValueTemplateContext staticContext; |
| 22 |
|
| 23 |
public TextValueTemplateNode(String value) { |
| 24 |
super(value); |
| 25 |
} |
| 26 |
|
| 27 |
public Expression getContentExpression() { |
| 28 |
return contentExp; |
| 29 |
} |
| 30 |
|
| 31 |
public TextValueTemplateContext getStaticContext() { |
| 32 |
if (staticContext == null) { |
| 33 |
staticContext = new TextValueTemplateContext((StyleElement) getParent(), this); |
| 34 |
} |
| 35 |
return staticContext; |
| 36 |
} |
| 37 |
|
| 38 |
public void validate() throws XPathException { |
| 39 |
contentExp = AttributeValueTemplate.make(getStringValue(), getStaticContext()); |
| 40 |
contentExp = new ValueOf(contentExp, false, true); |
| 41 |
contentExp.setRetainedStaticContext(((StyleElement)getParent()).makeRetainedStaticContext()); |
| 42 |
contentExp = ((StyleElement)getParent()).typeCheck("tvt", contentExp); |
| 43 |
} |
| 44 |
} |
| 45 |
|