tags:

views:

28

answers:

2
<xsl:for-each select="$all_events[g:active = true()][g:body/g:current = true()]">
        <xsl:for-each select="g:body">
            <h2 class="normal"><xsl:value-of select="g:sub_title" /></h2>
                <xsl:for-each select="g:paragraphs">
                    <xsl:text><xsl:value-of select="g:paragraph" /></xsl:text>
                </xsl:for-each>
        </xsl:for-each>
     </xsl:for-each>

Here is my XSL, take notice to the following line:

<xsl:text><xsl:value-of select="g:paragraph" /></xsl:text>

I tried this because the g:paragraph is coming from a WYSIWYG and it was printing out the <p> </p> tags and whatever else. This process of encapsulating it within xsl:text tags caused an error. What is the proper way to either hide the tags (because I want the styles to still be applied if included (i.e. bold, underlined)?

Edit:

The output currently is <p>whatever</p>

I want it to be whatever

A: 

Ah, I figured it out. I just had to use disable-output-escaping="yes"

Bry4n
So `g:paragraph` just contains text, not an HTML node? `disable-output-escaping` is still outputting a `<p>` tag, then. You're not actually removing it.
Welbog
It is but it's not printing it out as text. Regardless it works.
Bry4n
A: 

You want to select the text content from a p element inside the g:paragraph element. You can do that this way:

<xsl:for-each select="g:paragraphs">
  <xsl:value-of select="g:paragraph/p" />
</xsl:for-each>
Welbog
What about if there are other HTML tags?
Bry4n