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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:45:14+00:00 2026-05-18T08:45:14+00:00

I have an XSL file which uses a a static website link as shown

  • 0

I have an XSL file which uses a a static website link as shown below:

<xsl:template match="my_match">

    <xsl:variable name="variable1">
        <xsl:value-of select="sel1/Label = 'Variable1'"/>
    </xsl:variable>
    <xsl:copy-of select="sites:testPath('http://testsite.com/services/testService/v1.0', $fname, $lname,
     $email , $zip, $phone, $comments, $jps, boolean($myvar), string(cust/@custID), string(@paID))"/>
</xsl:template>

My question is that how to read a properties file(key value pair) in the xsl file. so in my properties file (e.g. site.properties) I have a key called site i.e. site=testsite.com/services/testService/v1.0

I want to use this site key in place of specifying url value in the xsl i.e. http://testsite.com/services/testService/v1.0. The reason for doing this is that this link changes depending on the various environments.

Is this possible?
Please give your suggestions or a sample code if possible…Also if this is not possible…is there any work-around?

  • 1 1 Answer
  • 1 View
  • 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-18T08:45:15+00:00Added an answer on May 18, 2026 at 8:45 am

    As a proof of concept:

    Input .properties file:

    # You are reading the ".properties" entry.
    ! The exclamation mark can also mark text as comments.
    website = http://example.com
    language = English
    key\ with\ spaces = This is the value that could be looked up with the key "key with spaces".
    

    Stylesheet:

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:f="Functions"
      version="2.0">
    
      <xsl:variable name="properties" select="unparsed-text('.properties')" as="xs:string"/>
    
      <xsl:template match="/" name="main">
        <xsl:value-of select="f:getProperty('language')"/>
      </xsl:template>
    
      <xsl:function name="f:getProperty" as="xs:string?">
        <xsl:param name="key" as="xs:string"/>
        <xsl:variable name="lines" as="xs:string*" select="
          for $x in 
            for $i in tokenize($properties, '\n')[matches(., '^[^!#]')] return
              tokenize($i, '=')
            return translate(normalize-space($x), '\', '')"/>
        <xsl:sequence select="$lines[index-of($lines, $key)+1]"/>
      </xsl:function>
    
    </xsl:stylesheet>
    

    The f:getProperty('language') will return ‘English’.

    See this as a proof of concept, this needs to be improved in many ways since it does not handle many of the different ways a .properties file can be authored.

    I belive Alejandro or Dimitrie probably could improve this many times.

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

Sidebar

Related Questions

I have a simple XSL file which looks like: <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform version=1.0>
I have 3 XSL files which have paths in them to something like C:\templates\Test\file.pdf
I have an XML file which is transformed with XSL. Some elements have to
I have a xsl file which is fetching data and storing in a variables
I have an .xml file which has an accompanying .xsl file. The output of
I have an xml file which I need to group-by using xsl:for-each-group. Everything works
i have a xsl file as below: -------Begin------ <?xml version=1.0 encoding=utf-8?> <xsl:stylesheet version=2.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform
I have an XML document which references a XSL file for the output of
I have a JSP file which creates an Excel document. I want to dynamically
I have a problem between XML and XSL files. In XML file, there are

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.