1. /*
  2. * Copyright 1999-2004 The Apache Software Foundation.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /*
  17. * $Id: NodeTest.java,v 1.27 2004/02/17 04:35:37 minchau Exp $
  18. */
  19. package com.sun.org.apache.xpath.internal.patterns;
  20. import com.sun.org.apache.xml.internal.dtm.DTM;
  21. import com.sun.org.apache.xml.internal.dtm.DTMFilter;
  22. import com.sun.org.apache.xpath.internal.Expression;
  23. import com.sun.org.apache.xpath.internal.ExpressionOwner;
  24. import com.sun.org.apache.xpath.internal.XPath;
  25. import com.sun.org.apache.xpath.internal.XPathContext;
  26. import com.sun.org.apache.xpath.internal.XPathVisitor;
  27. import com.sun.org.apache.xpath.internal.objects.XNumber;
  28. import com.sun.org.apache.xpath.internal.objects.XObject;
  29. /**
  30. * This is the basic node test class for both match patterns and location path
  31. * steps.
  32. * @xsl.usage advanced
  33. */
  34. public class NodeTest extends Expression
  35. {
  36. /**
  37. * The namespace or local name for node tests with a wildcard.
  38. * @see <a href="http://www.w3.org/TR/xpath#NT-NameTest">the XPath NameTest production.</a>
  39. */
  40. public static final String WILD = "*";
  41. /**
  42. * The URL to pass to the Node#supports method, to see if the
  43. * DOM has already been stripped of whitespace nodes.
  44. */
  45. public static final String SUPPORTS_PRE_STRIPPING =
  46. "http://xml.apache.org/xpath/features/whitespace-pre-stripping";
  47. /**
  48. * This attribute determines which node types are accepted.
  49. * @serial
  50. */
  51. protected int m_whatToShow;
  52. /**
  53. * Special bitmap for match patterns starting with a function.
  54. * Make sure this does not conflict with {@link org.w3c.dom.traversal.NodeFilter}.
  55. */
  56. public static final int SHOW_BYFUNCTION = 0x00010000;
  57. /**
  58. * This attribute determines which node types are accepted.
  59. * These constants are defined in the {@link org.w3c.dom.traversal.NodeFilter}
  60. * interface.
  61. *
  62. * @return bitset mainly defined in {@link org.w3c.dom.traversal.NodeFilter}.
  63. */
  64. public int getWhatToShow()
  65. {
  66. return m_whatToShow;
  67. }
  68. /**
  69. * This attribute determines which node types are accepted.
  70. * These constants are defined in the {@link org.w3c.dom.traversal.NodeFilter}
  71. * interface.
  72. *
  73. * @param what bitset mainly defined in {@link org.w3c.dom.traversal.NodeFilter}.
  74. */
  75. public void setWhatToShow(int what)
  76. {
  77. m_whatToShow = what;
  78. }
  79. /**
  80. * The namespace to be tested for, which may be null.
  81. * @serial
  82. */
  83. String m_namespace;
  84. /**
  85. * Return the namespace to be tested.
  86. *
  87. * @return The namespace to be tested for, or {@link #WILD}, or null.
  88. */
  89. public String getNamespace()
  90. {
  91. return m_namespace;
  92. }
  93. /**
  94. * Set the namespace to be tested.
  95. *
  96. * @param ns The namespace to be tested for, or {@link #WILD}, or null.
  97. */
  98. public void setNamespace(String ns)
  99. {
  100. m_namespace = ns;
  101. }
  102. /**
  103. * The local name to be tested for.
  104. * @serial
  105. */
  106. protected String m_name;
  107. /**
  108. * Return the local name to be tested.
  109. *
  110. * @return the local name to be tested, or {@link #WILD}, or an empty string.
  111. */
  112. public String getLocalName()
  113. {
  114. return (null == m_name) ? "" : m_name;
  115. }
  116. /**
  117. * Set the local name to be tested.
  118. *
  119. * @param name the local name to be tested, or {@link #WILD}, or an empty string.
  120. */
  121. public void setLocalName(String name)
  122. {
  123. m_name = name;
  124. }
  125. /**
  126. * Statically calculated score for this test. One of
  127. * {@link #SCORE_NODETEST},
  128. * {@link #SCORE_NONE},
  129. * {@link #SCORE_NSWILD},
  130. * {@link #SCORE_QNAME}, or
  131. * {@link #SCORE_OTHER}.
  132. * @serial
  133. */
  134. XNumber m_score;
  135. /**
  136. * The match score if the pattern consists of just a NodeTest.
  137. * @see <a href="http://www.w3.org/TR/xslt#conflict">XSLT Specification - 5.5 Conflict Resolution for Template Rules</a>
  138. */
  139. public static final XNumber SCORE_NODETEST =
  140. new XNumber(XPath.MATCH_SCORE_NODETEST);
  141. /**
  142. * The match score if the pattern pattern has the form NCName:*.
  143. * @see <a href="http://www.w3.org/TR/xslt#conflict">XSLT Specification - 5.5 Conflict Resolution for Template Rules</a>
  144. */
  145. public static final XNumber SCORE_NSWILD =
  146. new XNumber(XPath.MATCH_SCORE_NSWILD);
  147. /**
  148. * The match score if the pattern has the form
  149. * of a QName optionally preceded by an @ character.
  150. * @see <a href="http://www.w3.org/TR/xslt#conflict">XSLT Specification - 5.5 Conflict Resolution for Template Rules</a>
  151. */
  152. public static final XNumber SCORE_QNAME =
  153. new XNumber(XPath.MATCH_SCORE_QNAME);
  154. /**
  155. * The match score if the pattern consists of something
  156. * other than just a NodeTest or just a qname.
  157. * @see <a href="http://www.w3.org/TR/xslt#conflict">XSLT Specification - 5.5 Conflict Resolution for Template Rules</a>
  158. */
  159. public static final XNumber SCORE_OTHER =
  160. new XNumber(XPath.MATCH_SCORE_OTHER);
  161. /**
  162. * The match score if no match is made.
  163. * @see <a href="http://www.w3.org/TR/xslt#conflict">XSLT Specification - 5.5 Conflict Resolution for Template Rules</a>
  164. */
  165. public static final XNumber SCORE_NONE =
  166. new XNumber(XPath.MATCH_SCORE_NONE);
  167. /**
  168. * Construct an NodeTest that tests for namespaces and node names.
  169. *
  170. *
  171. * @param whatToShow Bit set defined mainly by {@link org.w3c.dom.traversal.NodeFilter}.
  172. * @param namespace The namespace to be tested.
  173. * @param name The local name to be tested.
  174. */
  175. public NodeTest(int whatToShow, String namespace, String name)
  176. {
  177. initNodeTest(whatToShow, namespace, name);
  178. }
  179. /**
  180. * Construct an NodeTest that doesn't test for node names.
  181. *
  182. *
  183. * @param whatToShow Bit set defined mainly by {@link org.w3c.dom.traversal.NodeFilter}.
  184. */
  185. public NodeTest(int whatToShow)
  186. {
  187. initNodeTest(whatToShow);
  188. }
  189. /**
  190. * @see Expression#deepEquals(Expression)
  191. */
  192. public boolean deepEquals(Expression expr)
  193. {
  194. if(!isSameClass(expr))
  195. return false;
  196. NodeTest nt = (NodeTest)expr;
  197. if(null != nt.m_name)
  198. {
  199. if(null == m_name)
  200. return false;
  201. else if(!nt.m_name.equals(m_name))
  202. return false;
  203. }
  204. else if(null != m_name)
  205. return false;
  206. if(null != nt.m_namespace)
  207. {
  208. if(null == m_namespace)
  209. return false;
  210. else if(!nt.m_namespace.equals(m_namespace))
  211. return false;
  212. }
  213. else if(null != m_namespace)
  214. return false;
  215. if(m_whatToShow != nt.m_whatToShow)
  216. return false;
  217. if(m_isTotallyWild != nt.m_isTotallyWild)
  218. return false;
  219. return true;
  220. }
  221. /**
  222. * Null argument constructor.
  223. */
  224. public NodeTest(){}
  225. /**
  226. * Initialize this node test by setting the whatToShow property, and
  227. * calculating the score that this test will return if a test succeeds.
  228. *
  229. *
  230. * @param whatToShow Bit set defined mainly by {@link org.w3c.dom.traversal.NodeFilter}.
  231. */
  232. public void initNodeTest(int whatToShow)
  233. {
  234. m_whatToShow = whatToShow;
  235. calcScore();
  236. }
  237. /**
  238. * Initialize this node test by setting the whatToShow property and the
  239. * namespace and local name, and
  240. * calculating the score that this test will return if a test succeeds.
  241. *
  242. *
  243. * @param whatToShow Bit set defined mainly by {@link org.w3c.dom.traversal.NodeFilter}.
  244. * @param namespace The namespace to be tested.
  245. * @param name The local name to be tested.
  246. */
  247. public void initNodeTest(int whatToShow, String namespace, String name)
  248. {
  249. m_whatToShow = whatToShow;
  250. m_namespace = namespace;
  251. m_name = name;
  252. calcScore();
  253. }
  254. /**
  255. * True if this test has a null namespace and a local name of {@link #WILD}.
  256. * @serial
  257. */
  258. private boolean m_isTotallyWild;
  259. /**
  260. * Get the static score for this node test.
  261. * @return Should be one of the SCORE_XXX constants.
  262. */
  263. public XNumber getStaticScore()
  264. {
  265. return m_score;
  266. }
  267. /**
  268. * Set the static score for this node test.
  269. * @param score Should be one of the SCORE_XXX constants.
  270. */
  271. public void setStaticScore(XNumber score)
  272. {
  273. m_score = score;
  274. }
  275. /**
  276. * Static calc of match score.
  277. */
  278. protected void calcScore()
  279. {
  280. if ((m_namespace == null) && (m_name == null))
  281. m_score = SCORE_NODETEST;
  282. else if (((m_namespace == WILD) || (m_namespace == null))
  283. && (m_name == WILD))
  284. m_score = SCORE_NODETEST;
  285. else if ((m_namespace != WILD) && (m_name == WILD))
  286. m_score = SCORE_NSWILD;
  287. else
  288. m_score = SCORE_QNAME;
  289. m_isTotallyWild = (m_namespace == null && m_name == WILD);
  290. }
  291. /**
  292. * Get the score that this test will return if a test succeeds.
  293. *
  294. *
  295. * @return the score that this test will return if a test succeeds.
  296. */
  297. public double getDefaultScore()
  298. {
  299. return m_score.num();
  300. }
  301. /**
  302. * Tell what node type to test, if not DTMFilter.SHOW_ALL.
  303. *
  304. * @param whatToShow Bit set defined mainly by
  305. * {@link com.sun.org.apache.xml.internal.dtm.DTMFilter}.
  306. * @return the node type for the whatToShow. Since whatToShow can specify
  307. * multiple types, it will return the first bit tested that is on,
  308. * so the caller of this function should take care that this is
  309. * the function they really want to call. If none of the known bits
  310. * are set, this function will return zero.
  311. */
  312. public static int getNodeTypeTest(int whatToShow)
  313. {
  314. // %REVIEW% Is there a better way?
  315. if (0 != (whatToShow & DTMFilter.SHOW_ELEMENT))
  316. return DTM.ELEMENT_NODE;
  317. if (0 != (whatToShow & DTMFilter.SHOW_ATTRIBUTE))
  318. return DTM.ATTRIBUTE_NODE;
  319. if (0 != (whatToShow & DTMFilter.SHOW_TEXT))
  320. return DTM.TEXT_NODE;
  321. if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT))
  322. return DTM.DOCUMENT_NODE;
  323. if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT_FRAGMENT))
  324. return DTM.DOCUMENT_FRAGMENT_NODE;
  325. if (0 != (whatToShow & DTMFilter.SHOW_NAMESPACE))
  326. return DTM.NAMESPACE_NODE;
  327. if (0 != (whatToShow & DTMFilter.SHOW_COMMENT))
  328. return DTM.COMMENT_NODE;
  329. if (0 != (whatToShow & DTMFilter.SHOW_PROCESSING_INSTRUCTION))
  330. return DTM.PROCESSING_INSTRUCTION_NODE;
  331. if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT_TYPE))
  332. return DTM.DOCUMENT_TYPE_NODE;
  333. if (0 != (whatToShow & DTMFilter.SHOW_ENTITY))
  334. return DTM.ENTITY_NODE;
  335. if (0 != (whatToShow & DTMFilter.SHOW_ENTITY_REFERENCE))
  336. return DTM.ENTITY_REFERENCE_NODE;
  337. if (0 != (whatToShow & DTMFilter.SHOW_NOTATION))
  338. return DTM.NOTATION_NODE;
  339. if (0 != (whatToShow & DTMFilter.SHOW_CDATA_SECTION))
  340. return DTM.CDATA_SECTION_NODE;
  341. return 0;
  342. }
  343. /**
  344. * Do a diagnostics dump of a whatToShow bit set.
  345. *
  346. *
  347. * @param whatToShow Bit set defined mainly by
  348. * {@link com.sun.org.apache.xml.internal.dtm.DTMFilter}.
  349. */
  350. public static void debugWhatToShow(int whatToShow)
  351. {
  352. java.util.Vector v = new java.util.Vector();
  353. if (0 != (whatToShow & DTMFilter.SHOW_ATTRIBUTE))
  354. v.addElement("SHOW_ATTRIBUTE");
  355. if (0 != (whatToShow & DTMFilter.SHOW_NAMESPACE))
  356. v.addElement("SHOW_NAMESPACE");
  357. if (0 != (whatToShow & DTMFilter.SHOW_CDATA_SECTION))
  358. v.addElement("SHOW_CDATA_SECTION");
  359. if (0 != (whatToShow & DTMFilter.SHOW_COMMENT))
  360. v.addElement("SHOW_COMMENT");
  361. if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT))
  362. v.addElement("SHOW_DOCUMENT");
  363. if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT_FRAGMENT))
  364. v.addElement("SHOW_DOCUMENT_FRAGMENT");
  365. if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT_TYPE))
  366. v.addElement("SHOW_DOCUMENT_TYPE");
  367. if (0 != (whatToShow & DTMFilter.SHOW_ELEMENT))
  368. v.addElement("SHOW_ELEMENT");
  369. if (0 != (whatToShow & DTMFilter.SHOW_ENTITY))
  370. v.addElement("SHOW_ENTITY");
  371. if (0 != (whatToShow & DTMFilter.SHOW_ENTITY_REFERENCE))
  372. v.addElement("SHOW_ENTITY_REFERENCE");
  373. if (0 != (whatToShow & DTMFilter.SHOW_NOTATION))
  374. v.addElement("SHOW_NOTATION");
  375. if (0 != (whatToShow & DTMFilter.SHOW_PROCESSING_INSTRUCTION))
  376. v.addElement("SHOW_PROCESSING_INSTRUCTION");
  377. if (0 != (whatToShow & DTMFilter.SHOW_TEXT))
  378. v.addElement("SHOW_TEXT");
  379. int n = v.size();
  380. for (int i = 0; i < n; i++)
  381. {
  382. if (i > 0)
  383. System.out.print(" | ");
  384. System.out.print(v.elementAt(i));
  385. }
  386. if (0 == n)
  387. System.out.print("empty whatToShow: " + whatToShow);
  388. System.out.println();
  389. }
  390. /**
  391. * Two names are equal if they and either both are null or
  392. * the name t is wild and the name p is non-null, or the two
  393. * strings are equal.
  394. *
  395. * @param p part string from the node.
  396. * @param t target string, which may be {@link #WILD}.
  397. *
  398. * @return true if the strings match according to the rules of this method.
  399. */
  400. private static final boolean subPartMatch(String p, String t)
  401. {
  402. // boolean b = (p == t) || ((null != p) && ((t == WILD) || p.equals(t)));
  403. // System.out.println("subPartMatch - p: "+p+", t: "+t+", result: "+b);
  404. return (p == t) || ((null != p) && ((t == WILD) || p.equals(t)));
  405. }
  406. /**
  407. * This is temporary to patch over Xerces issue with representing DOM
  408. * namespaces as "".
  409. *
  410. * @param p part string from the node, which may represent the null namespace
  411. * as null or as "".
  412. * @param t target string, which may be {@link #WILD}.
  413. *
  414. * @return true if the strings match according to the rules of this method.
  415. */
  416. private static final boolean subPartMatchNS(String p, String t)
  417. {
  418. return (p == t)
  419. || ((null != p)
  420. && ((p.length() > 0)
  421. ? ((t == WILD) || p.equals(t)) : null == t));
  422. }
  423. /**
  424. * Tell what the test score is for the given node.
  425. *
  426. *
  427. * @param xctxt XPath runtime context.
  428. * @param context The node being tested.
  429. *
  430. * @return {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NODETEST},
  431. * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NONE},
  432. * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NSWILD},
  433. * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_QNAME}, or
  434. * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_OTHER}.
  435. *
  436. * @throws javax.xml.transform.TransformerException
  437. */
  438. public XObject execute(XPathContext xctxt, int context)
  439. throws javax.xml.transform.TransformerException
  440. {
  441. DTM dtm = xctxt.getDTM(context);
  442. short nodeType = dtm.getNodeType(context);
  443. if (m_whatToShow == DTMFilter.SHOW_ALL)
  444. return m_score;
  445. int nodeBit = (m_whatToShow & (0x00000001 << (nodeType - 1)));
  446. switch (nodeBit)
  447. {
  448. case DTMFilter.SHOW_DOCUMENT_FRAGMENT :
  449. case DTMFilter.SHOW_DOCUMENT :
  450. return SCORE_OTHER;
  451. case DTMFilter.SHOW_COMMENT :
  452. return m_score;
  453. case DTMFilter.SHOW_CDATA_SECTION :
  454. case DTMFilter.SHOW_TEXT :
  455. // was:
  456. // return (!xctxt.getDOMHelper().shouldStripSourceNode(context))
  457. // ? m_score : SCORE_NONE;
  458. return m_score;
  459. case DTMFilter.SHOW_PROCESSING_INSTRUCTION :
  460. return subPartMatch(dtm.getNodeName(context), m_name)
  461. ? m_score : SCORE_NONE;
  462. // From the draft: "Two expanded names are equal if they
  463. // have the same local part, and either both have no URI or
  464. // both have the same URI."
  465. // "A node test * is true for any node of the principal node type.
  466. // For example, child::* will select all element children of the
  467. // context node, and attribute::* will select all attributes of
  468. // the context node."
  469. // "A node test can have the form NCName:*. In this case, the prefix
  470. // is expanded in the same way as with a QName using the context
  471. // namespace declarations. The node test will be true for any node
  472. // of the principal type whose expanded name has the URI to which
  473. // the prefix expands, regardless of the local part of the name."
  474. case DTMFilter.SHOW_NAMESPACE :
  475. {
  476. String ns = dtm.getNodeValue(context);
  477. return (subPartMatch(ns, m_name)) ? m_score : SCORE_NONE;
  478. }
  479. case DTMFilter.SHOW_ATTRIBUTE :
  480. case DTMFilter.SHOW_ELEMENT :
  481. {
  482. return (m_isTotallyWild || (subPartMatchNS(dtm.getNamespaceURI(context), m_namespace) && subPartMatch(dtm.getLocalName(context), m_name)))
  483. ? m_score : SCORE_NONE;
  484. }
  485. default :
  486. return SCORE_NONE;
  487. } // end switch(testType)
  488. }
  489. /**
  490. * Tell what the test score is for the given node.
  491. *
  492. *
  493. * @param xctxt XPath runtime context.
  494. * @param context The node being tested.
  495. *
  496. * @return {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NODETEST},
  497. * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NONE},
  498. * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NSWILD},
  499. * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_QNAME}, or
  500. * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_OTHER}.
  501. *
  502. * @throws javax.xml.transform.TransformerException
  503. */
  504. public XObject execute(XPathContext xctxt, int context,
  505. DTM dtm, int expType)
  506. throws javax.xml.transform.TransformerException
  507. {
  508. if (m_whatToShow == DTMFilter.SHOW_ALL)
  509. return m_score;
  510. int nodeBit = (m_whatToShow & (0x00000001
  511. << ((dtm.getNodeType(context)) - 1)));
  512. switch (nodeBit)
  513. {
  514. case DTMFilter.SHOW_DOCUMENT_FRAGMENT :
  515. case DTMFilter.SHOW_DOCUMENT :
  516. return SCORE_OTHER;
  517. case DTMFilter.SHOW_COMMENT :
  518. return m_score;
  519. case DTMFilter.SHOW_CDATA_SECTION :
  520. case DTMFilter.SHOW_TEXT :
  521. // was:
  522. // return (!xctxt.getDOMHelper().shouldStripSourceNode(context))
  523. // ? m_score : SCORE_NONE;
  524. return m_score;
  525. case DTMFilter.SHOW_PROCESSING_INSTRUCTION :
  526. return subPartMatch(dtm.getNodeName(context), m_name)
  527. ? m_score : SCORE_NONE;
  528. // From the draft: "Two expanded names are equal if they
  529. // have the same local part, and either both have no URI or
  530. // both have the same URI."
  531. // "A node test * is true for any node of the principal node type.
  532. // For example, child::* will select all element children of the
  533. // context node, and attribute::* will select all attributes of
  534. // the context node."
  535. // "A node test can have the form NCName:*. In this case, the prefix
  536. // is expanded in the same way as with a QName using the context
  537. // namespace declarations. The node test will be true for any node
  538. // of the principal type whose expanded name has the URI to which
  539. // the prefix expands, regardless of the local part of the name."
  540. case DTMFilter.SHOW_NAMESPACE :
  541. {
  542. String ns = dtm.getNodeValue(context);
  543. return (subPartMatch(ns, m_name)) ? m_score : SCORE_NONE;
  544. }
  545. case DTMFilter.SHOW_ATTRIBUTE :
  546. case DTMFilter.SHOW_ELEMENT :
  547. {
  548. return (m_isTotallyWild || (subPartMatchNS(dtm.getNamespaceURI(context), m_namespace) && subPartMatch(dtm.getLocalName(context), m_name)))
  549. ? m_score : SCORE_NONE;
  550. }
  551. default :
  552. return SCORE_NONE;
  553. } // end switch(testType)
  554. }
  555. /**
  556. * Test the current node to see if it matches the given node test.
  557. *
  558. * @param xctxt XPath runtime context.
  559. *
  560. * @return {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NODETEST},
  561. * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NONE},
  562. * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NSWILD},
  563. * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_QNAME}, or
  564. * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_OTHER}.
  565. *
  566. * @throws javax.xml.transform.TransformerException
  567. */
  568. public XObject execute(XPathContext xctxt)
  569. throws javax.xml.transform.TransformerException
  570. {
  571. return execute(xctxt, xctxt.getCurrentNode());
  572. }
  573. /**
  574. * Node tests by themselves do not need to fix up variables.
  575. */
  576. public void fixupVariables(java.util.Vector vars, int globalsSize)
  577. {
  578. // no-op
  579. }
  580. /**
  581. * @see XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
  582. */
  583. public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
  584. {
  585. assertion(false, "callVisitors should not be called for this object!!!");
  586. }
  587. }