[xsl] document-uri gives empty sequence

Subject: [xsl] document-uri gives empty sequence
From: Manfred Staudinger <manfred.staudinger@xxxxxxxxx>
Date: Mon, 7 Nov 2005 05:05:10 -0800
Hi list,
I've troubles to get document-uri function working in Saxon 8.6,
even though I had it working in Saxon 8.5.1. The example in Michael
Kay's book "XPath 2.0" is very similar to the test case here
(p.333, 3rd line should read '<p><a href="{document-uri(.)}">' ):

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="2.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<doc>
	<xsl:for-each select="collection('Namen?select=*.xml')">
		<reg>
			<h1><xsl:value-of select="body/h3"/></h1>
			<uri><xsl:value-of select="document-uri(.)"/></uri>
		</reg>
	</xsl:for-each>
</doc>
</xsl:template>
</xsl:stylesheet>

With only 1 file in the input folder
<?xml version="1.0" encoding="UTF-8"?>
<body>
   <h3>Dr. Johann Ruprecht Hegenm|ller</h3>
</body>

I get this output - but no uri:
<?xml version="1.0" encoding="UTF-8"?>
<doc>
   <reg>
      <h1>Dr. Johann Ruprecht Hegenm|ller</h1>
      <uri/>
   </reg>
</doc>
What I'm missing?

Regards, Manfred Staudinger, Vienna

Current Thread