views:

22

answers:

3

I am reading data from an xml doc and placing it on a web page using rails and REMXL. I use

@description1=XPath.match( xmldoc, "////description" )

to get the info into an array and just loop through in my view. However when using

<%= h(@description1[k]) %>

so it looks like

<description>fuzzy slippers</description>

on the web page. Is there a good way of removing the tags? Thanks

+1  A: 

You might want to look into httparty: http://github.com/jnunemaker/httparty

Gordon Isnor
+1  A: 

Did you try

<%= h(@description1[k].text) %>

What does it show?

Edu
+1  A: 

The xpath you are using will return a set of nodes. To get only the content, use:

@description1 = XPath.match(xmldoc, "////description/text()")
Lars Haugseth