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.

xml encode delimiter

July 27, 2012 6:33pm

Subscribe [3]
  • #1 / Jul 27, 2012 6:33pm

    mr_ripley

    45 posts

    I am using the XML plugin by Ellis Labs.  {exp:xml_encode}{/exl:xml_encode}  Is there any way to change the delimiter used when the feed is published?  Instead of using a comma, I would like to use a
    or hard return.

    Please advise.

  • #2 / Jul 30, 2012 12:54pm

    Kyle Cotter

    730 posts

    Hi mr_ripley,

    Can you give me an example of something that’s getting delimited? As this plugin simply encodes, I’m having trouble figuring out what you’re trying to do. If you can provide an example, that’d be great.

    Thanks!

  • #3 / Jul 30, 2012 1:09pm

    mr_ripley

    45 posts

    This is from the feed:

    <item>
    <fname>John</fname>
    <mname>M.</mname>
    <lname>Doe</lname>
    <degree>B. S., University of California at Los Angeles
    O.D., SCCO
    Residency in Pediatric Optometry and Vision Therapy, SCCO</degree>
    Assistant Professor</position>
    </item

    Under “Degree”  the information in the originating database has each degree on a new line. The EXP:XML_ENCODE has automatically placed a comma between each new item from that database field.  I would like to replace the comma with a different character, or preferably make the delimiter a
    .

    Do you have any suggestions for a different delimiter and how to incorporate that?

  • #4 / Jul 30, 2012 7:30pm

    Robin Sowell

    13255 posts

    Hrm- xml_encode really shouldn’t be adding commas at all- it basically converts xml characters to entities:

    $str = str_replace(array("&","<",">","\"", "'", "-"),
           array("&", "<", ">", """, "'", "-"),
           $str);

    It’s a wee bit more complicated, what with the ‘protect_entities’ param, but not much.

    So- let’s see where those commas are coming from.

    What’s the actual channel entry tag look like on your rss/xml page?

    And if you stick the exact same tag on a web page and remove the xml plugin- can you link to that, and the rss feed?  If not- can you compare the two yourself- let’s make sure the commas aren’t there w/out the xml tag. And then figure out why they are there on your feed.

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

ExpressionEngine News!

#eecms, #events, #releases