1 package com.icl.saxon.style; 2 import com.icl.saxon.tree.AttributeCollection; 3 import com.icl.saxon.tree.NodeImpl; 4 import com.icl.saxon.*; 5 import com.icl.saxon.om.NodeInfo; 6 import com.icl.saxon.handlers.*; 7 import com.icl.saxon.expr.*; 8 9 import javax.xml.transform.*; 10 import java.io.*; 11 12 16 17 public class XSLWithParam extends XSLGeneralVariable { 18 19 public void validate() throws TransformerConfigurationException { 20 super.validate(); 21 22 NodeInfo parent = (NodeInfo)getParent(); 23 if (!((parent instanceof XSLApplyTemplates) || 24 (parent instanceof XSLCallTemplate) || 25 (parent instanceof XSLApplyImports))) { 26 compileError("xsl:with-param cannot appear as a child of " + parent.getDisplayName()); 27 } 28 29 31 NodeImpl prev = (NodeImpl)getPreviousSibling(); 32 while (prev!=null) { 33 if (prev instanceof XSLWithParam) { 34 if (this.variableFingerprint == ((XSLWithParam)prev).variableFingerprint) { 35 compileError("Duplicate parameter name"); 36 } 37 } 38 prev = (NodeImpl)prev.getPreviousSibling(); 39 } 40 } 41 42 public void process(Context context) throws TransformerException 43 {} 44 45 46 public Value getParamValue( Context context ) throws TransformerException 47 { 48 return getSelectValue(context); 49 } 50 51 } 52 53 | Popular Tags |