# Xml partial issue

**URL:** <https://www.ruby-forum.com/t/xml-partial-issue/187216>\
**Category:** Rails\
**Created:** [April 20, 2010, 12:33am UTC](https://www.ruby-forum.com/t/xml-partial-issue/187216 "2010-04-20T00:33:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [April 20, 2010, 12:33am UTC](https://www.ruby-forum.com/t/xml-partial-issue/187216/1 "2010-04-20T00:33:49Z")

</div>

I am using a partial for an xml page, but the xml.instruct is not  
showing up:

Main xml file:

xml.instruct! :xml, :version=\>“1.0”

xml \<\< render(:partial =\> ‘success\_error’, :locals =\> {:x =\>  
@x, :p\_xml =\> xml})

Partial:

p\_xml.response do  
p\_xml.tag!(x[:type]) do  
p\_xml.message x[:msg]  
end  
end

When I view the page the xml shows up but not the header. When I  
right click and view source then I can see the header info.

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [April 20, 2010, 12:35am UTC](https://www.ruby-forum.com/t/xml-partial-issue/187216/2 "2010-04-20T00:35:34Z")

</div>

On Apr 19, 11:31 pm, Me [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Partial:
> 
> p\_xml.response do  
> p\_xml.tag!(x[:type]) do  
> p\_xml.message x[:msg]  
> end  
> end
> 
> When I view the page the xml shows up but not the header. When I  
> right click and view source then I can see the header info.

Sounds like it’s just the way your browser is choosing to display the  
xml.

Fred

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [April 20, 2010, 12:42am UTC](https://www.ruby-forum.com/t/xml-partial-issue/187216/3 "2010-04-20T00:42:36Z")

</div>

Well it is odd, if I put the code in the main view it shows up.

On Apr 19, 5:34 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
