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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:39:11+00:00 2026-05-24T23:39:11+00:00

XSL noob here :-) I’ve got the following template which is being used to

  • 0

XSL noob here 🙂

I’ve got the following template which is being used to produce a dropdown for my ANT script.

    <!-- Dropdown templates -->
<xsl:template name="componentDropdown">
    <xsl:text>trunk</xsl:text>
    <!-- Branch Data -->
    <xsl:for-each select="document('../../../temp/components_branches.xml')/lists/list/entry">
        <xsl:sort select="commit/@revision" order="descending" />
        <xsl:text>;branches/</xsl:text>
        <xsl:value-of select="name" />
    </xsl:for-each>

    <!-- Tag Data -->
    <xsl:for-each select="document('../../../temp/components_tags.xml')/lists/list/entry">
        <xsl:sort select="commit/@revision" order="descending" />
        <xsl:if test="name != 'archive'">
            <xsl:text>;tags/</xsl:text>
            <xsl:value-of select="name" />
        </xsl:if>               
    </xsl:for-each>
</xsl:template>

The thing is that I’ve got this three times over – cut & paste job – all the same but the reference to “components” is being swapped for “plugins” and “website”. We’ve got a few more ANT scripts I’d like to migrate to this as well so ideally I’d like this as a reusable function-based template of some kind.

Working in progress but I’ve currently got the following:-

    <xsl:template name="dropdown">
    <xsl:param name="type">website</xsl:param>
    <xsl:param name="path"></xsl:param>

    <!-- Branch Data  -->
    <xsl:text><xsl:value-of select="$path" /></xsl:text>       
    <xsl:for-each select="document(concat('../../../temp/{$type}_tags.xml',''))/lists/list/entry">
        <xsl:sort select="commit/@revision" order="descending" />
        <xsl:text>;branches/</xsl:text>
        <xsl:value-of select="name" />
    </xsl:for-each>
</xsl:template> 

The issue seems to be getting the documnet() function to accept dynamic variables.

Only other thing I can say is the XSL is declared as 1.0. I don’t know if that makes a difference but any pointers are appreciated :).

Cheers,
James

  • 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-24T23:39:11+00:00Added an answer on May 24, 2026 at 11:39 pm

    To make document() works properly, you need to concatenate as follows:

     document(concat('../../../temp/',$type,'_tags.xml',''))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In XSL 1.0, I am trying to distinguish between the following 2 scenarios which
I have the following xsl template that I'm using to group my xsl. The
I have following XsL which opens the link in the same window. I would
I have the following xsl with me <Root> <child> <Book name=Title value=hailey /> <Book
I have an xsl:fo style sheet that refers to a URL which is an
I have an XSL style sheet for which I need to add some custom
Learning XSL, relegated at this time to XSL 1.0, trying to produce a distinct
I have an xsl page which uses <xsl:variable name=pos select=Position()/> in the onchange events
I have an XSL template that is selected for execution (below). What I would
I have an XSL transformation where I used to query a string that way:

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.