1 package com.icl.saxon.style; 2 import com.icl.saxon.*; 3 import com.icl.saxon.expr.*; 4 import javax.xml.transform.*; 5 import java.io.*; 6 7 12 13 public class SAXONAssign extends XSLGeneralVariable { 14 15 private Binding binding; 17 21 22 public boolean isInstruction() { 23 return true; 24 } 25 26 27 public void validate() throws TransformerConfigurationException { 28 checkWithinTemplate(); 29 super.validate(); 30 try { 31 binding = bindVariable(getVariableFingerprint()); 32 } catch (XPathException err) { 33 compileError(err.getMessage()); 35 return; 36 } 37 if (!binding.isAssignable()) { 38 compileError("Variable " + getVariableName() + " is not marked as assignable"); 39 } 40 } 41 42 public boolean isAssignable() { return true; 44 } 45 46 public void process(Context context) throws TransformerException 47 { 48 Value value = getSelectValue(context); 49 context.getController().getBindery().assignVariable(binding, value); 50 } 51 52 } 53 54 | Popular Tags |