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 XslKey extends XslNode implements XslTopNode { 39 private String _name; 40 private String _match; 41 private String _use; 42 private String _as; 43 private String _collation; 44 45 48 public String getTagName() 49 { 50 return "xsl:key"; 51 } 52 53 56 public void addAttribute(QName name, String value) 57 throws XslParseException 58 { 59 if (name.getName().equals("name")) 60 _name = value; 61 else if (name.getName().equals("match")) 62 _match = value; 63 else if (name.getName().equals("use")) 64 _use = value; 65 else if (name.getName().equals("as")) 66 _as = value; 67 else if (name.getName().equals("collation")) 68 _collation = value; 69 else 70 super.addAttribute(name, value); 71 } 72 73 76 public void endAttributes() 77 throws XslParseException 78 { 79 if (_name == null) 80 throw error(L.l("xsl:key needs a 'name' attribute.")); 81 else if (_match == null) 82 throw error(L.l("xsl:key needs a 'match' attribute.")); 83 else if (_use == null) 84 throw error(L.l("xsl:key needs a 'use' attribute.")); 85 } 86 87 90 public void endElement() 91 throws Exception 92 { 93 _gen.addKey(_name, parseMatch(_match), parseExpr(_use)); 94 } 95 96 101 public void generate(JavaWriter out) 102 throws Exception 103 { 104 } 105 } 106 | Popular Tags |