| 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.StringLiteral; |
| 12 |
import net.sf.saxon.expr.instruct.ProcessingInstruction; |
| 13 |
import net.sf.saxon.trans.XPathException; |
| 14 |
import net.sf.saxon.value.StringValue; |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
public class XSLProcessingInstruction extends XSLLeafNodeConstructor { |
| 21 |
|
| 22 |
Expression name; |
| 23 |
|
| 24 |
public void prepareAttributes() throws XPathException { |
| 25 |
name = prepareAttributesNameAndSelect(); |
| 26 |
} |
| 27 |
|
| 28 |
public void validate(ComponentDeclaration decl) throws XPathException { |
| 29 |
name = typeCheck("name", name); |
| 30 |
select = typeCheck("select", select); |
| 31 |
super.validate(decl); |
| 32 |
} |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
protected String getErrorCodeForSelectPlusContent() { |
| 41 |
return "XTSE0880"; |
| 42 |
} |
| 43 |
|
| 44 |
public Expression compile(Compilation exec, ComponentDeclaration decl) throws XPathException { |
| 45 |
ProcessingInstruction inst = new ProcessingInstruction(name); |
| 46 |
compileContent(exec, decl, inst, new StringLiteral(StringValue.SINGLE_SPACE)); |
| 47 |
return inst; |
| 48 |
} |
| 49 |
|
| 50 |
} |
| 51 |
|