Elements missing from output
I have a template that should produce plain text within <i> tags but the formatting tags are mysteriously missing from the result. This happened even when I changed them to <span> and yet when I inserted an asterisk (to check that the template is being processed), it appeared. I am using nested templates - is there a limit beyond which they become unreliable?
Here's the relevant code snippets:
<xsl:template match="title" mode="with-series">
<xsl:variable name="bookid" select="parent::book/@id" />
<xsl:variable name="clean-bookid" select="substring-after($bookid, 'BOO')" />
<xsl:variable name="title" select="." />
<xsl:value-of select="$title" />
<xsl:apply-templates select="following-sibling::series" />
<xsl:apply-templates select="parent::book/awards/award[@ref='AWA1']" />
<xsl:variable name="seriesid" select="@ref" />
<xsl:value-of select="$series/descendant::series[@id=$seriesid]/title" />
<xsl:if test="."> <small>[#<xsl:value-of select="." />]</small></xsl:if>
The only thing I can "guess" is that you are not retrieving values from the xml file...make sure all of your xslt variables are returning values..
The variables are all working. The 'dysfunctional' template is the second one (match="series"). The brackets, series name and sequence number are all output correctly. It's just the <i> tags that fail to get outputted.
Can you post xml file ?..I'll run it and see whats going on..:-)
Hope this is what you're asking for
<book id="BOO4" status="display" eligible="yes">
<title>The Other Wind</title>
<published isbn="1842552058" date="2002-05-02" />
<creators><author ref="CRE4" /></creators>
<synopsis><p>The wizard Alder comes from Roke to the island of Gont in search of the Archmage, Lord Sparrowhawk, once known as Ged. The man who was once the most powerful wizard in the Islands now lives with his wife Tenar and their adopted daughter Tehanu. Alder needs help: his beloved wife died and in his dreams she calls him to the land of the dead - and now the dead are haunting him, begging for release. He can no longer sleep, and the Wizards of Earthsea are worried.But there is more at stake than the unquiet rest of one minor wizard: for the dragons of Earthsea have arisen, to reclaim the lands that were once theirs. Only Tehanu, herself daughter of a dragon, can talk to them; it may be that Alder's dreams hold the key to the salvation of Earthsea and all the peoples who live there.</p></synopsis>
<book id="BOO5" status="display" eligible="yes">
<title>Otto and the Flying Twins</title>
<published isbn="0340855932" date="2002-09-12" />
<creators><author ref="CRE6" /></creators>
<synopsis><p>When Otto sees his father soothing what looks very much like a purple dragon, he finds his world suddenly becoming very odd. He discovers that his family and his city are the last remnants of the ancient magical world now under threat from the new human Normal Police, and something must be done.</p></synopsis>
The code below is from another file called series.xml. It is referenced from stylesheet as $series using a global parameter:
<xsl:param name="series" select="document('series.xml')" />
<title>The Earthsea Quintet</title>
PS. The <small> tags disappear as well.
Have uploaded the relevant files. Hope someone can help.
Try changing the <xsl: output> method attribute to html instead of xml, at the top of the XSL file. I had that problem a while ago.
Last edited by tobysaville; 05-05-2003 at 09:41 PM.
It didn't work. Still mystified.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)