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

The Archive Base Latest Questions

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

I have a situation where I have a path with a number of path

  • 0

I have a situation where I have a path with a number of path segments, and, for each path segment, I need to transform that path segment (presumably using a mapper), and then pass the original path segment AND the transformed path segment to a macro.

The problem is that it’s not clear to me how to transform the path, without assigning the transformed path to an immutable property.

The slightly simplified build file is below.

<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="scxml-js" basedir="." default="generate-javascript">
  <taskdef resource="net/sf/antcontrib/antcontrib.properties">
    <classpath>
      <pathelement location="${basedir}/lib/build-java/ant-contrib-0.6.jar" />
    </classpath>
  </taskdef>

  <property name="backends" value="switch,table,state"/>
  <property name="browsers" value="firefox,ie,chrome"/>
  <property name="for-ie" value="is-for-ie,is-not-for-ie"/>

  <path id="scxml-tests-xml">
    <pathelement location="test/kitchen_sink/KitchenSink.xml"/>
    <pathelement location="test/kitchen_sink/KitchenSink_dataModule.xml"/>
    <!-- ... -->
  </path>

  <!-- the macro call java with specific arguments -->
  <macrodef name="compile-with-scxml-js">
    <attribute name="backend"/>
    <attribute name="test-path"/>
    <attribute name="out-path"/>

    <sequential>
      <java classname="org.mozilla.javascript.tools.shell.Main" output="@{out-path}">
        <classpath>
          <pathelement location="lib/java/js.jar"/>
           <!-- ... -->
        </classpath>
        <arg value="${basedir}/runner.js"/>
        <arg value="${basedir}"/>
        <arg value="src/javascript/scxml/cgf/main"/>

        <arg value="--backend=@{backend}"/>
        <arg value="--beautify"/>
        <arg value="--ie"/>
        <arg value="@{test-path}"/>
      </java>
    </sequential>
  </macrodef>

  <!-- run unit and performance tests -->
  <target name="generate-javascript">

    <for list="${for-ie}" param="for-ie">
      <sequential>
        <for list="${backends}" param="backend">
          <sequential>
            <for param="test-path">
              <path refid="scxml-tests-xml"/>
              <sequential>

                <!-- do some manipulation -->
                <pathconvert property="target-test-path">
                  <path path="@{test-path}"/>
                  <chainedmapper>
                    <flattenmapper/>
                    <globmapper from="*.xml" to="build/@{backend}/@{for-ie}/*.js"/>
                  </chainedmapper>
                </pathconvert>

                <dirname property="target-test-path-dir" file="${target-test-path}"/>

                <echo>${target-test-path}, ${target-test-path-dir}</echo> 

                <!-- execute some tasks, call a macro -->

                <mkdir dir="${target-test-path-dir}"/>

                <compile-with-scxml-js-ie
                  test-path="@{test-path}"
                  backend="@{backend}"
                  out-path="${target-test-path}"/>
              </sequential>
            </for>
          </sequential>
        </for>
      </sequential>
    </for>
  </target>

</project>

Because target-test-path and target-test-path-dir will only be assigned once, this will repeatedly echo the following:
[echo] build/switch/is-for-ie/KitchenSink.js, /home/jacob/workspace/gsoc2010/git-scxml-js/scxml-js/build/switch/is-for-ie

I’d appreciate any guidance anyone can offer.

  • 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-16T08:41:19+00:00Added an answer on May 16, 2026 at 8:41 am

    You can use parameter values to construct property names, like this:

    <!-- do some manipulation -->
    <pathconvert property="@{backend}.@{for-ie}.target-test-path">
      <path path="@{test-path}"/>
      <chainedmapper>
        <flattenmapper/>
        <globmapper from="*.xml" to="build/@{backend}/@{for-ie}/*.js"/>
      </chainedmapper>
    </pathconvert>
    
    <dirname
      property="@{backend}.@{for-ie}.target-test-path-dir"
      file="${@{backend}.@{for-ie}.target-test-path}"
    />
    
    <echo>${@{backend}.@{for-ie}.target-test-path}, ${@{backend}.@{for-ie}.target-test-path-dir}</echo> 
    
    <!-- execute some tasks, call a macro -->
    
    <mkdir dir="${@{backend}.@{for-ie}.target-test-path-dir}"/>
    
    <compile-with-scxml-js-ie
      test-path="@{test-path}"
      backend="@{backend}"
      out-path="${@{backend}.@{for-ie}.target-test-path}"
    />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a situation where I need to return a directory path by reading
I have situation, where running a query that filters by an indexed column in
I have situation where I need to change the order of the columns/adding new
We have situation where say we have four engineers that are working on software
I have a situation with autofac registration where services are related to each other.
I have this situation: $(#button).toggle(function(){ $(#window).animate({top:'0%'},1000); },function(){ $(#window).animate({top:'-100%'},1000); }); but I need change it
So I have the following situation. I have a configuration class config.py that holds
I have the following situation on my new ASP.Net page: I am using a
I've got a situation where I need to resize a large number of images.
I have this situation. For example, Path: localhost/intranet/ If i enter this url: localhost/intranet/usuarios/actualizar/richard

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.