...

View Full Version : Problem retrieving the value of <xsl:value-of select="body"...



michidan
01-16-2009, 07:27 PM
Hi,

I have a problem with an xml/xsl issue. I can't get the value of the 'body' element to display. the value of 'abstract' displays fine but no joy on the body.

Is body a reserved word or something?

Any help you could provide would be great.

Here is a snippet my xml:

<ci>
<abstract>Abstract Goes Here</abstract>
<body>Body Goes Here</body>
</ci>


Here is a snippet of my xsl:

<xsl:template match="/">
<xsl:for-each select="//ci">
<h3><xsl:value-of select="title" /></h3>

<p>
<xsl:value-of select="abstract" disable-output-escaping="yes" /> &nbsp;<br />
</p>
<p>
<xsl:value-of select="body" disable-output-escaping="yes" /> &nbsp;<br />
</p>

</xsl:for-each>
</xsl:template>

oesxyl
01-17-2009, 12:47 AM
put your code between [ code] and [ /code] tags without spaces please. You can edit your post to correct that. Thank you.

not sure if that will fix the problem, depend of what other template you have before this one, but try this:


<xsl:template match="ci">
<h3><xsl:value-of select="title" /></h3>
<p>
<xsl:value-of select="abstract" disable-output-escaping="yes" /> &nbsp;<br />
</p>
<p>
<xsl:value-of select="body" disable-output-escaping="yes" /> &nbsp;<br />
</p>
</xsl:template>


welcome to CF, :)
best regards



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum