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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:45:49+00:00 2026-05-16T17:45:49+00:00

I am inserting two variables countryVar and langVar into a node in my xml

  • 0

I am inserting two variables countryVar and langVar into a node in my xml document.

<link><![CDATA[/<% = countryVar %>/<% = langVar %>/products/index.aspx]]></link>

I am utilizing the link node in a xslt like this.

<a href="{link}"><xsl:value-of select="linkName"/></a>

The value of link prints out exactly like it is in the xml document. Is there any way to get the two vb.net variables countryVar and langVar to process and print out there value? The values are stored in cache and are pulled into the page.

Thanks

  • 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-16T17:45:50+00:00Added an answer on May 16, 2026 at 5:45 pm

    XSLT doesn’t know anything about the variables in the (VB.NET) program that initiated the transformation.

    There are two different ways to pass values of variables to the transformation:

    1. Pass them as global parameters to the transformation. Read more how to do this together with XslCompiledTransform.Transform() :::: here.

    2. Modify the source XML document (after loading it, to contain the values of the variables in certain nodes.

    I recommend method 1. above.

    UPDATE:

    Obviously you are using a variation of method 2. above. In this case it is not a good idea at all to put the values of the variables inside the same string.

    Much better than:

    <link><![CDATA[/<% = countryVar %>/<% = langVar %>/products/index.aspx]]></link>
    

    (and it would be straightforward to process with XSLT afterwards, is:

    <link>
      <country><% = countryVar %></country>
      <slash>/</slash>
      <lang><% = langVar %></lang>
      <tail-link>/products/index.aspx</tail-link>
      <linkName>Whatever link text</linkName>
    </link>
    

    Then the XSLT code that processes this will be just:

     <a href="{link}"><xsl:value-of select="linkName"/></a>
    

    (this assumes that you have <xsl:strip-space elements="*"/> at the global level in your stylesheet).

    and the values of the variables are:

    link/country
    

    and

    link/lang
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table with two decimal(18,0) fields. I am inserting into this table,
When inserting copy into an HTML document I get from sources such as word
I have two tables that i am inserting records into. I am using PHP
I'm working with three tables, but only inserting into two( one called images, and
I am inserting data into two tables, however I can not figure out (after
I need to insert a new element into an XML document using XQuery insert
I'm trying to insert some data from a XML document into a variable table.
I have an INSERT query that is pulling data from two tables and inserting
When inserting a record to a database, the server returns an 'undefined index: category',
When inserting a row into a table with an auto increment primary key column,

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.