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 XslProcessingInstruction extends XslNode { 39 private String _name; 40 41 44 public String getTagName() 45 { 46 return "xsl:processing-instruction"; 47 } 48 49 52 public void addAttribute(QName name, String value) 53 throws XslParseException 54 { 55 if (name.getName().equals("name")) 56 _name = value; 57 else 58 super.addAttribute(name, value); 59 } 60 61 64 public void endAttributes() 65 throws XslParseException 66 { 67 if (_name == null) 68 throw error(L.l("xsl:processing-instruction needs a 'name' attribute.")); 69 } 70 71 76 public void generate(JavaWriter out) 77 throws Exception 78 { 79 out.println("out.pushPi();"); 80 81 generateChildren(out); 82 83 out.print("out.popPi("); 84 generateString(out, _name, '+'); 85 out.println(");"); 86 } 87 } 88 | Popular Tags |