fork download
  1. import sys
  2. from xml.etree import cElementTree as etree
  3.  
  4. input_file = sys.stdin
  5. context = iter(etree.iterparse(input_file, events=('start', 'end')))
  6. _, root = next(context) # get root element
  7. for event, elem in context:
  8. if event == 'end' and elem.tag == 'build_location':
  9. print(elem.text)
  10. root.clear() # free memory
  11.  
Success #stdin #stdout 0.11s 11536KB
stdin
    <build_location>
     \\Datalocation\la\releases\3.2.0.21_JB2.2_RB2
      </build_location>
stdout
     \\Datalocation\la\releases\3.2.0.21_JB2.2_RB2