Page 1 of 1

reading values from a topic map...

Posted: Sun Apr 30, 2006 7:44 pm
by wilkinsr
I've been trying to use a stylesheet to pass values from a topic file referenced in a map to the Antennal House DITOtoFO stylesheet, and have had no luck. I started by adding a topic file to a sample map . The topic file I added contains the usual 'bookinfo' kind of info:

//prolog/copyrholder
//vrm/@version
//vrm/@release)
//copyryear[1]/@year
//copyryear[2]/@year

I changed the map to look like this:

<map title="Eclipse content aggregated by a map">
<topicref href="bookinfo.xml" type="topic"></topicref>
<topicref href="tasks/changingtheoil.xml" type="task"></topicref>
<topicref href="tasks/organizing.xml" type="task"></topicref>
<topicref href="tasks/shovellingsnow.xml" type="task"></topicref>
<topicref href="tasks/spraypainting.xml" type="task"></topicref>
.
.
.
</map>

If I read against the test file (bookinfo.xml), I can retrieve these values pretty easily. If I try reading the file from the map, I can't seem to get anything. Here's the code I used to test against the bookinfo.xml file:

<xsl:template match="/">
<xsl:value-of select="//prodname"/>
<xsl:variable name="MyCompany" select="concat(//prolog/copyrholder,'Inc.')"/>
<xsl:variable name="version" select="concat(//vrm/@version, '.',//vrm/@release)"/>
<xsl:variable name="copyrdates" select="concat('© ',//copyryear[1]/@year,' – ',//copyryear[2]/@year)"/>
<xsl:variable name="tmblock" select="concat('Copyright ',$copyrdates,' ',$MyCompany, //body)"/>
<xsl:value-of select="$version"/>
</xsl:template>

That works, but when I try to reference the file in the map explicitly, with code that looks like this:

<xsl:template match="//topicref[@href='bookinfo.xml']">

I seem to get a match on the file, but an editor full of white space. I know that I'm missing something, but what that may be, I have no idea.

Any suggestions?

Posted: Mon May 01, 2006 5:26 pm
by jkmyoung
Are you actually applying the template to this topicref node?
as in <xsl:apply-templates select="//topicref"/>