morten      01/10/09 09:19:31

  Modified:    java/src/org/apache/xalan/xsltc/dom DOMImpl.java
  Log:
  Updated our iterators so that they can be initialized with an attribute node.
  The behaviour is different depending on the nature of the iterator (an
  attribute does not have siblings, but it has following/preceding nodes etc.).
  PR:           bugzilla 2551 (not all tests are OK, but some are)
  Obtained from:        n/a
  Submitted by: [EMAIL PROTECTED]
  Reviewed by:  [EMAIL PROTECTED]
  
  Revision  Changes    Path
  1.40      +11 -4     
xml-xalan/java/src/org/apache/xalan/xsltc/dom/DOMImpl.java
  
  Index: DOMImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/DOMImpl.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- DOMImpl.java      2001/10/09 15:37:57     1.39
  +++ DOMImpl.java      2001/10/09 16:19:30     1.40
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: DOMImpl.java,v 1.39 2001/10/09 15:37:57 morten Exp $
  + * @(#)$Id: DOMImpl.java,v 1.40 2001/10/09 16:19:30 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -594,10 +594,10 @@
        private int _currentChild;
        private int _last = -1;
   
  -     public NodeIterator setStartNode(final int node) {
  -         if (node != _startNode) _last = -1;
  -
  +     public NodeIterator setStartNode(int node) {
            if (_isRestartable) {
  +             if (node >= _firstAttributeNode) node = NULL;
  +             if (node != _startNode) _last = -1;
                _startNode = node;
                if (_includeSelf) {
                    _currentChild = -1;
  @@ -710,6 +710,7 @@
   
        public NodeIterator setStartNode(int node) {
            if (_isRestartable) {
  +             if (node >= _firstAttributeNode) node = NULL;
                _currentChild = hasChildren(node)
                    ? _offsetOrChild[_startNode = node] : END;
                return resetPosition();
  @@ -762,6 +763,7 @@
   
        public NodeIterator setStartNode(int node) {
            if (_isRestartable) {
  +             if (node >= _firstAttributeNode) node = NULL;
                _currentChild = hasChildren(node)
                    ? _offsetOrChild[_startNode = node] : END;
                return resetPosition();
  @@ -846,6 +848,7 @@
            
        public NodeIterator setStartNode(int node) {
            if (_isRestartable) {
  +             if (node >= _firstAttributeNode) node = NULL;
                _node = _startNode = node;
                return resetPosition();
            }
  @@ -975,6 +978,7 @@
            
        public NodeIterator setStartNode(int node) {
            if (_isRestartable) {
  +             if (node >= _firstAttributeNode) node = NULL;
                int tmp = NULL;
                _startNode = node;
                _mom = _parent[node];
  @@ -1068,6 +1072,7 @@
            
        public NodeIterator setStartNode(int node) {
            if (_isRestartable) {
  +             if (node >= _firstAttributeNode) node = _parent[node];
                _node = _startNode = node;
                _mom  = _parent[_startNode];
                return resetPosition();
  @@ -1132,6 +1137,7 @@
                     
        public NodeIterator setStartNode(int node) {
            if (_isRestartable) {
  +             if (node >= _firstAttributeNode) node = _parent[node];
                _startNode = node;
                // find rightmost descendant (or self)
                int current;
  @@ -1212,6 +1218,7 @@
                     
        public NodeIterator setStartNode(int node) {
            if (_isRestartable) {
  +             if (node >= _firstAttributeNode) node = _parent[node];
                if (_includeSelf)
                    _startNode = node;
                else
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to