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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:18:05+00:00 2026-06-17T22:18:05+00:00

I have an .xslt file with just a few variables in it. I need

  • 0

I have an .xslt file with just a few variables in it. I need to update two of them using Powershell. The file looks like:

 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:variable name="VarA" select="this data stays the same" />
    <xsl:variable name="VarB" select="this data also stays the same" />

    <xsl:variable name="ChangeMe_1" select="data to be changed" />
    <xsl:variable name="ChangeMe_2" select="more data to be changed" />

 </xsl:stylesheet>

I need to update the select values in the variables named ChangeMe_1 and ChangeMe_2 to parameters passed into the Powershell script. I’m a total newbie at Powershell, and I’m finding lots of resources on parsing XML files, but this xslt is just different enough that it’s confounding me.

Additionally, this needs to be done in every .xslt file with the same name in a hierarchy of folders, so if anyone can point me in the right direction for that I’d very much appreciate it.

  • 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-17T22:18:06+00:00Added an answer on June 17, 2026 at 10:18 pm

    Something like this, I suggest to test it in a test folder before run it in production:

    param ($path, $filename, $newvalue)
    
    $files = dir $path -filter $filename -Recurse
    foreach ($file in $files)
    {
    [xml]$xml= gc $file.fullname
    $xml.stylesheet.variable | ? { $_.name -match 'ChangeMe_[1|2]' } | % {$_.select= $newvalue }
    $xml.Save($file.fullname)
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XML file that I need to transform using an XSL script.
I have an XSLT file generating plain HTML. I need to wrap some elements
I have an XML file which has to be transformed using XSLT, I am
I have an XML file that I want to transform using an XSLT. It
I have an XML file that looks like this: <zoo xmlns="http://myurl.com/wsdl/myservice"> <animal>elephant</animal> <exhibit> <animal>walrus</animal>
I am trying to remove nodes from an XML file. Using just one XSLT
I have an XSLT stylesheet that transforms an XML file to JSON format and
I have this XSLT 2.0: <xsl:stylesheet version=2.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform> <xsl:output indent=yes/> <xsl:strip-space elements=*/> <xsl:template match=node()|@*>
I have an XSLT in which I create (from the input data) intermediary variables
Next question: I have InputDoc xml document and xslt file in order to transform

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.