Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7757829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:11:44+00:00 2026-06-01T13:11:44+00:00

In order to use xpath-functions (specifically the fn part), I included the respective namespace

  • 0

In order to use xpath-functions (specifically the fn part), I included the respective namespace into my xslt stylesheet, like so:

<xsl:stylesheet
  version="2.0"
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:fn="http://www.w3.org/2005/xpath-functions"
>

As specified by W3C.

However, when I use fn:document-uri, my XSLT engines tell me I called an unknown function/extension:

  <xsl:variable name="uri" select="fn:document-uri()" />

Opera says:

This document had an invalid XSLT stylesheet. Error message from the XSLT engine:
Error: XPath expression compilation failed: fn:document-uri()
Details: compilation error (characters 1-17, “fn:document-uri()”): unknown function called: ‘{ http://www.w3.org/2005/xpath-functions, document-uri }’

Firefox says:

Error during XSLT transformation: An unknown XPath extension function was called.

And xsltproc refuses transformation, because of xslt 2.0.

So, how do I specify the fn namespace properly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T13:11:46+00:00Added an answer on June 1, 2026 at 1:11 pm

    The problem is that you are using an XSLT 1.0 processor and an XSLT 1.0 processor doesn’t know (and must not know) anything about XPath 2.0 functions.

    If you use a real XSLT 2.0 processor, you don’t even have to specify the function namespace — it is a default namespace for any unprefixed function name.

    For example, this XSLT 2.0 transformation:

    <xsl:stylesheet version="2.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:output method="text"/>
    
     <xsl:template match="/">
        <xsl:sequence select="document-uri(.)" />
        <xsl:text>&#xA;</xsl:text>
        <xsl:sequence select="document-uri(document(''))" />
     </xsl:template>
    </xsl:stylesheet>
    

    when executed with Saxon 9.1.5 under the XSelerator, produces correctly the URLs of the source XML document and the stylesheet itself:

    file:/C:/Program%20Files/Java/jre6/bin/marrowtr.xml
    file:/C:/Program%20Files/Java/jre6/bin/marrowtr.xsl
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to use xsl/xpath (version 1.0) to do something special (for simplifying, say
I would like to use ORDER BY FIELD() (MySQL) in Django. Does Django support
I would like how to use the not in XPath properly. I just can't
I want to use ORDER BY clause in functions of SQL Server. But I
In order to use normal mapping in GLSL shaders, you need to know the
I understood that in order to use cookies inside of phonegap native app there
I'm trying to use the DataAnnotationsModelBinder in order to use data annotations for server-side
I've found that in order to use PRISM's classes in XAML you need to
I don't think that I can use ORDER BY clause inside the GROUP_CONCAT function.
I am trying to find my java class URL in order to use it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.