~ubuntu-branches/ubuntu/intrepid/ruby1.9/intrepid-updates

« back to all changes in this revision

Viewing changes to lib/rexml/xpath_parser.rb

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-09-04 16:01:17 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20070904160117-i15zckg2nhxe9fyw
Tags: 1.9.0+20070830-2ubuntu1
* Sync from Debian; remaining changes:
  - Add -g to CFLAGS.
* Fixes build failure on ia64.
* Fixes build failure with gcc-4.2 on lpia.
* Robustify check for target_os, fixing build failure on lpia.
* Set Ubuntu maintainer address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
352
352
        when :following_sibling
353
353
          #puts "FOLLOWING_SIBLING 1: nodeset = #{nodeset}"
354
354
          results = []
355
 
          for node in nodeset
 
355
          nodeset.each do |node|
 
356
            next if node.parent.nil?
356
357
            all_siblings = node.parent.children
357
358
            current_index = all_siblings.index( node )
358
359
            following_siblings = all_siblings[ current_index+1 .. -1 ]
363
364
 
364
365
        when :preceding_sibling
365
366
          results = []
366
 
          for node in nodeset
 
367
          nodeset.each do |node|
 
368
            next if node.parent.nil?
367
369
            all_siblings = node.parent.children
368
370
            current_index = all_siblings.index( node )
369
 
            preceding_siblings = all_siblings[ 0 .. current_index-1 ].reverse
370
 
            #results += expr( path_stack.dclone, preceding_siblings )
 
371
            preceding_siblings = all_siblings[ 0, current_index ].reverse
 
372
            results += preceding_siblings
371
373
          end
372
 
          nodeset = preceding_siblings || []
 
374
          nodeset = results
373
375
          node_types = ELEMENTS
374
376
 
375
377
        when :preceding