1 28 29 package com.caucho.xsl.java; 30 31 import com.caucho.java.JavaWriter; 32 import com.caucho.xml.QName; 33 import com.caucho.xsl.XslParseException; 34 35 38 public class XslCopyOf extends XslNode { 39 private String _select; 40 43 public void addAttribute(QName name, String value) 44 throws XslParseException 45 { 46 if (name.getName().equals("select")) { 47 _select = value; 48 } 49 else 50 super.addAttribute(name, value); 51 } 52 53 56 public void endAttributes() 57 throws XslParseException 58 { 59 if (_select == null) 60 throw error(L.l("xsl:copy-of needs a 'select' attribute.")); 61 } 62 63 68 public void generate(JavaWriter out) 69 throws Exception 70 { 71 out.println("out.copyOf(_exprs[ " + _gen.addExpr(parseExpr(_select)) + 72 "].evalObject(node, env));"); 73 } 74 } 75 | Popular Tags |