Re: [xsl] Looking Not Working for No Obvious Reason

Subject: Re: [xsl] Looking Not Working for No Obvious Reason
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 20 Jun 2007 21:53:35 +0100
> Input data is:..
saved as ek.xml

> The corresponding mapping entry is:
I commented out that entry from your original post and replaced it with
that (just in case there was a weird difference somewhere), and the
function you posted worked for me, see below.

failing user error, other possibility is system bug, I'm using
Saxon 8.9J from Saxonica
ie the latest full release of the basic processor, not a later version
from subversion for example.


<title>Overview and Background</title>


<xsl:stylesheet version="2.0" xmlns:xsl=""; xmlns:xs="";
     <xsl:variable name="sectionTitleMap" as="document-node()">
   <longtitle>Overview and Background</longtitle>
<!--       <item>
         <longtitle>Overview and Background</longtitle>
         <longtitle>Scope and Scope Exceptions</longtitle>
         <longtitle>Topical Definitions - Glossary</longtitle>

<!--I then have this function to do lookups:-->

     name="func:getShortTitleForSection" as="xs:string">
       <xsl:when test="count($sectionTitleMap//longtitle[. = 
$sectionBaseTitle]) = 1">
         <xsl:sequence select="$sectionTitleMap//item[longtitle[. = 
         <xsl:sequence select="$sectionBaseTitle"/>


<xsl:template match="title">
 Title: <xsl:value-of select="func:getShortTitleForSection(.)"/>


$ saxon8 ek.xml ek.xsl
<?xml version="1.0" encoding="UTF-8"?>
 Title: Background

The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 

Current Thread