ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Removing html from xml

February 29, 2012 5:42am

Subscribe [3]
  • #1 / Feb 29, 2012 5:42am

    Martagnan

    10 posts

    Hello,
    I’m generating an XML feed for Google Merchant Centre.  All good so far except i’m getting HTML inserted between one of my tags.

    <g:price>
    £0.00
    </g:price>

    Is there any way to stop this so I just get

    <g:price>£0.00</g:price>

    My template has:

    <g:price>{price}</g:price>

    Many thanks

    Martin

  • #2 / Feb 29, 2012 6:07am

    mark186282

    290 posts

    is the tag being added by you, or automatically by the formatting type of the field (in other words, are you looking to “always remove the tag” or just “remove it for the xml”?

    If you’re just trying to remove it for the xml:

    try phpstringfun, and the PHP command “strip_tags”

    it would look something like:

    <g:price>{exp:phpstringfun function='strip_tags'}{price}{/exp:phpstringfun}</g:price>

    I hope this helps

    </code></pre>

     

  • #3 / Feb 29, 2012 3:57pm

    Shane Eckert

    7174 posts

    Hello Martagnan,

    Thank you for posting your question.

    Mark has provided you with an excellent response. If you do try this out, can you let us know how it goes?

    I do not believe I have much more to add, Mark is on it!

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases