[thelist] XML help please

Chris Spruck cspruck at mindspring.com
Thu Jun 6 00:30:24 CDT 2002


>At 12:43 PM 6/6/02 +1200, Duncan O'Neill wrote:
>The relevant bits of the XSLT file (for dealing
>with the HTML markup within the XML) are;
>
><xsl:for-each select="week/person">
>  <h3><xsl:value-of select="@nom" /></h3>
>  <img align="left" hspace="10"><xsl:attribute name="src">http://homepages.ihug.co.nz/~dbaxo/<xsl:value-of select="img_src" /></xsl:attribute></img>
>  <code><xsl:value-of select="quote" /></code>
>  <p><xsl:value-of select="bio/cdata()" disable-output-escaping="yes"/><a href="#top">TOP</a></p>

Duncan,

Thanks for the code sample. I did some more digging and have an idea, but may need specifics about the output. Where you use bio/cdata(), I think what might be more appropriate is bio/text(), but depending on how that gets parsed, it might grab the CDATA tags as well. Should get the text value, which, if it includes HTML source, might be OK.

Other than that, I can't tell what else could be wrong with this transform - it compares very closely to one of mine that works like a charm. So I'm clear, your problem is that the output renders like you've done a view source - i.e. you see tags and code where you expect it to just render the HTML itself? Do you see escaped entities like &lt; and so forth or are the tags fully rendered? Any other parts of the above snippet having a problem?

If the text() thing doesn't work, please send a sample of the XML and a sample of the output. Maybe that'll give me or someone else more clues.

Chris




More information about the thelist mailing list