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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:15:18+00:00 2026-06-08T07:15:18+00:00

I have an applescript that is using xmltransform to transform a xml using and

  • 0

I have an applescript that is using xmltransform to transform a xml using and external xlst file. I would like to add a variable in applescript to be picked up by the xslt file.
The satimage dictionary talks about the use of xsl params as part of xmltransform but i cannot find any examples.

Using the template XMLTransform xmlFile with xsltFile in outputpath
how would i define the variables both in the applescript and in the following
xsl file example.

<xsl:stylesheet version="1.0">
    <xsl:param name="vb1" value="'unknown'"/>
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>
  <xsl:template match="xmeml/list/name">
    <xsl:value-of select="{$vb1}"/>
  </xsl:template>
</xsl:stylesheet>

Applescript snippet

set vb1 to "Hello" as string
XMLTransform xmlFile with xsltFile1 in outputpathtemp xsl params vb1

The current applescript returns “cannot make vb1 into record”.

I am now looking at using the following but it is returning NULL in the XML

set vb1 to {s:"'hello'"}
XMLTransform xmlFile with xsltFile1 in outputpathtemp xsl string params vb1

the input is

<xmeml>
   <list> 
     <name>IMaName</name>
     <!-- other nodes -->
   </list>
</xmeml>

the current output is

<xmeml>
   <list> 
     <name/>
     <!-- other nodes -->
   </list>
</xmeml>

Can anyone Help please?
many 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-06-08T07:15:19+00:00Added an answer on June 8, 2026 at 7:15 am

    Here is the Answer:

    applescript

    XMLTransform xmlFile with xsltFile1 in outputpathtemp xsl params {"vb1", "'hello'"}
    

    XSLT

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" indent="yes"/>
    
    <xsl:param name="vb1" />
    
    <xsl:template match="@*|node()">
      <xsl:copy>
        <xsl:apply-templates select="@*|node()"/>
      </xsl:copy> 
    </xsl:template>
    
    <xsl:template match="/xmeml/list/name">
    <xsl:element name="name">
           <xsl:value-of select="$vb1"/>
        </xsl:element>
     </xsl:template>
    </xsl:stylesheet>
    

    Thanks.

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

Sidebar

Related Questions

I have a simple 'repeat with' in an AppleScript, and would like to move
I have an application that can import an XML file through this terminal command
I have a lovely AppleScript droplet which performs OCR of a PDF file using
Im using system events to control a program that does not have a applescript
I have an applescript that reads data from a CSV (successfully!). After my script
I have a problem using a simple AppleScript on Mac OSX 10.7.3. With the
i have a py2app application, which runs an appscript using py-appscript. the Applescript code
I have a txt plain file that has a list of numbers. One number
I have an applescript that gets a string at one point and checks if
I have been trying to write some applescript that checks to see if the

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.