1 16 19 package org.apache.xalan.templates; 20 21 import org.apache.xml.utils.QName; 22 import org.apache.xpath.XPath; 23 24 33 public class KeyDeclaration extends ElemTemplateElement 34 { 35 36 42 public KeyDeclaration(Stylesheet parentNode, int docOrderNumber) 43 { 44 m_parentNode = parentNode; 45 setUid(docOrderNumber); 46 } 47 48 52 private QName m_name; 53 54 62 public void setName(QName name) 63 { 64 m_name = name; 65 } 66 67 75 public QName getName() 76 { 77 return m_name; 78 } 79 80 85 public String getNodeName() 86 { 87 return Constants.ELEMNAME_KEY_STRING; 88 } 89 90 91 95 private XPath m_matchPattern = null; 96 97 106 public void setMatch(XPath v) 107 { 108 m_matchPattern = v; 109 } 110 111 120 public XPath getMatch() 121 { 122 return m_matchPattern; 123 } 124 125 129 private XPath m_use; 130 131 139 public void setUse(XPath v) 140 { 141 m_use = v; 142 } 143 144 152 public XPath getUse() 153 { 154 return m_use; 155 } 156 157 163 public int getXSLToken() 164 { 165 return Constants.ELEMNAME_KEY; 166 } 167 168 174 public void compose(StylesheetRoot sroot) 175 throws javax.xml.transform.TransformerException 176 { 177 super.compose(sroot); 178 java.util.Vector vnames = sroot.getComposeState().getVariableNames(); 179 if(null != m_matchPattern) 180 m_matchPattern.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize()); 181 if(null != m_use) 182 m_use.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize()); 183 } 184 185 190 public void recompose(StylesheetRoot root) 191 { 192 root.recomposeKeys(this); 193 } 194 195 } 196 | Popular Tags |