1 16 19 package org.apache.xalan.templates; 20 21 import org.apache.xalan.res.XSLTErrorResources; 22 import org.apache.xpath.XPath; 23 24 import org.w3c.dom.DOMException ; 25 import org.w3c.dom.Node ; 26 27 44 public class ElemSort extends ElemTemplateElement 45 { 46 47 51 private XPath m_selectExpression = null; 52 53 67 public void setSelect(XPath v) 68 { 69 70 if (v.getPatternString().indexOf("{") < 0) 71 m_selectExpression = v; 72 else 73 error(XSLTErrorResources.ER_NO_CURLYBRACE, null); 74 } 75 76 90 public XPath getSelect() 91 { 92 return m_selectExpression; 93 } 94 95 99 private AVT m_lang_avt = null; 100 101 109 public void setLang(AVT v) 110 { 111 m_lang_avt = v; 112 } 113 114 122 public AVT getLang() 123 { 124 return m_lang_avt; 125 } 126 127 132 private AVT m_dataType_avt = null; 133 134 166 public void setDataType(AVT v) 167 { 168 m_dataType_avt = v; 169 } 170 171 203 public AVT getDataType() 204 { 205 return m_dataType_avt; 206 } 207 208 213 private AVT m_order_avt = null; 214 215 223 public void setOrder(AVT v) 224 { 225 m_order_avt = v; 226 } 227 228 236 public AVT getOrder() 237 { 238 return m_order_avt; 239 } 240 241 246 private AVT m_caseorder_avt = null; 247 248 261 public void setCaseOrder(AVT v) 262 { 263 m_caseorder_avt = v; 264 } 265 266 277 public AVT getCaseOrder() 278 { 279 return m_caseorder_avt; 280 } 281 282 288 public int getXSLToken() 289 { 290 return Constants.ELEMNAME_SORT; 291 } 292 293 298 public String getNodeName() 299 { 300 return Constants.ELEMNAME_SORT_STRING; 301 } 302 303 312 public Node appendChild(Node newChild) throws DOMException 313 { 314 315 error(XSLTErrorResources.ER_CANNOT_ADD, 316 new Object []{ newChild.getNodeName(), 317 this.getNodeName() }); 319 return null; 321 } 322 323 329 public void compose(StylesheetRoot sroot) 330 throws javax.xml.transform.TransformerException 331 { 332 super.compose(sroot); 333 StylesheetRoot.ComposeState cstate = sroot.getComposeState(); 334 java.util.Vector vnames = cstate.getVariableNames(); 335 if(null != m_caseorder_avt) 336 m_caseorder_avt.fixupVariables(vnames, cstate.getGlobalsSize()); 337 if(null != m_dataType_avt) 338 m_dataType_avt.fixupVariables(vnames, cstate.getGlobalsSize()); 339 if(null != m_lang_avt) 340 m_lang_avt.fixupVariables(vnames, cstate.getGlobalsSize()); 341 if(null != m_order_avt) 342 m_order_avt.fixupVariables(vnames, cstate.getGlobalsSize()); 343 if(null != m_selectExpression) 344 m_selectExpression.fixupVariables(vnames, cstate.getGlobalsSize()); 345 } 346 } 347 | Popular Tags |