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 XslTransform extends XslStylesheet { 39 private String _version; 40 41 44 public String getTagName() 45 { 46 return "xsl:transform"; 47 } 48 49 52 public void addAttribute(QName name, String value) 53 throws XslParseException 54 { 55 if (name.getName().equals("version")) 56 _version = value; 57 else 58 super.addAttribute(name, value); 59 } 60 61 64 public void endAttributes() 65 throws XslParseException 66 { 67 if (_version == null) 68 throw error(L.l("xsl:stylesheet needs a 'version' attribute.")); 69 else if (! _version.equals("1.0")) 70 throw error(L.l("'{0}' is an unknown xsl:stylesheet version.", 71 _version)); 72 } 73 74 79 public void generate(JavaWriter out) 80 throws Exception 81 { 82 generateChildren(out); 83 } 84 } 85 | Popular Tags |