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 4580026
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T20:43:30+00:00 2026-05-21T20:43:30+00:00

I’m learning XSLT. These questions may be obvious, but I’m really stuck now. Oxygen

  • 0

I’m learning XSLT. These questions may be obvious, but I’m really stuck now.
Oxygen returns the following two kind of errors:

  1. Namespace is not declared for ‘ownFunction()’. (“undeclared namespace prefix {xs}”)

  2. unknown system function index-of-string()

    The XSLT function index-of-string I got from this website doesn’t seems to be recognized

This is a simplified version of the XSL file:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"     xmlns:foo="http://www.wathever.com">
<xsl:output method="xml" />

  <xsl:function name="foo:ownFunction" as="xs:string">
    <xsl:param name="string" as="xs:string"/>

        <xsl:choose>

          <xsl:when test='contains($string,"src=")'>
            <xsl:variable name="position"><xsl:value-of select="index-of-string($string,'src=')"/>+<xsl:number value="10"/></xsl:variable>
            <xsl:variable name="partString"><xsl:value-of select="substring($string,$position)"/></xsl:variable>
            <xsl:variable name="length"><xsl:value-of select="index-of-string($partString,'quot;')"/> - <xsl:number value="2"/></xsl:variable>
            <xsl:value-of select="substring($partString,1,$length)"/>
          </xsl:when>

          <xsl:otherwise>
            <xsl:value-of select="hotpot-jmatch-file/data/title"/>
          </xsl:otherwise>

        </xsl:choose>
  </xsl:function>

  <xsl:template match="/">
    <data>
      <title>
        <xsl:variable name="string"><xsl:value-of select="hotpot-jmatch-file/data/title"/></xsl:variable>
        <xsl:value-of select="foo:ownFunction($string)"/>
      </title>
    </data>
  </xsl:template>
</xsl:stylesheet>
  • 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-05-21T20:43:31+00:00Added an answer on May 21, 2026 at 8:43 pm

    Oxygen returns the following two kind
    of errors:

    1) Namespace is not declared for
    ‘ownFunction()’. (“undeclared
    namespace prefix {xs}”)

    This is actually an XML issue. Any XSLT stylesheet myst be a well-formed XML document. Among other requirements for well-formedness, any namespace prefix used must be bound to a namespace URI in a namespace declaration.

    To correct this bind the "xs" prefix to "http://www.w3.org/2001/XMLSchema" — this means to add xmlns:xs="http://www.w3.org/2001/XMLSchema" to an element (usually the top element is a good choice for this namespace.

    You have the same problem with "foo:ownFunction". You must have the prefix "foo" bound/defined and visible, before using it. Just add xmlns:foo="my:foo" to the top element of your stylesheet.

    2) “unknown system function
    index-of-string()”. The XSLT function
    “index-of-string” I got from this
    website doesn’t seems to be
    recognized:
    http://www.xsltfunctions.com/xsl/functx_index-of-string.html

    You have forgotten to either copy and paste the function from Priscilla Walmsley’s site or to save it in a separate file (recommended) and then use <xsl:import> or <xsl:include> to import/include this stylesheet file to your transformation.

    Finally, such issues show that you need a more systematic introduction of XSLT. Get a good book and read it well. You won’t be sorry. This answer may be useful in listing what I consider good XSLT and XPath learning resources.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
Seemingly simple, but I cannot find anything relevant on the web. What is the
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I've tracked down a weird MySQL problem to the two different ways I was

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.