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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:35:45+00:00 2026-05-29T05:35:45+00:00

I would like to generate a file from an intermixed content of inline code

  • 0

I would like to generate a file from an intermixed content of inline code snippets and contents of other files. Something like:

<target name="generate-js-function">
    <concat destfile="mycode.js">
        <header trimleading="yes">
            // begin auto generated
            var create = function() {
                function createHtmlSnippet1() {
        </header>

        <fileset file="snippet1.js"/>

        <header>
                }
        </header>

        <header trimleading="yes">
            // begin auto generated
            var create = function() {
                function createHtmlSnippet2() {
        </header>

        <fileset file="snippet2.js"/>

        <header>
                }
        </header>

                return '' + createHtmlSnippet1() + createHtmlSnippet2();

            }
            // end auto generated
        </header>
    </concat>
</target>

AFAIK, there can be only one header / footer, so what’s the proper way to do it?

Update: if anything in the question isn’t clear – please ask – I’ll clarify happily.

  • 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-29T05:35:46+00:00Added an answer on May 29, 2026 at 5:35 am

    For the inline snippets you can use the string resource:

    <concat destfile="mycode.js">
      <string>
        // begin auto generated
        var create = function() {
                function createHtmlSnippet1() {
      </string>
    
      <fileset file="snippet1.js"/>
    
      <string>
        }
      </string>
    
      ...
    
    </concat>
    

    The only downside is that it doesn’t support the trimleading attribute, but it will allow you to have the code inline in your build file.

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

Sidebar

Related Questions

I would like to know how I could generate code from a text file
I would like to generate a WSDL file from a c++ atl webservice without
I would like to know how to generate assembler code from a C program
I would like to generate a static html page from a php file and
I would like to generate a TSV file from a list of vehicles....I'll also
I would like to generate a list of files within a directory. Some of
I would like to generate a random text using letter frequencies from a book
I would like to have something like this be generated from hbm2ddl: ______________ ______________
I would like to generate on-the-fly word documents from a template and a XML
I have a java.hprof.txt file (automatically generated after an OutOfMemoryError) which I would like

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.