Preserve the <p> tag on the content.

csaladores's Avatar

csaladores

26 Jun, 2015 06:55 PM

Hi,

When using rss20.xsl, it seems to strip the <p> tag. Attached are the xslt files. Can someone please help and check the xsl? Thank you so much.

Christian

  1. 1 Posted by csaladores on 01 Jul, 2015 04:02 PM

    csaladores's Avatar

    Hi,

    Just wanted to follow up.

  2. 2 Posted by Ryan Griffith on 01 Jul, 2015 05:17 PM

    Ryan Griffith's Avatar

    Hi Christian,

    Looking over the XSLT Formats you attached, I am not seeing any obvious reason as to why the <p> tags are being removed. One thing I'd like for you to try is adjusting your chooser-summary template to the following to see if that makes a difference:

    <xsl:template name="choose-summary">            
      <xsl:if test="system-data-structure/paragraph_content/node()">
        <xsl:apply-templates mode="asHTML" select="system-data-structure/paragraph_content"/>
      </xsl:if>
    </xsl:template>
    

    So the adjustment here is not to pass in node() when applying the templates.

    Please let me know if you have any questions.

    Thanks!

  3. 3 Posted by csaladores on 01 Jul, 2015 07:34 PM

    csaladores's Avatar

    Hi Ryan,

    I tried. Every tags were preserved except the <p> tag. Does it have something to do with the xhtml2escapedHtml xslt?

    Christian

  4. 4 Posted by Ryan Griffith on 01 Jul, 2015 08:03 PM

    Ryan Griffith's Avatar

    Hi Christian,

    Definitely interesting since there really isn't anything in that escaping XSLT that appears to be targeting <p> tags.

    You can certainly try removing the usage of that template and replace it with <xsl:copy-of select="/path/to/element/node()"/>. Note; however, this will cause your RSS to be invalid since I think the description can't contain HTML unless it's wrapped with CDATA tags.

    Please let me know if you have any questions.

    Thanks!

  5. 5 Posted by csaladores on 01 Jul, 2015 08:43 PM

    csaladores's Avatar

    That’s what I thought. I’m not sure why others where encoded but it just stripped the <p> tags.

  6. 6 Posted by Ryan Griffith on 02 Jul, 2015 07:28 PM

    Ryan Griffith's Avatar

    Curious, but could you try using the original version of xhtml2escapedHtml.xsl to see if that changes the result? Let me know how it goes.

    Thanks!

  7. 7 Posted by csaladores on 02 Jul, 2015 07:28 PM

    csaladores's Avatar

    Sounds good Ryan. I’ll give it a shot.

    Thanks,
    Christian

  8. Tim closed this discussion on 17 Jul, 2015 02:35 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac