# Hpricot Strange behaviour

**URL:** <https://www.ruby-forum.com/t/hpricot-strange-behaviour/164856>\
**Category:** Rails\
**Created:** [April 6, 2009, 6:14pm UTC](https://www.ruby-forum.com/t/hpricot-strange-behaviour/164856 "2009-04-06T18:14:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marmolin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71e660/32.png) [@marmolin](https://www.ruby-forum.com/u/marmolin)\
**Post date:** [April 6, 2009, 6:14pm UTC](https://www.ruby-forum.com/t/hpricot-strange-behaviour/164856/1 "2009-04-06T18:14:30Z")

</div>

I have a rather strange problem !!

I am using hpricot as an XML parser in my ruby/rails application  
In my local mac developing environment (rails 2.3.2, ruby 1.8.6, msql  
2.7, hpricot 1.8.1) everything works fine.  
However, when I deployed my application on a shared linux server using  
the same hpricot, rails and ruby version hpricot does not work any  
more.  
My XML file is an UTF8 file with some special characters (åäö). It has  
been generated from an ansel file. On the server hpricot missis tags  
that are present in the XML file.  
The XML file has some strange line breaks, but that works locally.

I try to get out the information using the following calls to hpricot

```
 source= (xml/"/gedcom/HEAD/SOUR").inner_text.nil_or.to_s #SOURCE
 file_created_at=(xml/"/gedcom/HEAD/DATE").inner_text.nil_or.to_s

```

#DATE  
version=(xml/"/gedcom/HEAD/GEDC").inner\_text.nil\_or.to\_s #VERSION  
version+= (xml/"/gedcom/HEAD/CHAR").inner\_text.nil\_or.to\_s  
#VERSION  
source\_file= (xml/"/gedcom/HEAD/FILE").inner\_text.nil\_or.to\_s  
#FILE  
description= (xml/"/gedcom/HEAD/NOTE").inner\_text.nil\_or.to\_s  
#DESCR  
contributor=(xml/"/gedcom/SUBM").inner\_text.nil\_or.to\_s  
#SUBMITTER

but it can only find source. It finds file\_created\_at but the  
inner\_text expands over many tags. It also finds contributor but  
then the inner\_text consists of th whole file.  
Note, that i my local environment the code works without problems

Any idees, any suggestion ???  
I would appreciate any help ?
